language
stringlengths 0
24
| filename
stringlengths 9
214
| code
stringlengths 99
9.93M
|
---|---|---|
Text | wireshark/plugins/epan/transum/CMakeLists.txt | # CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <[email protected]>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
include(WiresharkPlugin)
# Plugin name and version info (major minor micro extra)
set_module_info(transum 2 0 4 0)
set(DISSECTOR_SRC
packet-transum.c
)
set(DISSECTOR_SUPPORT_SRC
decoders.c
extractors.c
)
set(PLUGIN_FILES
plugin.c
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
)
set_source_files_properties(
${PLUGIN_FILES}
PROPERTIES
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
)
register_plugin_files(plugin.c
plugin
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
)
add_wireshark_plugin_library(transum epan)
target_link_libraries(transum epan)
install_plugin(transum epan)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
transum
SWITCHES
--group dissectors-prohibited
--group dissectors-restricted
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
${DISSECTOR_HEADERS}
)
#
# Editor modelines - https://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
# |
C | wireshark/plugins/epan/transum/decoders.c | /* decoders.c
* Routines for the TRANSUM response time analyzer post-dissector
* By Paul Offord <[email protected]>
* Copyright 2016 Advance Seven Limited
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <stdio.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/dissectors/packet-tcp.h>
#include "packet-transum.h"
#include "preferences.h"
#include "extractors.h"
#include "decoders.h"
extern TSUM_PREFERENCES preferences;
/* Returns the number of sub-packets of interest */
int decode_syn(packet_info *pinfo _U_, proto_tree *tree _U_, PKT_INFO* pkt_info)
{
if (pkt_info->tcp_flags_ack)
pkt_info->rrpd.c2s = FALSE;
else
{
pkt_info->rrpd.c2s = TRUE;
add_detected_tcp_svc(pkt_info->dstport);
}
pkt_info->rrpd.session_id = 1; /* Fake session ID */
pkt_info->rrpd.msg_id = 1; /* Fake message ID */
pkt_info->rrpd.decode_based = TRUE;
pkt_info->rrpd.calculation = RTE_CALC_SYN;
pkt_info->pkt_of_interest = TRUE;
return 1;
}
/*
This function sets basic information in the sub_packet entry.
Because we don't expect multiple DCE-RPC messages in a single packet
we only use single PKT_INFO
Returns the number of sub-packets of interest, which in this case is always 1.
*/
int decode_dcerpc(packet_info *pinfo _U_, proto_tree *tree, PKT_INFO* pkt_info)
{
guint32 field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */
size_t field_value_count; /* How many entries are there in the extracted field array */
guint32 dcerpc_cn_ctx_id = 0;
if (!extract_uint(tree, hf_of_interest[HF_INTEREST_DCERPC_VER].hf, field_uint, &field_value_count))
{
if (field_value_count)
pkt_info->dcerpc_ver = field_uint[0];
}
if (!extract_uint(tree, hf_of_interest[HF_INTEREST_DCERPC_PKT_TYPE].hf, field_uint, &field_value_count))
{
if (field_value_count)
pkt_info->dcerpc_pkt_type = field_uint[0];
}
if (field_value_count)
{
if (!extract_uint(tree, hf_of_interest[HF_INTEREST_DCERPC_CN_CTX_ID].hf, field_uint, &field_value_count))
{
if (field_value_count)
dcerpc_cn_ctx_id = field_uint[0];
}
if (is_dcerpc_context_zero(pkt_info->dcerpc_pkt_type))
{ /* This is needed to overcome an apparent Wireshark bug
found in the Lua code - is this still true in C? */
pkt_info->rrpd.session_id = 1;
}
else
{
if (dcerpc_cn_ctx_id)
pkt_info->rrpd.session_id = dcerpc_cn_ctx_id;
else
pkt_info->rrpd.session_id = 1;
}
if (!extract_uint(tree, hf_of_interest[HF_INTEREST_DCERPC_CN_CALL_ID].hf, field_uint, &field_value_count))
{
if (field_value_count)
pkt_info->rrpd.msg_id = field_uint[0];
}
}
else
{
/*
we don't have header information and so by setting the session_id and msg_id to zero
the rrpd functions will either create a new rrpd_list (or temp_rsp_rrpd_list) entry
or update the last entry for this ip_proto:stream_no.
*/
pkt_info->rrpd.session_id = 0;
pkt_info->rrpd.msg_id = 0;
}
if (is_dcerpc_req_pkt_type(pkt_info->dcerpc_pkt_type))
{
pkt_info->rrpd.c2s = TRUE;
wmem_map_insert(preferences.tcp_svc_ports, GUINT_TO_POINTER(pkt_info->dstport), GUINT_TO_POINTER(RTE_CALC_DCERPC)); /* make sure we have this DCE-RPC service port set */
}
else
{
pkt_info->rrpd.c2s = FALSE;
wmem_map_insert(preferences.tcp_svc_ports, GUINT_TO_POINTER(pkt_info->srcport), GUINT_TO_POINTER(RTE_CALC_DCERPC)); /* make sure we have this DCE-RPC service port set */
}
pkt_info->rrpd.decode_based = TRUE;
pkt_info->rrpd.calculation = RTE_CALC_DCERPC;
pkt_info->pkt_of_interest = TRUE;
return 1;
}
/* Returns the number of sub-packets of interest */
int decode_smb(packet_info *pinfo _U_, proto_tree *tree, PKT_INFO* pkt_info, PKT_INFO* subpackets)
{
guint32 field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */
size_t field_value_count; /* How many entries are there in the extracted field array */
guint64 ses_id[MAX_RETURNED_ELEMENTS];
size_t ses_id_count;
guint64 msg_id[MAX_RETURNED_ELEMENTS];
size_t msg_id_count;
/* set the direction information */
if (pkt_info->dstport == 445)
pkt_info->rrpd.c2s = TRUE;
else
pkt_info->rrpd.c2s = FALSE;
if (!extract_uint(tree, hf_of_interest[HF_INTEREST_SMB_MID].hf, field_uint, &field_value_count))
{
if (field_value_count)
{
pkt_info->rrpd.calculation = RTE_CALC_SMB1;
pkt_info->pkt_of_interest = FALSE; /* can't process SMB1 at the moment */
return 0;
}
}
/* Default in case we don't have header information */
pkt_info->rrpd.session_id = 0;
pkt_info->rrpd.msg_id = 0;
pkt_info->rrpd.decode_based = TRUE;
pkt_info->rrpd.calculation = RTE_CALC_SMB2;
pkt_info->pkt_of_interest = TRUE;
extract_ui64(tree, hf_of_interest[HF_INTEREST_SMB2_MSG_ID].hf, msg_id, &msg_id_count);
if (msg_id_count) /* test for header information */
{
extract_ui64(tree, hf_of_interest[HF_INTEREST_SMB2_SES_ID].hf, ses_id, &ses_id_count);
for (size_t i = 0; (i < msg_id_count) && (i < MAX_SUBPKTS_PER_PACKET); i++)
{
subpackets[i].rrpd.c2s = pkt_info->rrpd.c2s;
subpackets[i].rrpd.ip_proto = pkt_info->rrpd.ip_proto;
subpackets[i].rrpd.stream_no = pkt_info->rrpd.stream_no;
subpackets[i].rrpd.session_id = ses_id[i];
subpackets[i].rrpd.msg_id = msg_id[i];
subpackets[i].rrpd.decode_based = TRUE;
subpackets[i].rrpd.calculation = RTE_CALC_SMB2;
subpackets[i].pkt_of_interest = TRUE;
}
return (int)msg_id_count;
}
return 1;
}
/* Returns the number of sub-packets of interest */
int decode_gtcp(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info)
{
guint32 field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */
gboolean field_bool[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */
size_t field_value_count; /* How many entries are there in the extracted field array */
if (!extract_uint(tree, hf_of_interest[HF_INTEREST_TCP_STREAM].hf, field_uint, &field_value_count)) {
if (field_value_count)
pkt_info->rrpd.stream_no = field_uint[0];
}
pkt_info->srcport = pinfo->srcport;
pkt_info->dstport = pinfo->destport;
if (!extract_uint(tree, hf_of_interest[HF_INTEREST_TCP_LEN].hf, field_uint, &field_value_count)) {
if (field_value_count)
pkt_info->len = field_uint[0];
}
if (!extract_bool(tree, hf_of_interest[HF_INTEREST_TCP_FLAGS_SYN].hf, field_bool, &field_value_count)) {
if (field_value_count)
pkt_info->tcp_flags_syn = field_bool[0];
}
if (!extract_bool(tree, hf_of_interest[HF_INTEREST_TCP_FLAGS_ACK].hf, field_bool, &field_value_count)) {
if (field_value_count)
pkt_info->tcp_flags_ack = field_bool[0];
}
if (!extract_bool(tree, hf_of_interest[HF_INTEREST_TCP_FLAGS_RESET].hf, field_bool, &field_value_count)) {
if (field_value_count)
pkt_info->tcp_flags_reset = field_bool[0];
}
/*
* This is an expert info, not a field with a value, so it's either
* present or not; if present, it's a retransmission.
*/
if (!extract_instance_count(tree, hf_of_interest[HF_INTEREST_TCP_RETRAN].hf, &field_value_count)) {
if (field_value_count)
pkt_info->tcp_retran = TRUE;
else
pkt_info->tcp_retran = FALSE;
}
/*
* Another expert info.
*/
if (!extract_instance_count(tree, hf_of_interest[HF_INTEREST_TCP_KEEP_ALIVE].hf, &field_value_count)) {
if (field_value_count)
pkt_info->tcp_retran = TRUE;
else
pkt_info->tcp_retran = FALSE;
}
/* we use the SSL Content Type to detect SSL Alerts */
if (!extract_uint(tree, hf_of_interest[HF_INTEREST_SSL_CONTENT_TYPE].hf, field_uint, &field_value_count))
{
if (field_value_count)
pkt_info->ssl_content_type = field_uint[0];
else
pkt_info->ssl_content_type = 0;
}
if (wmem_map_lookup(preferences.tcp_svc_ports, GUINT_TO_POINTER(pkt_info->dstport)) != NULL ||
wmem_map_lookup(preferences.tcp_svc_ports, GUINT_TO_POINTER(pkt_info->srcport)) != NULL)
{
if (wmem_map_lookup(preferences.tcp_svc_ports, GUINT_TO_POINTER(pkt_info->dstport)) != NULL)
pkt_info->rrpd.c2s = TRUE;
pkt_info->rrpd.is_retrans = pkt_info->tcp_retran;
pkt_info->rrpd.session_id = 0;
pkt_info->rrpd.msg_id = 0;
pkt_info->rrpd.calculation = RTE_CALC_GTCP;
pkt_info->rrpd.decode_based = FALSE;
if (pkt_info->len > 0)
pkt_info->pkt_of_interest = TRUE;
return 1;
}
return 0;
}
/* Returns the number of sub-packets of interest */
int decode_dns(packet_info *pinfo _U_, proto_tree *tree, PKT_INFO* pkt_info)
{
guint32 field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */
size_t field_value_count; /* How many entries are there in the extracted field array */
if (!extract_uint(tree, hf_of_interest[HF_INTEREST_DNS_ID].hf, field_uint, &field_value_count)) {
if (field_value_count)
pkt_info->rrpd.msg_id = field_uint[0];
}
pkt_info->rrpd.session_id = 1;
pkt_info->rrpd.decode_based = TRUE;
pkt_info->rrpd.calculation = RTE_CALC_DNS;
pkt_info->pkt_of_interest = TRUE;
return 1;
}
/* Returns the number of sub-packets of interest */
int decode_gudp(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info)
{
guint32 field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */
size_t field_value_count; /* How many entries are there in the extracted field array */
pkt_info->srcport = pinfo->srcport;
pkt_info->dstport = pinfo->destport;
if (!extract_uint(tree, hf_of_interest[HF_INTEREST_UDP_STREAM].hf, field_uint, &field_value_count)) {
if (field_value_count)
pkt_info->rrpd.stream_no = field_uint[0];
}
if (!extract_uint(tree, hf_of_interest[HF_INTEREST_UDP_LENGTH].hf, field_uint, &field_value_count)) {
if (field_value_count)
pkt_info->len = field_uint[0];
}
if ((wmem_map_lookup(preferences.udp_svc_ports, GUINT_TO_POINTER(pkt_info->dstport)) != NULL) ||
(wmem_map_lookup(preferences.udp_svc_ports, GUINT_TO_POINTER(pkt_info->srcport)) != NULL))
{
if (wmem_map_lookup(preferences.udp_svc_ports, GUINT_TO_POINTER(pkt_info->dstport)) != NULL)
pkt_info->rrpd.c2s = TRUE;
pkt_info->rrpd.session_id = 0;
pkt_info->rrpd.msg_id = 0;
pkt_info->rrpd.decode_based = FALSE;
pkt_info->rrpd.calculation = RTE_CALC_GUDP;
pkt_info->pkt_of_interest = TRUE;
}
return 1;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/ |
C/C++ | wireshark/plugins/epan/transum/decoders.h | /* decoders.h
* Header file for the TRANSUM response time analyzer post-dissector
* By Paul Offord <[email protected]>
* Copyright 2016 Advance Seven Limited
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
int decode_syn(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info);
int decode_dcerpc(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info);
int decode_smb(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info, PKT_INFO* subpackets);
int decode_gtcp(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info);
int decode_dns(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info);
int decode_gudp(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info);
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/ |
C | wireshark/plugins/epan/transum/extractors.c | /* extractors.c
* Routines for the TRANSUM response time analyzer post-dissector
* By Paul Offord <[email protected]>
* Copyright 2016 Advance Seven Limited
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <epan/prefs.h>
#include <epan/packet.h>
#include "extractors.h"
/*
This function extracts a field value (e.g. tcp.len) from a tree. Because a packet may contain
multiple values for the field, the extracted values are returned in a result_array. The
number of array entries is returned in element_count.
Return is 0 if all went well. If this function return -1 it is probably because the tree did not
include the field defined by the field_id.
*/
int extract_uint(proto_tree *tree, int field_id, guint32 *result_array, size_t *element_count)
{
GPtrArray *finfo_array;
*element_count = 0;
if (tree == NULL) {
return -1;
}
finfo_array = proto_get_finfo_ptr_array(tree, field_id);
if (finfo_array == NULL) {
return -1;
}
*element_count = g_ptr_array_len(finfo_array);
for (size_t i = 0; i < *element_count && i < MAX_RETURNED_ELEMENTS; i++)
{
result_array[i] = fvalue_get_uinteger(((field_info*)finfo_array->pdata[i])->value);
}
return 0;
}
int extract_ui64(proto_tree *tree, int field_id, guint64 *result_array, size_t *element_count)
{
GPtrArray *finfo_array;
*element_count = 0;
if (tree == NULL) {
return -1;
}
finfo_array = proto_get_finfo_ptr_array(tree, field_id);
if (finfo_array == NULL) {
return -1;
}
*element_count = g_ptr_array_len(finfo_array);
for (size_t i = 0; i < *element_count && i < MAX_RETURNED_ELEMENTS; i++)
{
result_array[i] = fvalue_get_uinteger64(((field_info*)finfo_array->pdata[i])->value);
}
return 0;
}
int extract_si64(proto_tree *tree, int field_id, guint64 *result_array, size_t *element_count)
{
GPtrArray *finfo_array;
*element_count = 0;
if (tree == NULL) {
return -1;
}
finfo_array = proto_get_finfo_ptr_array(tree, field_id);
if (finfo_array == NULL) {
return -1;
}
*element_count = g_ptr_array_len(finfo_array);
for (size_t i = 0; i < *element_count && i < MAX_RETURNED_ELEMENTS; i++)
{
result_array[i] = fvalue_get_sinteger64(((field_info*)finfo_array->pdata[i])->value);
}
return 0;
}
int extract_bool(proto_tree *tree, int field_id, gboolean *result_array, size_t *element_count)
{
GPtrArray *finfo_array;
*element_count = 0;
if (tree == NULL) {
return -1;
}
finfo_array = proto_get_finfo_ptr_array(tree, field_id);
if (finfo_array == NULL) {
return -1;
}
*element_count = g_ptr_array_len(finfo_array);
for (size_t i = 0; i < *element_count && i < MAX_RETURNED_ELEMENTS; i++)
{
fvalue_t *fv = ((field_info*)finfo_array->pdata[i])->value;
ws_assert(fvalue_type_ftenum(fv) == FT_BOOLEAN);
if (fvalue_get_uinteger64(fv))
result_array[i] = TRUE;
else
result_array[i] = FALSE;
}
return 0;
}
/*
* Extract a count of the number of instances of a given field.
*/
int extract_instance_count(proto_tree *tree, int field_id, size_t *element_count)
{
GPtrArray *finfo_array;
*element_count = 0;
if (tree == NULL) {
return -1;
}
finfo_array = proto_get_finfo_ptr_array(tree, field_id);
if (finfo_array == NULL) {
return -1;
}
*element_count = g_ptr_array_len(finfo_array);
return 0;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/ |
C/C++ | wireshark/plugins/epan/transum/extractors.h | /* extractors.h
* Header file for the TRANSUM response time analyzer post-dissector
* By Paul Offord <[email protected]>
* Copyright 2016 Advance Seven Limited
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <epan/prefs.h>
#include <epan/packet.h>
#define MAX_RETURNED_ELEMENTS 16
int extract_uint(proto_tree *tree, int field_id, guint32 *result_array, size_t *element_count);
int extract_ui64(proto_tree *tree, int field_id, guint64 *result_array, size_t *element_count);
int extract_si64(proto_tree *tree, int field_id, guint64 *result_array, size_t *element_count);
int extract_bool(proto_tree *tree, int field_id, gboolean *result_array, size_t *element_count);
int extract_instance_count(proto_tree *tree, int field_id, size_t *element_count); |
C | wireshark/plugins/epan/transum/packet-transum.c | /* packet-transum.c
* Routines for the TRANSUM response time analyzer post-dissector
* By Paul Offord <[email protected]>
* Copyright 2016 Advance Seven Limited
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* ToDo: Test handling of multiple SMB2 messages within a packet */
/* ToDo: Rework the Summarizer code (future release) */
#include "config.h"
#define WS_LOG_DOMAIN "transum"
#include <epan/proto.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/ws_printf.h>
#include "packet-transum.h"
#include "preferences.h"
#include "extractors.h"
#include "decoders.h"
#include <wsutil/wslog.h>
void proto_register_transum(void);
void proto_reg_handoff_transum(void);
static dissector_handle_t transum_handle;
#define CAPTURE_CLIENT 0
#define CAPTURE_INTERMEDIATE 1
#define CAPTURE_SERVICE 2
#define RTE_TIME_SEC 1
#define RTE_TIME_MSEC 1000
#define RTE_TIME_USEC 1000000
/* The following are the field ids for the protocol values used by TRANSUM.
Make sure they line up with ehf_of_interest order */
HF_OF_INTEREST_INFO hf_of_interest[HF_INTEREST_END_OF_LIST] = {
{ -1, "ip.proto" },
{ -1, "ipv6.nxt" },
{ -1, "tcp.analysis.retransmission" },
{ -1, "tcp.analysis.keep_alive" },
{ -1, "tcp.flags.syn" },
{ -1, "tcp.flags.ack" },
{ -1, "tcp.flags.reset" },
{ -1, "tcp.flags.urg" },
{ -1, "tcp.seq" },
{ -1, "tcp.srcport" },
{ -1, "tcp.dstport" },
{ -1, "tcp.stream" },
{ -1, "tcp.len" },
{ -1, "udp.srcport" },
{ -1, "udp.dstport" },
{ -1, "udp.stream" },
{ -1, "udp.length" },
{ -1, "tls.record.content_type" },
{ -1, "tds.type" },
{ -1, "tds.length" },
{ -1, "smb.mid" },
{ -1, "smb2.sesid" },
{ -1, "smb2.msg_id" },
{ -1, "smb2.cmd" },
{ -1, "dcerpc.ver" },
{ -1, "dcerpc.pkt_type" },
{ -1, "dcerpc.cn_call_id" },
{ -1, "dcerpc.cn_ctx_id" },
{ -1, "dns.id"},
};
static range_t *tcp_svc_port_range_values;
static range_t *udp_svc_port_range_values;
TSUM_PREFERENCES preferences;
static wmem_map_t *detected_tcp_svc; /* this array is used to track services detected during the syn/syn-ack process */
static wmem_map_t *dcerpc_req_pkt_type; /* used to indicate if a DCE-RPC pkt_type is a request */
static wmem_map_t *dcerpc_streams = NULL; /* used to record TCP stream numbers that are carrying DCE-RPC data */
/*
This array contains calls and returns that have no TRUE context_id
This is needed to overcome an apparent bug in Wireshark where
the field name of context id in parameters is the same as context id
in a message header
*/
static wmem_map_t *dcerpc_context_zero;
/*
The rrpd_list holds information about all of the APDU Request-Response Pairs seen in the trace.
*/
static wmem_list_t *rrpd_list = NULL;
/*
output_rrpd is a hash of pointers to RRPDs on the rrpd_list. The index is the frame number. This hash is
used during Wireshark's second scan. As each packet is processed, TRANSUM uses the packet's frame number to index into
this hash to determine if we have RTE data for this particular packet, and if so the write_rte function is called.
*/
static wmem_map_t *output_rrpd;
/*
The temp_rsp_rrpd_list holds RRPDs for APDUs where we have not yet seen the header information and so we can't
fully qualify the identification of the RRPD (the identification being ip_proto:stream_no:session_id:msg_id).
This only occurs when a) we are using one of the decode_based calculations (such as SMB2), and b) when we have
TCP Reassembly enabled. Once we receive a header packet for an APDU we migrate the entry from this array to the
main rrpd_list.
*/
static wmem_list_t *temp_rsp_rrpd_list = NULL; /* Reuse these for speed and efficient memory use - issue a warning if we run out */
/* Optimisation data - the following is used for various optimisation measures */
static int highest_tcp_stream_no;
static int highest_udp_stream_no;
wmem_map_t *tcp_stream_exceptions;
static gint ett_transum = -1;
static gint ett_transum_header = -1;
static gint ett_transum_data = -1;
static int proto_transum = -1;
static int hf_tsum_status = -1;
//static int hf_tsum_time_units = -1;
static int hf_tsum_req_first_seg = -1;
static int hf_tsum_req_last_seg = -1;
static int hf_tsum_rsp_first_seg = -1;
static int hf_tsum_rsp_last_seg = -1;
static int hf_tsum_apdu_rsp_time = -1;
static int hf_tsum_service_time = -1;
static int hf_tsum_req_spread = -1;
static int hf_tsum_rsp_spread = -1;
static int hf_tsum_clip_filter = -1;
static int hf_tsum_calculation = -1;
static int hf_tsum_summary = -1;
static int hf_tsum_req_search = -1;
static int hf_tsum_rsp_search = -1;
static const enum_val_t capture_position_vals[] = {
{ "TRACE_CAP_CLIENT", "Client", TRACE_CAP_CLIENT },
{ "TRACE_CAP_INTERMEDIATE", "Intermediate", TRACE_CAP_INTERMEDIATE },
{ "TRACE_CAP_SERVICE", "Service", TRACE_CAP_SERVICE },
{ NULL, NULL, 0}
};
static const value_string rrdp_calculation_vals[] = {
{ RTE_CALC_GTCP, "Generic TCP" },
{ RTE_CALC_SYN, "SYN and SYN/ACK" },
{ RTE_CALC_DCERPC, "DCE-RPC" },
{ RTE_CALC_SMB2, "SMB2" },
{ RTE_CALC_GUDP, "Generic UDP" },
{ RTE_CALC_DNS, "DNS" },
{ 0, NULL }
};
/*static const enum_val_t time_multiplier_vals[] = {
{ "RTE_TIME_SEC", "seconds", RTE_TIME_SEC },
{ "RTE_TIME_MSEC", "milliseconds", RTE_TIME_MSEC },
{ "RTE_TIME_USEC", "microseconds", RTE_TIME_USEC },
{ NULL, NULL, 0}
};*/
void add_detected_tcp_svc(guint16 port)
{
wmem_map_insert(detected_tcp_svc, GUINT_TO_POINTER(port), GUINT_TO_POINTER(port));
}
static void init_dcerpc_data(void)
{
wmem_map_insert(dcerpc_req_pkt_type, GUINT_TO_POINTER(0), GUINT_TO_POINTER(1));
wmem_map_insert(dcerpc_req_pkt_type, GUINT_TO_POINTER(11), GUINT_TO_POINTER(1));
wmem_map_insert(dcerpc_req_pkt_type, GUINT_TO_POINTER(14), GUINT_TO_POINTER(1));
wmem_map_insert(dcerpc_context_zero, GUINT_TO_POINTER(11), GUINT_TO_POINTER(11));
wmem_map_insert(dcerpc_context_zero, GUINT_TO_POINTER(12), GUINT_TO_POINTER(12));
wmem_map_insert(dcerpc_context_zero, GUINT_TO_POINTER(14), GUINT_TO_POINTER(14));
wmem_map_insert(dcerpc_context_zero, GUINT_TO_POINTER(15), GUINT_TO_POINTER(15));
}
static void register_dcerpc_stream(guint32 stream_no)
{
wmem_map_insert(dcerpc_streams, GUINT_TO_POINTER(stream_no), GUINT_TO_POINTER(1));
}
/* This function should be called before any change to RTE data. */
static void null_output_rrpd_entries(RRPD *in_rrpd)
{
wmem_map_remove(output_rrpd, GUINT_TO_POINTER(in_rrpd->req_first_frame));
wmem_map_remove(output_rrpd, GUINT_TO_POINTER(in_rrpd->req_last_frame));
wmem_map_remove(output_rrpd, GUINT_TO_POINTER(in_rrpd->rsp_first_frame));
wmem_map_remove(output_rrpd, GUINT_TO_POINTER(in_rrpd->rsp_last_frame));
}
/* This function should be called after any change to RTE data. */
static void update_output_rrpd(RRPD *in_rrpd)
{
if (preferences.rte_on_first_req)
wmem_map_insert(output_rrpd, GUINT_TO_POINTER(in_rrpd->req_first_frame), in_rrpd);
if (preferences.rte_on_last_req)
wmem_map_insert(output_rrpd, GUINT_TO_POINTER(in_rrpd->req_last_frame), in_rrpd);
if (preferences.rte_on_first_rsp)
wmem_map_insert(output_rrpd, GUINT_TO_POINTER(in_rrpd->rsp_first_frame), in_rrpd);
if (preferences.rte_on_last_rsp)
wmem_map_insert(output_rrpd, GUINT_TO_POINTER(in_rrpd->rsp_last_frame), in_rrpd);
}
/* Return the index of the RRPD that has been appended */
static RRPD* append_to_rrpd_list(RRPD *in_rrpd)
{
RRPD *next_rrpd = (RRPD*)wmem_memdup(wmem_file_scope(), in_rrpd, sizeof(RRPD));
update_output_rrpd(next_rrpd);
wmem_list_append(rrpd_list, next_rrpd);
return next_rrpd;
}
static RRPD *find_latest_rrpd_dcerpc(RRPD *in_rrpd)
{
RRPD *rrpd;
wmem_list_frame_t* i;
for (i = wmem_list_tail(rrpd_list); i != NULL; i = wmem_list_frame_prev(i))
{
rrpd = (RRPD*)wmem_list_frame_data(i);
if (rrpd->calculation != RTE_CALC_DCERPC && rrpd->calculation != RTE_CALC_SYN)
continue;
/* if the input 5-tuple doesn't match the rrpd_list_entry 5-tuple -> go find the next list entry */
if (rrpd->ip_proto == in_rrpd->ip_proto && rrpd->stream_no == in_rrpd->stream_no)
{
/* if we can match on session_id and msg_id must be a retransmission of the last request packet or the response */
/* this logic works whether or not we are using reassembly */
if (rrpd->session_id == in_rrpd->session_id && rrpd->msg_id == in_rrpd->msg_id)
return rrpd;
/* If this is a retransmission, we assume it relates to this rrpd_list entry.
This is a bit of a kludge and not ideal but a compromise.*/
/* ToDo: look at using TCP sequence number to allocate a retransmission to the correct APDU */
if (in_rrpd->is_retrans)
return rrpd;
if (preferences.reassembly)
{
if (in_rrpd->c2s)
{
/* if the input rrpd is for c2s and the one we have found already has response information, then the
in_rrpd represents a new RR Pair. */
if (rrpd->rsp_first_frame)
return NULL;
/* If the current rrpd_list entry doesn't have a msg_id then we assume we are mid Request APDU and so we have a match. */
if (!rrpd->msg_id)
return rrpd;
}
else /* The in_rrpd relates to a packet going s2c */
{
/* When reassembly is enabled, multi-packet response information is actually migrated from the temp_rsp_rrpd_list
to the rrpd_list and so we won't come through here. */
;
}
}
else /* we are not using reassembly */
{
if (in_rrpd->c2s)
{
if (in_rrpd->msg_id)
/* if we have a message id this is a new Request APDU */
return NULL;
else /* No msg_id */
{
return rrpd; /* add this packet to the matching stream */
}
}
else /* this packet is going s2c */
{
if (!in_rrpd->msg_id && rrpd->rsp_first_frame)
/* we need to add this frame to the response APDU of the most recent rrpd_list entry that has already had response packets */
return rrpd;
}
}
} /* this is the end of the 5-tuple check */
if (in_rrpd->c2s)
in_rrpd->req_search_total++;
else
in_rrpd->rsp_search_total++;
} /* end of the for loop */
return NULL;
}
static RRPD *find_latest_rrpd_dns(RRPD *in_rrpd)
{
RRPD *rrpd;
wmem_list_frame_t* i;
for (i = wmem_list_tail(rrpd_list); i != NULL; i = wmem_list_frame_prev(i))
{
rrpd = (RRPD*)wmem_list_frame_data(i);
if (rrpd->calculation != RTE_CALC_DNS)
continue;
/* if the input 5-tuple doesn't match the rrpd_list_entry 5-tuple -> go find the next list entry */
if (rrpd->ip_proto == in_rrpd->ip_proto && rrpd->stream_no == in_rrpd->stream_no)
{
if (rrpd->session_id == in_rrpd->session_id && rrpd->msg_id == in_rrpd->msg_id)
{
if (in_rrpd->c2s && rrpd->rsp_first_frame)
return NULL; /* this is new */
else
return rrpd;
}
} /* this is the end of the 5-tuple check */
if (in_rrpd->c2s)
in_rrpd->req_search_total++;
else
in_rrpd->rsp_search_total++;
} /* this is the end of the for loop */
return NULL;
}
static RRPD *find_latest_rrpd_gtcp(RRPD *in_rrpd)
{
RRPD *rrpd;
wmem_list_frame_t* i;
for (i = wmem_list_tail(rrpd_list); i != NULL; i = wmem_list_frame_prev(i))
{
rrpd = (RRPD*)wmem_list_frame_data(i);
if (rrpd->calculation != RTE_CALC_GTCP && rrpd->calculation != RTE_CALC_SYN)
continue;
/* if the input 5-tuple doesn't match the rrpd_list_entry 5-tuple -> go find the next list entry */
if (rrpd->ip_proto == in_rrpd->ip_proto && rrpd->stream_no == in_rrpd->stream_no)
{
if (in_rrpd->c2s && rrpd->rsp_first_frame)
return NULL; /* this is new */
else
return rrpd;
} /* this is the end of the 5-tuple check */
if (in_rrpd->c2s)
in_rrpd->req_search_total++;
else
in_rrpd->rsp_search_total++;
} /* this is the end of the for loop */
return NULL;
}
static RRPD *find_latest_rrpd_gudp(RRPD *in_rrpd)
{
RRPD *rrpd;
wmem_list_frame_t* i;
for (i = wmem_list_tail(rrpd_list); i != NULL; i = wmem_list_frame_prev(i))
{
rrpd = (RRPD*)wmem_list_frame_data(i);
if (rrpd->calculation != RTE_CALC_GUDP)
continue;
/* if the input 5-tuple doesn't match the rrpd_list_entry 5-tuple -> go find the next list entry */
if (rrpd->ip_proto == in_rrpd->ip_proto && rrpd->stream_no == in_rrpd->stream_no)
{
if (in_rrpd->c2s && rrpd->rsp_first_frame)
return NULL; /* this is new */
else
return rrpd;
} /* this is the end of the 5-tuple check */
if (in_rrpd->c2s)
in_rrpd->req_search_total++;
else
in_rrpd->rsp_search_total++;
} /* this is the end of the for loop */
return NULL;
}
static RRPD *find_latest_rrpd_smb2(RRPD *in_rrpd)
{
RRPD *rrpd;
wmem_list_frame_t* i;
for (i = wmem_list_tail(rrpd_list); i != NULL; i = wmem_list_frame_prev(i))
{
rrpd = (RRPD*)wmem_list_frame_data(i);
if (rrpd->calculation != RTE_CALC_SMB2 && rrpd->calculation != RTE_CALC_SYN)
continue;
/* if the input 5-tuple doesn't match the rrpd_list_entry 5-tuple -> go find the next list entry */
if (rrpd->ip_proto == in_rrpd->ip_proto && rrpd->stream_no == in_rrpd->stream_no)
{
/* if we can match on session_id and msg_id must be a retransmission of the last request packet or the response */
/* this logic works whether or not we are using reassembly */
if (rrpd->session_id == in_rrpd->session_id && rrpd->msg_id == in_rrpd->msg_id)
return rrpd;
/* If this is a retransmission, we assume it relates to this rrpd_list entry.
This is a bit of a kludge and not ideal but a compromise.*/
/* ToDo: look at using TCP sequence number to allocate a retransmission to the correct APDU */
if (in_rrpd->is_retrans)
return rrpd;
if (preferences.reassembly)
{
if (in_rrpd->c2s)
{
/* if the input rrpd is for c2s and the one we have found already has response information, then the
in_rrpd represents a new RR Pair. */
if (rrpd->rsp_first_frame)
return NULL;
/* If the current rrpd_list entry doesn't have a msg_id then we assume we are mid Request APDU and so we have a match. */
if (!rrpd->msg_id)
return rrpd;
}
else /* The in_rrpd relates to a packet going s2c */
{
/* When reassembly is enabled, multi-packet response information is actually migrated from the temp_rsp_rrpd_list
to the rrpd_list and so we won't come through here. */
;
}
}
else /* we are not using reassembly */
{
if (in_rrpd->c2s)
{
if (in_rrpd->msg_id)
/* if we have a message id this is a new Request APDU */
return NULL;
else /* No msg_id */
{
return rrpd; /* add this packet to the matching stream */
}
}
else /* this packet is going s2c */
{
if (!in_rrpd->msg_id && rrpd->rsp_first_frame)
/* we need to add this frame to the response APDU of the most recent rrpd_list entry that has already had response packets */
return rrpd;
}
}
} /* this is the end of the 5-tuple check */
if (in_rrpd->c2s)
in_rrpd->req_search_total++;
else
in_rrpd->rsp_search_total++;
} /* end of the for loop */
return NULL;
}
static RRPD *find_latest_rrpd_syn(RRPD *in_rrpd)
{
RRPD *rrpd;
wmem_list_frame_t* i;
for (i = wmem_list_tail(rrpd_list); i != NULL; i = wmem_list_frame_prev(i))
{
rrpd = (RRPD*)wmem_list_frame_data(i);
if (rrpd->calculation != RTE_CALC_SYN)
continue;
/* if the input 5-tuple doesn't match the rrpd_list_entry 5-tuple -> go find the next list entry */
if (rrpd->ip_proto == in_rrpd->ip_proto && rrpd->stream_no == in_rrpd->stream_no)
{
return rrpd;
} /* this is the end of the 5-tuple check */
if (in_rrpd->c2s)
in_rrpd->req_search_total++;
else
in_rrpd->rsp_search_total++;
} /* this is the end of the for loop */
return NULL;
}
static RRPD *find_latest_rrpd(RRPD *in_rrpd)
{
/* Optimisation Code */
if (in_rrpd->ip_proto == IP_PROTO_TCP && (int)in_rrpd->stream_no > highest_tcp_stream_no)
{
highest_tcp_stream_no = in_rrpd->stream_no;
return NULL;
}
else if (in_rrpd->ip_proto == IP_PROTO_UDP && (int)in_rrpd->stream_no > highest_udp_stream_no)
{
highest_udp_stream_no = in_rrpd->stream_no;
return NULL;
}
/* End of Optimisation Code */
switch (in_rrpd->calculation)
{
case RTE_CALC_DCERPC:
return find_latest_rrpd_dcerpc(in_rrpd);
break;
case RTE_CALC_DNS:
return find_latest_rrpd_dns(in_rrpd);
break;
case RTE_CALC_GTCP:
return find_latest_rrpd_gtcp(in_rrpd);
break;
case RTE_CALC_GUDP:
return find_latest_rrpd_gudp(in_rrpd);
break;
case RTE_CALC_SMB2:
return find_latest_rrpd_smb2(in_rrpd);
break;
case RTE_CALC_SYN:
return find_latest_rrpd_syn(in_rrpd);
break;
}
return NULL;
}
static void update_rrpd_list_entry(RRPD *match, RRPD *in_rrpd)
{
null_output_rrpd_entries(match);
if (preferences.debug_enabled)
{
match->req_search_total += in_rrpd->req_search_total;
match->rsp_search_total += in_rrpd->rsp_search_total;
}
if (in_rrpd->c2s)
{
match->req_last_frame = in_rrpd->req_last_frame;
match->req_last_rtime = in_rrpd->req_last_rtime;
if (in_rrpd->msg_id)
{
match->session_id = in_rrpd->session_id;
match->msg_id = in_rrpd->msg_id;
}
}
else
{
if (!match->rsp_first_frame)
{
match->rsp_first_frame = in_rrpd->rsp_first_frame;
match->rsp_first_rtime = in_rrpd->rsp_first_rtime;
}
match->rsp_last_frame = in_rrpd->rsp_last_frame;
match->rsp_last_rtime = in_rrpd->rsp_last_rtime;
}
update_output_rrpd(match);
}
/*
This function processes a sub-packet that is going from client-to-service.
*/
static void update_rrpd_list_entry_req(RRPD *in_rrpd)
{
RRPD *match;
match = find_latest_rrpd(in_rrpd);
if (match != NULL)
update_rrpd_list_entry(match, in_rrpd);
else
append_to_rrpd_list(in_rrpd);
}
/*
This function inserts an RRPD into the temp_rsp_rrpd_list. If this is
successful return a pointer to the entry, else return NULL.
*/
static RRPD* insert_into_temp_rsp_rrpd_list(RRPD *in_rrpd)
{
RRPD *rrpd = (RRPD*)wmem_memdup(wmem_file_scope(), in_rrpd, sizeof(RRPD));
wmem_list_append(temp_rsp_rrpd_list, rrpd);
return rrpd;
}
static RRPD* find_temp_rsp_rrpd(RRPD *in_rrpd)
{
wmem_list_frame_t *i;
RRPD* rrpd;
for (i = wmem_list_head(temp_rsp_rrpd_list); i; i = wmem_list_frame_next(i))
{
rrpd = (RRPD*)wmem_list_frame_data(i);
if (rrpd->ip_proto == in_rrpd->ip_proto && rrpd->stream_no == in_rrpd->stream_no)
return rrpd;
}
return NULL;
}
static void update_temp_rsp_rrpd(RRPD *temp_list, RRPD *in_rrpd)
{
temp_list->rsp_last_frame = in_rrpd->rsp_last_frame;
temp_list->rsp_last_rtime = in_rrpd->rsp_last_rtime;
}
/* This function migrates an entry from the temp_rsp_rrpd_list to the main rrpd_list. */
static void migrate_temp_rsp_rrpd(RRPD *main_list, RRPD *temp_list)
{
update_rrpd_list_entry(main_list, temp_list);
wmem_list_remove(temp_rsp_rrpd_list, temp_list);
}
static void update_rrpd_list_entry_rsp(RRPD *in_rrpd)
{
RRPD *match, *temp_list;
if (in_rrpd->decode_based)
{
if (preferences.reassembly)
{
if (in_rrpd->msg_id)
{
/* If we have a msg_id in the input RRPD we must have header information. */
temp_list = find_temp_rsp_rrpd(in_rrpd);
if (temp_list != NULL)
{
update_temp_rsp_rrpd(temp_list, in_rrpd);
/* Migrate the temp_rsp_rrpd_list entry to the main rrpd_list */
match = find_latest_rrpd(in_rrpd);
if (match != NULL)
migrate_temp_rsp_rrpd(match, temp_list);
}
else
{
match = find_latest_rrpd(in_rrpd);
/* There isn't an entry in the temp_rsp_rrpd_list so update the master rrpd_list entry */
if (match != NULL)
update_rrpd_list_entry(match, in_rrpd);
}
}
else
{
/* Update an existing entry to the temp_rsp_rrpd_list or add a new one. */
temp_list = find_temp_rsp_rrpd(in_rrpd);
if (temp_list != NULL)
update_temp_rsp_rrpd(temp_list, in_rrpd);
else
{
/* If this is a retransmission we need to add it to the last completed rrpd_list entry for this stream */
if (in_rrpd->is_retrans)
{
match = find_latest_rrpd(in_rrpd);
if (match != NULL)
update_rrpd_list_entry(match, in_rrpd);
else
insert_into_temp_rsp_rrpd_list(in_rrpd);
}
else
/* As it's not a retransmission, just create a new entry on the temp list */
insert_into_temp_rsp_rrpd_list(in_rrpd);
}
}
}
else
{
/* Reassembly isn't set and so just go ahead and use the list function */
match = find_latest_rrpd(in_rrpd);
if (match != NULL)
update_rrpd_list_entry(match, in_rrpd);
}
}
else
{
/* if this isn't decode_based then just go ahead and update the RTE data */
match = find_latest_rrpd(in_rrpd);
if (match != NULL)
update_rrpd_list_entry(match, in_rrpd);
}
return;
}
/*
This function updates the RTE data of an RRPD on the rrpd_list. The
frame_no values in the input RRPD double up as a mask. If the frame_no
is > 0 then the frame_no value and rtime values are updated. If the
frame_no is 0 then that particular frame_no and rtime value is not updated.
*/
static void update_rrpd_rte_data(RRPD *in_rrpd)
{
if (in_rrpd->c2s)
update_rrpd_list_entry_req(in_rrpd);
else
update_rrpd_list_entry_rsp(in_rrpd);
}
gboolean is_dcerpc_context_zero(guint32 pkt_type)
{
return (wmem_map_lookup(dcerpc_context_zero, GUINT_TO_POINTER(pkt_type)) != NULL);
}
gboolean is_dcerpc_req_pkt_type(guint32 pkt_type)
{
return (wmem_map_lookup(dcerpc_req_pkt_type, GUINT_TO_POINTER(pkt_type)) != NULL);
}
static gboolean is_dcerpc_stream(guint32 stream_no)
{
return (wmem_map_lookup(dcerpc_streams, GUINT_TO_POINTER(stream_no)) != NULL);
}
/*
This function initialises the global variables and populates the
[tcp|udp]_svc_ports tables with information from the preference settings
*/
static void init_globals(void)
{
if (!proto_is_protocol_enabled(find_protocol_by_id(proto_transum)))
return;
highest_tcp_stream_no = -1;
highest_udp_stream_no = -1;
/* Create and initialise some dynamic memory areas */
tcp_stream_exceptions = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
detected_tcp_svc = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
rrpd_list = wmem_list_new(wmem_file_scope());
temp_rsp_rrpd_list = wmem_list_new(wmem_file_scope());
/* Indicate what fields we're interested in. */
GArray *wanted_fields = g_array_sized_new(FALSE, FALSE, (guint)sizeof(int), HF_INTEREST_END_OF_LIST);
for (int i = 0; i < HF_INTEREST_END_OF_LIST; i++)
{
if (hf_of_interest[i].hf != -1)
g_array_append_val(wanted_fields, hf_of_interest[i].hf);
else
ws_warning("TRANSUM: unknown field %s", hf_of_interest[i].proto_name);
}
set_postdissector_wanted_hfids(transum_handle, wanted_fields);
preferences.tcp_svc_ports = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
preferences.udp_svc_ports = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
/* use the range values to populate the tcp_svc_ports list*/
for (guint i = 0; i < tcp_svc_port_range_values->nranges; i++)
{
for (guint32 j = tcp_svc_port_range_values->ranges[i].low; j <= tcp_svc_port_range_values->ranges[i].high; j++)
{
wmem_map_insert(preferences.tcp_svc_ports, GUINT_TO_POINTER(j), GUINT_TO_POINTER(RTE_CALC_GTCP));
}
}
/* use the range values to populate the udp_svc_ports list*/
for (guint i = 0; i < udp_svc_port_range_values->nranges; i++)
{
for (guint32 j = udp_svc_port_range_values->ranges[i].low; j <= udp_svc_port_range_values->ranges[i].high; j++)
{
wmem_map_insert(preferences.udp_svc_ports, GUINT_TO_POINTER(j), GUINT_TO_POINTER(RTE_CALC_GUDP));
}
}
/* create arrays to hold some DCE-RPC values */
dcerpc_context_zero = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
dcerpc_req_pkt_type = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
dcerpc_streams = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
init_dcerpc_data();
wmem_map_insert(preferences.tcp_svc_ports, GUINT_TO_POINTER(445), GUINT_TO_POINTER(RTE_CALC_SMB2));
wmem_map_insert(preferences.udp_svc_ports, GUINT_TO_POINTER(53), GUINT_TO_POINTER(RTE_CALC_DNS));
}
/* Undo capture file-specific initializations. */
static void cleanup_globals(void)
{
/* Clear the list of wanted fields as it will be reinitialized. */
set_postdissector_wanted_hfids(transum_handle, NULL);
}
/* This function adds the RTE data to the tree. The summary ptr is currently
not used but will be used for summariser information once this feature has
been ported from the Lua code. */
static void write_rte(RRPD *in_rrpd, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, char *summary)
{
nstime_t rte_art;
nstime_t rte_st;
nstime_t rte_reqspread;
nstime_t rte_rspspread;
proto_tree *rte_tree;
proto_item *pi;
wmem_strbuf_t *temp_string = wmem_strbuf_new(pinfo->pool, "");
if (in_rrpd->req_first_frame)
{
pi = proto_tree_add_item(tree, proto_transum, tvb, 0, 0, ENC_NA);
rte_tree = proto_item_add_subtree(pi, ett_transum);
nstime_delta(&rte_reqspread, &(in_rrpd->req_last_rtime), &(in_rrpd->req_first_rtime));
if (in_rrpd->rsp_first_frame)
{
/* calculate the RTE times */
nstime_delta(&rte_art, &(in_rrpd->rsp_last_rtime), &(in_rrpd->req_first_rtime));
nstime_delta(&rte_st, &(in_rrpd->rsp_first_rtime), &(in_rrpd->req_last_rtime));
nstime_delta(&rte_rspspread, &(in_rrpd->rsp_last_rtime), &(in_rrpd->rsp_first_rtime));
pi = proto_tree_add_string(rte_tree, hf_tsum_status, tvb, 0, 0, "OK");
}
else
{
pi = proto_tree_add_string(rte_tree, hf_tsum_status, tvb, 0, 0, "Response missing");
}
proto_item_set_generated(pi);
pi = proto_tree_add_uint(rte_tree, hf_tsum_req_first_seg, tvb, 0, 0, in_rrpd->req_first_frame);
proto_item_set_generated(pi);
pi = proto_tree_add_uint(rte_tree, hf_tsum_req_last_seg, tvb, 0, 0, in_rrpd->req_last_frame);
proto_item_set_generated(pi);
if (in_rrpd->rsp_first_frame)
{
pi = proto_tree_add_uint(rte_tree, hf_tsum_rsp_first_seg, tvb, 0, 0, in_rrpd->rsp_first_frame);
proto_item_set_generated(pi);
pi = proto_tree_add_uint(rte_tree, hf_tsum_rsp_last_seg, tvb, 0, 0, in_rrpd->rsp_last_frame);
proto_item_set_generated(pi);
pi = proto_tree_add_time(rte_tree, hf_tsum_apdu_rsp_time, tvb, 0, 0, &rte_art);
proto_item_set_generated(pi);
pi = proto_tree_add_time(rte_tree, hf_tsum_service_time, tvb, 0, 0, &rte_st);
proto_item_set_generated(pi);
}
pi = proto_tree_add_time(rte_tree, hf_tsum_req_spread, tvb, 0, 0, &rte_reqspread);
proto_item_set_generated(pi);
if (in_rrpd->rsp_first_frame)
{
pi = proto_tree_add_time(rte_tree, hf_tsum_rsp_spread, tvb, 0, 0, &rte_rspspread);
proto_item_set_generated(pi);
}
if (in_rrpd->ip_proto == IP_PROTO_TCP)
wmem_strbuf_append_printf(temp_string, "tcp.stream==%d", in_rrpd->stream_no);
else if (in_rrpd->ip_proto == IP_PROTO_UDP)
wmem_strbuf_append_printf(temp_string, "udp.stream==%d", in_rrpd->stream_no);
if (in_rrpd->rsp_first_frame)
wmem_strbuf_append_printf(temp_string, " && frame.number>=%d && frame.number<=%d", in_rrpd->req_first_frame, in_rrpd->rsp_last_frame);
else
wmem_strbuf_append_printf(temp_string, " && frame.number>=%d && frame.number<=%d", in_rrpd->req_first_frame, in_rrpd->req_last_frame);
if (in_rrpd->calculation == RTE_CALC_GTCP)
wmem_strbuf_append_printf(temp_string, " && tcp.len>0");
pi = proto_tree_add_string(rte_tree, hf_tsum_clip_filter, tvb, 0, 0, wmem_strbuf_get_str(temp_string));
proto_item_set_generated(pi);
pi = proto_tree_add_string(rte_tree, hf_tsum_calculation, tvb, 0, 0, val_to_str(in_rrpd->calculation, rrdp_calculation_vals, "Unknown calculation type: %d"));
proto_item_set_generated(pi);
if (in_rrpd->rsp_first_frame)
{
if (preferences.summarisers_enabled)
{
if (summary)
{
pi = proto_tree_add_string(tree, hf_tsum_summary, tvb, 0, 0, summary);
proto_item_set_generated(pi);
}
}
}
if (preferences.debug_enabled)
{
pi = proto_tree_add_uint(rte_tree, hf_tsum_req_search, tvb, 0, 0, in_rrpd->req_search_total);
proto_item_set_generated(pi);
pi = proto_tree_add_uint(rte_tree, hf_tsum_rsp_search, tvb, 0, 0, in_rrpd->rsp_search_total);
proto_item_set_generated(pi);
}
}
}
/*
This function sets initial values in the current_pkt structure and checks
the xxx_svc_port arrays to see if they contain a match for the source or
destination port. This function also adds tcp_svc_ports entries when it
discovers DCE-RPC traffic.
Returns the number of sub-packets to be processed.
*/
static void set_proto_values(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info, PKT_INFO* subpackets)
{
guint32 field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */
size_t field_value_count; /* How many entries are there in the extracted field array */
pkt_info->frame_number = pinfo->fd->num; /* easy access to frame number */
pkt_info->relative_time = pinfo->rel_ts;
int number_sub_pkts_of_interest = 0; /* default */
if (pinfo->ptype == PT_TCP)
pkt_info->rrpd.ip_proto = IP_PROTO_TCP;
else if (pinfo->ptype == PT_UDP)
pkt_info->rrpd.ip_proto = IP_PROTO_UDP;
if (pkt_info->rrpd.ip_proto == IP_PROTO_TCP)
{
number_sub_pkts_of_interest = decode_gtcp(pinfo, tree, pkt_info);
/* decode_gtcp may return 0 but we need to keep processing because we
calculate RTE figures for all SYNs and also we may detect DCE-RPC later
(even though we don't currently have an entry in the tcp_svc_ports list). */
/* Optimisation code */
if (pkt_info->len || pkt_info->tcp_flags_syn)
{
if (pkt_info->ssl_content_type == 21) /* this is an SSL Alert */
{
pkt_info->pkt_of_interest = FALSE;
return;
}
if ((int)pkt_info->rrpd.stream_no > highest_tcp_stream_no && !pkt_info->rrpd.c2s)
{
/* first packet on the stream is s2c and so add to exception list */
if (wmem_map_lookup(tcp_stream_exceptions, GUINT_TO_POINTER(pkt_info->rrpd.stream_no)) == NULL)
wmem_map_insert(tcp_stream_exceptions, GUINT_TO_POINTER(pkt_info->rrpd.stream_no), GUINT_TO_POINTER(1));
}
if (wmem_map_lookup(tcp_stream_exceptions, GUINT_TO_POINTER(pkt_info->rrpd.stream_no)) != NULL)
{
if (pkt_info->rrpd.c2s)
wmem_map_remove(tcp_stream_exceptions, GUINT_TO_POINTER(pkt_info->rrpd.stream_no));
else
pkt_info->pkt_of_interest = FALSE;
}
}
/* End of Optimisation Code */
if (pkt_info->tcp_retran)
{
/* we may not want to continue with this packet if it's a retransmission */
/* If this is a server-side trace we need to ignore client-to-service TCP retransmissions
the rationale being that if we saw the original in the trace the service process saw it too */
if (pkt_info->rrpd.c2s && preferences.capture_position == CAPTURE_SERVICE)
{
pkt_info->pkt_of_interest = FALSE;
return;
}
/* If this is a client-side trace we need to ignore service-to-client TCP retransmissions
the rationale being that if we saw the original in the trace the client process saw it too */
else if (!pkt_info->rrpd.c2s && preferences.capture_position == CAPTURE_CLIENT)
{
pkt_info->pkt_of_interest = FALSE;
return;
}
}
/* We are not interested in TCP Keep-Alive */
if (pkt_info->tcp_keep_alive)
{
pkt_info->pkt_of_interest = FALSE;
return;
}
if (pkt_info->len == 1)
{
if (preferences.orphan_ka_discard && pkt_info->tcp_flags_ack && pkt_info->rrpd.c2s)
{
pkt_info->pkt_of_interest = FALSE;
return; /* It's a KEEP-ALIVE -> stop processing this packet */
}
}
/* check if SYN */
if (pkt_info->tcp_flags_syn)
number_sub_pkts_of_interest = decode_syn(pinfo, tree, pkt_info);
if (pkt_info->len > 0)
{
/* check if SMB2 */
if (pkt_info->dstport == 445 || pkt_info->srcport == 445)
number_sub_pkts_of_interest = decode_smb(pinfo, tree, pkt_info, subpackets);
else
{
/* check if DCE-RPC */
/* We need to set RTE_CALC_DCERPC even when we don't have header info. */
if (is_dcerpc_stream(pkt_info->rrpd.stream_no))
{
pkt_info->rrpd.calculation = RTE_CALC_DCERPC;
pkt_info->rrpd.decode_based = TRUE;
pkt_info->pkt_of_interest = TRUE;
}
if (!extract_uint(tree, hf_of_interest[HF_INTEREST_DCERPC_VER].hf, field_uint, &field_value_count))
{
if (field_value_count)
{
if (pkt_info->rrpd.calculation != RTE_CALC_DCERPC)
register_dcerpc_stream(pkt_info->rrpd.stream_no);
number_sub_pkts_of_interest = decode_dcerpc(pinfo, tree, pkt_info);
}
}
}
}
}
else if (pkt_info->rrpd.ip_proto == IP_PROTO_UDP)
{
/* It's UDP */
number_sub_pkts_of_interest = decode_gudp(pinfo, tree, pkt_info);
if (pkt_info->srcport == 53 || pkt_info->dstport == 53)
number_sub_pkts_of_interest = decode_dns(pinfo, tree, pkt_info);
}
/* Set appropriate RTE values in the sub-packets */
for (int i = 0; (i < number_sub_pkts_of_interest) && (i < MAX_SUBPKTS_PER_PACKET); i++)
{
if (pkt_info->rrpd.c2s)
{
subpackets[i].rrpd.req_first_frame = pkt_info->frame_number;
subpackets[i].rrpd.req_first_rtime = pkt_info->relative_time;
subpackets[i].rrpd.req_last_frame = pkt_info->frame_number;
subpackets[i].rrpd.req_last_rtime = pkt_info->relative_time;
subpackets[i].frame_number = pkt_info->frame_number; /* this acts as a switch later */
}
else
{
subpackets[i].rrpd.rsp_first_frame = pkt_info->frame_number;
subpackets[i].rrpd.rsp_first_rtime = pkt_info->relative_time;
subpackets[i].rrpd.rsp_last_frame = pkt_info->frame_number;
subpackets[i].rrpd.rsp_last_rtime = pkt_info->relative_time;
subpackets[i].frame_number = pkt_info->frame_number; /* this acts as a switch later */
}
}
}
/*
* This function is called for each packet
* Wireshark scans all the packets once and then once again as they are displayed
* The pinfo.visited boolean is set to FALSE; on the first scan
*/
static int dissect_transum(tvbuff_t *buffer, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
/* if (there is RTE info associated with this packet we need to output it */
if (PINFO_FD_VISITED(pinfo))
{
RRPD *rrpd = (RRPD*)wmem_map_lookup(output_rrpd, GUINT_TO_POINTER(pinfo->num));
if (rrpd)
{
if (tree)
{
/* Add the RTE data to the protocol decode tree if we output_flag is set */
write_rte(rrpd, buffer, pinfo, tree, NULL);
}
}
}
else
{
PKT_INFO *sub_packet = wmem_alloc0_array(pinfo->pool, PKT_INFO, MAX_SUBPKTS_PER_PACKET);
set_proto_values(pinfo, tree, &sub_packet[0], sub_packet);
if (sub_packet[0].pkt_of_interest)
{
/* Loop to process each sub_packet and update the related RTE data */
for (int i = 0; i < MAX_SUBPKTS_PER_PACKET; i++)
{
if (!sub_packet[i].frame_number)
break;
update_rrpd_rte_data(&(sub_packet[i].rrpd));
}
}
}
return 0;
}
void
proto_register_transum(void)
{
module_t *transum_module;
static hf_register_info hf[] = {
{ &hf_tsum_status,
{ "RTE Status", "transum.status",
FT_STRING, BASE_NONE, NULL, 0x0,
"Indication of completeness of the RTE information", HFILL } },
#if 0
{ &hf_tsum_time_units,
{ "RTE Time Units", "transum.time_units",
FT_STRING, BASE_NONE, NULL, 0x0,
"Time units used (s, ms or us) for the RTE values", HFILL }
},
#endif
{ &hf_tsum_req_first_seg,
{ "Req First Seg", "transum.firstreq",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"First Segment of an APDU Request", HFILL }
},
{ &hf_tsum_req_last_seg,
{ "Req Last Seg", "transum.lastreq",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"Last Segment of an APDU Request", HFILL }
},
{ &hf_tsum_rsp_first_seg,
{ "Rsp First Seg", "transum.firstrsp",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"First Segment of an APDU Response", HFILL }
},
{ &hf_tsum_rsp_last_seg,
{ "Rsp Last Seg", "transum.lastrsp",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"Last Segment of an APDU Response", HFILL }
},
{ &hf_tsum_apdu_rsp_time,
{ "APDU Rsp Time", "transum.art",
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
"RTE APDU Response Time", HFILL }
},
{ &hf_tsum_service_time,
{ "Service Time", "transum.st",
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
"RTE Service Time", HFILL }
},
{ &hf_tsum_req_spread,
{ "Req Spread", "transum.reqspread",
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
"RTE Request Spread", HFILL }
},
{ &hf_tsum_rsp_spread,
{ "Rsp Spread", "transum.rspspread",
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
"RTE Response Spread", HFILL }
},
{ &hf_tsum_clip_filter,
{ "Trace clip filter", "transum.clip_filter",
FT_STRING, BASE_NONE, NULL, 0x0,
"Filter expression to select the APDU Request-Response pair", HFILL }
},
{ &hf_tsum_calculation,
{ "Calculation", "transum.calculation",
FT_STRING, BASE_NONE, NULL, 0x0,
"Basis of the RTE calculation", HFILL }
},
{ &hf_tsum_summary,
{ "Summary", "transum.summary",
FT_STRING, BASE_NONE, NULL, 0x0,
"Summarizer information", HFILL }
},
{ &hf_tsum_req_search,
{ "Req Search Count", "transum.req_search",
FT_UINT32, BASE_DEC, NULL, 0x0,
"rrpd_list search total for the request packets", HFILL }
},
{ &hf_tsum_rsp_search,
{ "Rsp Search Counts", "transum.rsp_search",
FT_UINT32, BASE_DEC, NULL, 0x0,
"rrpd_list search total for the response packets", HFILL }
}
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_transum,
&ett_transum_header,
&ett_transum_data
};
proto_transum = proto_register_protocol("TRANSUM RTE Data", "TRANSUM", "transum");
/* Due to performance concerns of the dissector, it's disabled by default */
proto_disable_by_default(proto_transum);
/* Set User Preferences defaults */
preferences.capture_position = TRACE_CAP_CLIENT;
preferences.reassembly = TRUE;
range_convert_str(wmem_epan_scope(), &tcp_svc_port_range_values, "25, 80, 443, 1433", MAX_TCP_PORT);
range_convert_str(wmem_epan_scope(), &udp_svc_port_range_values, "137-139", MAX_UDP_PORT);
preferences.orphan_ka_discard = FALSE;
preferences.time_multiplier = RTE_TIME_SEC;
preferences.rte_on_first_req = FALSE;
preferences.rte_on_last_req = TRUE;
preferences.rte_on_first_rsp = FALSE;
preferences.rte_on_last_rsp = FALSE;
preferences.debug_enabled = FALSE;
/* no start registering stuff */
proto_register_field_array(proto_transum, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
transum_module = prefs_register_protocol(proto_transum, NULL); /* ToDo: We need to rethink the NULL pointer so that a preference change causes a rescan */
/* Register the preferences */
prefs_register_obsolete_preference(transum_module, "tsumenabled");
prefs_register_enum_preference(transum_module,
"capture_position",
"Capture position",
"Position of the capture unit that produced this trace. This setting affects the way TRANSUM handles TCP Retransmissions. See the manual for details.",
&preferences.capture_position,
capture_position_vals,
FALSE);
prefs_register_bool_preference(transum_module,
"reassembly",
"Subdissector reassembly enabled",
"Set this to match to the TCP subdissector reassembly setting",
&preferences.reassembly);
prefs_register_range_preference(transum_module,
"tcp_port_ranges",
"Output RTE data for these TCP service ports",
"Add and remove ports numbers separated by commas\nRanges are supported e.g. 25,80,2000-3000,5432",
&tcp_svc_port_range_values,
65536);
prefs_register_range_preference(transum_module,
"udp_port_ranges",
"Output RTE data for these UDP service ports",
"Add and remove ports numbers separated by commas\nRanges are supported e.g. 123,137-139,520-521,2049",
&udp_svc_port_range_values,
65536);
prefs_register_bool_preference(transum_module,
"orphan_ka_discard",
"Discard orphaned TCP Keep-Alives",
"Set this to discard any packet in the direction client to service,\nwith a 1-byte payload of 0x00 and the ACK flag set",
&preferences.orphan_ka_discard);
/* removed from this release
prefs_register_enum_preference(transum_module,
"time_multiplier",
"Time units for RTE values",
"Unit of time used for APDU Response Time, Service Time and Spread Time values.",
&preferences.time_multiplier,
time_multiplier_vals,
FALSE);
*/
prefs_register_bool_preference(transum_module,
"rte_on_first_req",
"Add RTE data to the first request segment",
"RTE data will be added to the first request packet",
&preferences.rte_on_first_req);
prefs_register_bool_preference(transum_module,
"rte_on_last_req",
"Add RTE data to the last request segment",
"RTE data will be added to the last request packet",
&preferences.rte_on_last_req);
prefs_register_bool_preference(transum_module,
"rte_on_first_rsp",
"Add RTE data to the first response segment",
"RTE data will be added to the first response packet",
&preferences.rte_on_first_rsp);
prefs_register_bool_preference(transum_module,
"rte_on_last_rsp",
"Add RTE data to the last response segment",
"RTE data will be added to the last response packet",
&preferences.rte_on_last_rsp);
prefs_register_bool_preference(transum_module,
"debug_enabled",
"Enable debug info",
"Set this only to troubleshoot problems",
&preferences.debug_enabled);
transum_handle = register_dissector("transum", dissect_transum, proto_transum);
register_init_routine(init_globals);
register_cleanup_routine(cleanup_globals);
register_postdissector(transum_handle);
output_rrpd = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_direct_hash, g_direct_equal);
}
void proto_reg_handoff_transum(void)
{
/* Get the field id for each field we will need */
for (int i = 0; i < HF_INTEREST_END_OF_LIST; i++)
{
hf_of_interest[i].hf = proto_registrar_get_id_byname(hf_of_interest[i].proto_name);
}
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/ |
C/C++ | wireshark/plugins/epan/transum/packet-transum.h | /* packet-transum.h
* Header file for the TRANSUM response time analyzer post-dissector
* By Paul Offord <[email protected]>
* Copyright 2016 Advance Seven Limited
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#define ETH_TYPE_IPV4 0x0800
#define ETH_TYPE_IPV6 0x86dd
#define IP_PROTO_TCP 6
#define IP_PROTO_UDP 17
#define RTE_CALC_SYN 1
#define RTE_CALC_GTCP 2
#define RTE_CALC_GUDP 3
#define RTE_CALC_SMB1 4
#define RTE_CALC_SMB2 5
#define RTE_CALC_DCERPC 6
#define RTE_CALC_DNS 7
#define MAX_SUBPKTS_PER_PACKET 16
/*
An RR pair is identified by a Fully Qualified Message ID (RRPD)
*/
typedef struct _RRPD
{
/*
When a c2s is set TRUE it means that the associated packet is going from
client-to-service. If this value is false the associated packet is going
from service-to-client.
This value is only valid for RRPDs imbedded in subpacket structures.
*/
gboolean c2s;
guint8 ip_proto;
guint32 stream_no;
guint64 session_id;
guint64 msg_id;
/*
Some request-response pairs are demarked simple by a change in direction on a
TCP or UDP stream from s2c to c2s. This is true for the GTCP and GUDP
calculations. Other calculations (such as DCERPC) use application protocol
values to detect the start and end of APDUs. In this latter case decode_based
is set to true.
*/
gboolean decode_based;
gboolean is_retrans;
guint32 req_first_frame;
nstime_t req_first_rtime;
guint32 req_last_frame;
nstime_t req_last_rtime;
guint32 rsp_first_frame;
nstime_t rsp_first_rtime;
guint32 rsp_last_frame;
nstime_t rsp_last_rtime;
guint calculation;
/* The following numbers are for tuning purposes */
guint32 req_search_total; /* The total number of steps back through the rrpd_list when matching requests to this entry */
guint32 rsp_search_total; /* The total number of steps back through the rrpd_list when matching responses to this entry */
} RRPD;
typedef struct _PKT_INFO
{
int frame_number;
nstime_t relative_time;
gboolean tcp_retran; /* tcp.analysis.retransmission */
gboolean tcp_keep_alive; /* tcp.analysis.keep_alive */
gboolean tcp_flags_syn; /* tcp.flags.syn */
gboolean tcp_flags_ack; /* tcp.flags.ack */
gboolean tcp_flags_reset; /* tcp.flags.reset */
guint32 tcp_flags_urg; /* tcp.urgent_pointer */
guint32 tcp_seq; /* tcp.seq */
/* Generic transport values */
guint16 srcport; /* tcp.srcport or udp.srcport*/
guint16 dstport; /* tcp.dstport or udp.dstport*/
guint16 len; /* tcp.len or udp.len */
guint8 ssl_content_type; /*tls.record.content_type */
guint8 tds_type; /*tds.type */
guint16 tds_length; /* tds.length */
guint16 smb_mid; /* smb.mid */
guint64 smb2_sesid; /* smb2.sesid */
guint64 smb2_msg_id; /* smb2.msg_id */
guint16 smb2_cmd; /* smb2.cmd */
guint8 dcerpc_ver; /* dcerpc.ver */
guint8 dcerpc_pkt_type; /* dcerpc.pkt_type */
guint32 dcerpc_cn_call_id; /* dcerpc.cn_call_id */
guint16 dcerpc_cn_ctx_id; /* dcerpc.cn_ctx_id */
guint16 dns_id; /* dns.id */
/* The following values are calculated */
gboolean pkt_of_interest;
/* RRPD data for this packet */
/* Complete this based on the detected protocol */
RRPD rrpd;
} PKT_INFO;
typedef enum {
HF_INTEREST_IP_PROTO = 0,
HF_INTEREST_IPV6_NXT,
HF_INTEREST_TCP_RETRAN,
HF_INTEREST_TCP_KEEP_ALIVE,
HF_INTEREST_TCP_FLAGS_SYN,
HF_INTEREST_TCP_FLAGS_ACK,
HF_INTEREST_TCP_FLAGS_RESET,
HF_INTEREST_TCP_FLAGS_URG,
HF_INTEREST_TCP_SEQ,
HF_INTEREST_TCP_SRCPORT,
HF_INTEREST_TCP_DSTPORT,
HF_INTEREST_TCP_STREAM,
HF_INTEREST_TCP_LEN,
HF_INTEREST_UDP_SRCPORT,
HF_INTEREST_UDP_DSTPORT,
HF_INTEREST_UDP_STREAM,
HF_INTEREST_UDP_LENGTH,
HF_INTEREST_SSL_CONTENT_TYPE,
HF_INTEREST_TDS_TYPE,
HF_INTEREST_TDS_LENGTH,
HF_INTEREST_SMB_MID,
HF_INTEREST_SMB2_SES_ID,
HF_INTEREST_SMB2_MSG_ID,
HF_INTEREST_SMB2_CMD,
HF_INTEREST_DCERPC_VER,
HF_INTEREST_DCERPC_PKT_TYPE,
HF_INTEREST_DCERPC_CN_CALL_ID,
HF_INTEREST_DCERPC_CN_CTX_ID,
HF_INTEREST_DNS_ID,
HF_INTEREST_END_OF_LIST
} ehf_of_interest;
typedef struct _HF_OF_INTEREST_INFO
{
int hf;
const char* proto_name;
} HF_OF_INTEREST_INFO;
extern HF_OF_INTEREST_INFO hf_of_interest[HF_INTEREST_END_OF_LIST];
void add_detected_tcp_svc(guint16 port);
extern gboolean is_dcerpc_context_zero(guint32 pkt_type);
extern gboolean is_dcerpc_req_pkt_type(guint32 pkt_type);
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/ |
C/C++ | wireshark/plugins/epan/transum/preferences.h | /* preferences.h
* Header file for the TRANSUM response time analyzer post-dissector
* By Paul Offord <[email protected]>
* Copyright 2016 Advance Seven Limited
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <epan/packet.h>
#include <epan/prefs.h>
#define RTE_TIME_SEC 1
#define RTE_TIME_MSEC 1000
#define RTE_TIME_USEC 1000000
#define TRACE_CAP_CLIENT 1
#define TRACE_CAP_INTERMEDIATE 2
#define TRACE_CAP_SERVICE 3
/* Add entries to the service port table for packets to be treated as services
* This is populated with preferences "service ports" data */
typedef struct _TSUM_PREFERENCES
{
int capture_position;
gboolean reassembly;
wmem_map_t *tcp_svc_ports;
wmem_map_t *udp_svc_ports;
gboolean orphan_ka_discard;
int time_multiplier;
gboolean rte_on_first_req;
gboolean rte_on_last_req;
gboolean rte_on_first_rsp;
gboolean rte_on_last_rsp;
gboolean summarisers_enabled;
gboolean summarise_tds;
gboolean summarisers_escape_quotes;
gboolean debug_enabled;
} TSUM_PREFERENCES; |
wireshark/plugins/epan/transum/README | Advance7 has released under GPL this plugin
for Wireshark. It produces detailed response
time information based on the RTE model.
Advance7 can be found at https://www.advance7.com
The author is Paul Offord <[email protected]> |
|
C/C++ | wireshark/plugins/epan/unistim/audio.h | /* audio.h
* header field declarations, value_string definitions and true_false_string
* definitions for audio manager messages
* Copyright 2007 Don Newton <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef UNISTIM_AUDIO_H
#define UNISTIM_AUDIO_H
static int hf_audio_mgr_attr=-1;
static int hf_audio_mgr_opts=-1;
static int hf_audio_mgr_alert=-1;
static int hf_audio_mgr_adj_rx_vol=-1;
static int hf_audio_mgr_def_rx_vol=-1;
static int hf_audio_mgr_handset=-1;
static int hf_audio_mgr_headset=-1;
static int hf_audio_default_rx_vol_id=-1;
static int hf_audio_mgr_opt_max_vol=-1;
static int hf_audio_mgr_opt_adj_vol=-1;
static int hf_audio_mgr_opt_aa_rx_vol_rpt=-1;
static int hf_audio_mgr_opt_hs_on_air=-1;
static int hf_audio_mgr_opt_hd_on_air=-1;
static int hf_audio_mgr_opt_noise_squelch=-1;
static int hf_audio_mgr_mute=-1;
static int hf_audio_mgr_tx_rx=-1;
static int hf_audio_mgr_stream_id=-1;
static int hf_audio_mgr_transducer_based_tone_id=-1;
static int hf_audio_mgr_attenuated=-1;
static int hf_audio_mgr_warbler_select=-1;
static int hf_audio_mgr_transducer_routing=-1;
static int hf_audio_mgr_tone_vol_range=-1;
static int hf_audio_mgr_cadence_select=-1;
static int hf_audio_special_tone=-1;
static int hf_audio_tone_level=-1;
static int hf_audio_visual_tones=-1;
static int hf_audio_stream_based_tone_id=-1;
static int hf_audio_stream_based_tone_rx_tx=-1;
static int hf_audio_stream_based_tone_mute=-1;
static int hf_audio_stream_id=-1;
static int hf_audio_stream_based_volume=-1;
static int hf_audio_apb_number=-1;
static int hf_audio_apb_op_code=-1;
static int hf_audio_apb_param_len=-1;
static int hf_audio_apb_data=-1;
static int hf_audio_vocoder_id=-1;
static int hf_audio_vocoder_param=-1;
static int hf_audio_vocoder_entity=-1;
static int hf_audio_vocoder_annexa=-1;
static int hf_audio_vocoder_annexb=-1;
static int hf_audio_sample_rate=-1;
static int hf_audio_rtp_type=-1;
static int hf_audio_bytes_per_frame=-1;
static int hf_audio_rx_stream_id=-1;
static int hf_audio_tx_stream_id=-1;
static int hf_rx_vocoder_type=-1;
static int hf_tx_vocoder_type=-1;
static int hf_frames_per_packet=-1;
static int hf_audio_tos=-1;
static int hf_audio_precedence=-1;
static int hf_audio_frf_11=-1;
static int hf_rtcp_bucket_id=-1;
static int hf_audio_lcl_rtp_port=-1;
static int hf_audio_lcl_rtcp_port=-1;
static int hf_audio_far_rtp_port=-1;
static int hf_audio_far_rtcp_port=-1;
static int hf_audio_far_ip_add=-1;
static int hf_audio_rtcp_bucket_id=-1;
static int hf_audio_clear_bucket=-1;
static int hf_audio_transducer_pair=-1;
static int hf_audio_rx_enable=-1;
static int hf_audio_tx_enable=-1;
static int hf_audio_sidetone_disable=-1;
static int hf_audio_destruct_additive=-1;
static int hf_audio_dont_force_active=-1;
static int hf_audio_source_descr=-1;
static int hf_audio_sdes_rtcp_bucket=-1;
static int hf_audio_desired_jitter=-1;
static int hf_audio_high_water_mark=-1;
static int hf_audio_early_packet_resync_thresh=-1;
static int hf_audio_late_packet_resync_thresh=-1;
static int hf_audio_resolve_phone_port=-1;
static int hf_audio_far_end_echo_port=-1;
static int hf_audio_far_end_ip_address=-1;
static int hf_audio_nat_port=-1;
static int hf_audio_nat_ip_address=-1;
static int hf_audio_direction_code=-1;
static int hf_audio_hf_support=-1;
static int hf_audio_opt_rpt_max=-1;
static int hf_audio_opt_rpt_adj_vol=-1;
static int hf_audio_opt_rpt_auto_adj_vol=-1;
static int hf_audio_opt_rpt_hs_on_air=-1;
static int hf_audio_opt_rpt_hd_on_air=-1;
static int hf_audio_opt_rpt_noise_squelch=-1;
static int hf_audio_rx_vol_apb_rpt=-1;
static int hf_audio_rx_vol_vol_up=-1;
static int hf_audio_rx_vol_vol_floor=-1;
static int hf_audio_rx_vol_vol_ceiling=-1;
static int hf_audio_current_adj_vol_id=-1;
static int hf_audio_current_rx_level=-1;
static int hf_audio_current_rx_range=-1;
static int hf_audio_cadence_select=-1;
static int hf_audio_warbler_select=-1;
static int hf_audio_open_stream_rpt=-1;
static int hf_audio_sdes_rpt_source_desc=-1;
static int hf_audio_sdes_rpt_buk_id=-1;
static int hf_audio_phone_port=-1;
static int hf_audio_phone_ip=-1;
static int hf_audio_phone_add_len=-1;
static int hf_audio_nat_listen_port=-1;
static int hf_audio_nat_ip=-1;
static int hf_audio_nat_add_len=-1;
static int hf_audio_stream_direction_code=-1;
static int hf_audio_stream_state=-1;
static int hf_audio_transducer_list_length=-1;
static const value_string audio_switch_msgs[]={
{0x00,"Query Audio Manager"},
{0x01,"Query Supervisor Headset Status"},
{0x02,"Audio Manager Options"},
{0x04,"Mute/Unmute"},
{0x10,"Transducer Based Tone On"},
{0x11,"Transducer Based Tone Off"},
{0x12,"Alerting Tone Configuration"},
{0x13,"Special Tone Configuration"},
{0x14,"Paging Tone Configuration"},
{0x15,"Alerting Tone Cadence Download"},
{0x17,"Paging Tone Cadence Download"},
{0x18,"Transducer Based Tone Volume Level"},
{0x1a,"Visual Transducer Based Tone Enable"},
{0x1b,"Stream Based Tone On"},
{0x1c,"Stream Based Tone Off"},
{0x1d,"Stream Based Tone Frequency Component List Download"},
{0x1e,"Stream Based Tone Cadence Download"},
{0x20,"Select Adjustable Rx Volume"},
{0x21,"Set APB's Rx Volume Level"},
{0x22,"Change Adjustable Rx Volume (quieter)"},
{0x23,"Change Adjustable Rx Volume (louder)"},
{0x24,"Adjust Default Rx Volume (quieter)"},
{0x25,"Adjust Default Rx Volume (louder)"},
{0x28,"APB Download"},
{0x30,"Open Audio Stream"},
{0x31,"Close Audio Stream"},
{0x32,"Connect Transducer"},
{0x34,"Filter Block Download"},
{0x37,"Query RTCP Statistics"},
{0x38,"Configure Vocoder Parameters"},
{0x39,"Query RTCP Bucket's SDES Information"},
{0x3a,"Jitter Buffer Parameters Configuration"},
{0x3b,"Resolve Port Mapping"},
{0x3c,"Port Mapping Discovery"},
{0x3d,"Query Audio Stream Status"},
{0xff,"Reserved"},
{0,NULL}
};
static const value_string audio_phone_msgs[]={
{0x00,"Handset Connected"},
{0x01,"Handset Disconnected"},
{0x02,"Headset Connected"},
{0x03,"Headset Disconnected"},
{0x04,"Supervisor Headset Connected"},
{0x05,"Supervisor Headset Disconnected"},
{0x07,"Audio Manager Attributes Info"},
{0x08,"Audio Manager Options Report"},
{0x09,"Adjustable Rx Volume Report"},
{0x0a,"Adjustable Rx Volume Information"},
{0x0b,"APB's Default Rx Volume Value"},
{0x0c,"Alerting Tone Select"},
{0x0e,"RTCP Statistics Report"},
{0x0f,"Open Audio Stream Report"},
{0x10,"RTCP Bucket SDES Information Report"},
{0x11,"Port Mapping Discovery"},
{0x12,"Resolve Port Mapping"},
{0x13,"Audio Stream Status Report"},
{0x14,"Query APB Response"},
{0xff,"Reserved"},
{0,NULL}
};
static const true_false_string stream_states={
"Stream in use.",
"Stream not in use."
};
static const value_string stream_direction_codes[]={
{0x00,"Invalid"},
{0x01,"Command contains information about an Rx Audio stream"},
{0x02,"Command contains information about a Tx Audio stream"},
{0x03,"Invalid"},
{0,NULL}
};
static const value_string source_descipts[]={
{0x00,"Information Not Available"},
{0x01,"Canonical End-Point Identifier associated with the IT"},
{0x02,"Name used to describe the IT e.g. Homer Does IT "},
{0x03,"E-mail address associated with the IT"},
{0x04,"Phone number of the IT"},
{0x05,"Geographic location of the IT"},
{0x06,"IT software version"},
{0x07,"Notice/Status information"},
{0,NULL}
};
static const value_string stream_result[]={
{0x00,"Stream opened successfully"},
{0x01,"Operation failed: Invalid Stream ID"},
{0x02,"Operation failed: Unsupported Vocoder"},
{0x03,"Operation failed: Stream already in use"},
{0x04,"Operation failed: Local port already in use"},
{0x05,"Operation failed: No streams specified"},
{0x06,"Operation failed: Audio packet size too large based on frames per packets"},
{0x07,"Operation failed: Invalid Frames Per Packet value"},
{0x08,"Operation failed: Invalid Bucket ID"},
{0x09,"Operation failed: RTP and RTCP ports Identical"},
{0x0a,"Operation failed: Inconsistent Parameters on full duplex promotion"},
{0x0b,"Operation failed: No Empty Vocoder Bins"},
{0x0c,"Operation failed: Vocoders Not Identical"},
{0,NULL}
};
static const value_string volume_rpt_apbs[]={
{0x01,"Audio Param Bank 1"},
{0x02,"Audio Param Bank 2"},
{0x03,"Audio Param Bank 3"},
{0x04,"Audio Param Bank 4"},
{0x05,"Audio Param Bank 5"},
{0x06,"Audio Param Bank 6"},
{0x07,"Audio Param Bank 7"},
{0x08,"Audio Param Bank 8"},
{0x09,"Audio Param Bank 9"},
{0x0a,"Audio Param Bank 10"},
{0x0b,"Audio Param Bank 11"},
{0x0c,"Audio Param Bank 12"},
{0x0d,"Audio Param Bank 13"},
{0x0e,"Audio Param Bank 14"},
{0x0f,"Audio Param Bank 15"},
{0x10,"Special Tones"},
{0x11,"Paging Tones"},
{0,NULL}
};
static const true_false_string opt_rpt_adjust_volume={
"Volume level adjustments are performed locally in the IT",
"Volume level adjustments are not performed locally in the IT"
};
static const true_false_string opt_rpt_automatic_adjustable_rx_volume_report={
"Adjustable Rx volume reports sent to the NI when volume keys are pressed",
"Adjustable Rx volume reports not sent to the NI when volume keys are pressed"
};
static const true_false_string opt_rpt_enable_max_tone_vol={
"Maximum tone volume is set equal to the physical maximum",
"Maximum tone volume is one level lower than physical maximum"
};
static const true_false_string opt_rpths_on_air_feature={
"Single tone frequency sent to HS port while call in progress",
"Single tone frequency NOT sent to HS port while call in progress"
};
static const true_false_string opt_rpt_hd_on_air_feature={
"Single tone frequency sent to HD port while call in progress",
"Single tone frequency NOT sent to HD port while call in progress"
};
static const true_false_string opt_rpt_noise_sqlch_disable={
"Automatic noise squelching enabled",
"Automatic noise squelching disabled"
};
static const value_string direction_codes[]={
{0x00,"Invalid"},
{0x01,"Rx Audio stream is queried"},
{0x02,"Tx Audio stream is queried"},
{0x03,"Rx and Tx Audio streams are queried"},
{0,NULL}
};
static const value_string source_descriptions[]={
{0x01,"Canonical End-Point Identifier associated with the Phone"},
{0x02,"Name used to describe the Phone e.g. Homer Does Phone"},
{0x03,"E-mail address associated with the Phone"},
{0x04,"Phone number of the Phone"},
{0x05,"Geographic location of the Phone"},
{0x06,"Phone software version"},
{0x07,"Notice/Status information"},
{0,NULL}
};
static const true_false_string dont_force_active={
"The APB specified will NOT be the active one",
"The APB specified will be the active one"
};
static const true_false_string destruct_additive={
"This will not affect the connections that were established prior",
"All transducers that were connected prior will be disconnected"
};
static const value_string transducer_pairs[]={
{0x00,"Handset"},
{0x01,"Headset"},
{0x02,"Handsfree Speaker/Microphone"},
{0x3F,"All Transducer Pairs"},
{0,NULL}
};
static const value_string types_of_service[]={
{0x08,"Minimize Delay"},
{0x04,"Maximize Throughput"},
{0x02,"Maximize Reliability"},
{0x01,"Minimize Monetary Cost"},
{0x00,"Normal Service"},
{0,NULL}
};
static const value_string precedences[]={
{0x00,"Routine"},
{0x01,"Priority"},
{0x02,"Immediate"},
{0x03,"Flash"},
{0x04,"Flash Override"},
{0x05,"Critical"},
{0x06,"Internetwork Control"},
{0x07,"Network Control"},
{0,NULL}
};
static const value_string sample_rates[]={
{0x00,"8 kbit/sec"},
{0x01,"16 kbit/sec"},
{0x02,"44.1 kbit/sec"},
{0,NULL}
};
static const value_string config_param_entities[]={
{0x01,"Configuration Parameter in byte only affects the encoder"},
{0x02,"Configuration Parameter in byte only affects decoder"},
{0x03," Configuration Parameter in byte affects the whole vocoder"},
{0,NULL}
};
static const value_string vocoder_config_params[]={
{0x00,"Turn Off Voice Activity Detection"},
{0x01,"Turn On Voice Activity Detection"},
{0x02,"Turn Off Bad Frame Interpolation Algorithm"},
{0x03,"Turn On Bad Frame Interpolation Algorithm"},
{0x04,"Disable Post Filter"},
{0x05,"Enable Post Filter"},
{0x06,"Disable High Pass Filter"},
{0x07,"Enable High Pass Filter"},
{0x08,"G.723 6.3kbps Working Rate "},
{0x09,"G.723 5.3kbps Working Rate "},
{0x0A,"G.729 Annexes Selection "},
{0x0B,"Set the sampling Rate of the vocoder "},
{0x0C,"Set RTP Payload Type "},
{0x20,"Set number of bytes per frame "},
{0,NULL}
};
static const value_string vocoder_ids[]={
{0x00,"G.711, Mu-Law"},
{0x04,"G.723"},
{0x08,"G.711, A-Law"},
{0x0A,"16-bit Linear"},
{0x12,"G.729"},
{0x60,"8-bit Linear"},
{0x61,"G.711, Mu-Law with PLP"},
{0x62,"G.711, A-Law with PLP"},
{0,NULL}
};
static const value_string apb_op_codes[]={
{0x00,"Enable Return To Default Option"},
{0x01,"Disable Return To Default Option"},
{0x02,"Enable Automatic Gain Control Option"},
{0x03,"Disable Automatic Gain Control Option"},
{0x04,"Select APB for Volume Control Option"},
{0x05,"Deselect APB for Volume Control Option"},
{0x06,"Enable Listener Sidetone Option"},
{0x07,"Disable Listener Sidetone Option"},
{0x08,"Enable Acoustic Echo Canceller (AEC) Option"},
{0x09,"Disable Acoustic Echo Canceller (AEC) Option"},
{0x10,"Enable Hearing Impaired (HIP) Option"},
{0x11,"Disable Hearing Impaired (HIP) Option"},
{0x0A,"Enable Rx Squelch Option"},
{0x0B,"Disable Rx Squelch Option"},
{0x0C,"Enable Rx Compressor Option"},
{0x0D,"Disable Rx Compressor Option"},
{0x0E,"Enable Tx Echo Squelch Option"},
{0x0F,"Disable Tx Echo Squelch Option"},
{0x40,"Query Audio Parameters"},
{0x41,"Step Size setting"},
{0x42,"Maximum Volume setting"},
{0x43,"Minimum Volume setting"},
{0x44,"Rx CODEC Gain Value"},
{0x45,"Tx CODEC Gain Value"},
{0x46,"Rx DSP Gain Value"},
{0x47,"Tx DSP Gain Value"},
{0x48,"Sidetone Gain Value"},
{0x49,"Switched Loss Depth"},
{0x4A,"Length of AEC"},
{0x4B,"MCS_NOISE_THR"},
{0x4C,"LineDelayLength"},
{0x4D,"MaxReturnLossTG"},
{0x4E,"SWL_AEC_OFF"},
{0x4F,"NormDelta"},
{0x50,"TxLevelCompHD"},
{0x51,"TxRL_BOOT"},
{0x52,"NoiseWaitCounter" },
{0x53,"Whole APS" },
{0x54,"Change Default Volume setting"},
{0x55,"Change Current Volume setting"},
{0x56,"Sampling Rate setting"},
{0x57,"The filter(s) to be used when the HIP is enabled"},
{0x58,"The threshold that should be used when AGC is enabled"},
{0x59,"The threshold that should be used when Listener Sidetone (LST) is enabled"},
{0,NULL}
};
static const true_false_string stream_based_tone_rx_tx_yn={
"Stream ID specified in last byte is in the tx direction",
"Stream ID specified in last byte is in the rx direction"
};
static const true_false_string stream_based_tone_mute_yn={
"Stream Based Tone will replace Stream Data",
"Stream Based tone will be summed with Stream Data"
};
static const value_string stream_based_tone_vals[]={
{0x00,"Dial Tone F1=0x0B33 - 350 Hz F2=0x0E14 - 440 Hz F3=0x00 - not present F4=0x00 - not present"},
{0x01,"Recall Dial Tone F1=0x0B33 - 350 Hz F2=0x0E14 - 440 Hz F3=0x00 - not present F4=0x00 - not present"},
{0x02,"Line Busy F1 = 0x0F5C - 480 Hz F2 = 0x13D7 - 620 Hz F3 = 0x00 - not present F4 = 0x00 - not present"},
{0x03,"Reorder F1 = 0x0F5C - 480 Hz F2 = 0x13D7 - 620 Hz F3 = 0x00 - not present F4 = 0x00 - not present"},
{0x04,"Audible Ringing F1=0x0E14 - 440 Hz F2=0x0F5C - 480 Hz F3=0x00 - not present F4=0x00 - not present"},
{0x05,"Receiver Off Hook (ROH) F1=0x2CCC-1400 Hz F2=0x4851-2260 Hz F3=0x4E66-2450 Hz F4=0x5333 - 2600 Hz"},
{0x06,"No Tone F1=0x00-0 Hz F2=0x00-0 Hz F3=0x00-0 Hz F4=0x00-0 Hz 0x00 C1=0x00 C2=0x00 C3=0x0 c4=0x0"},
{0x07,"No Tone F1=0x00-0 Hz F2=0x00-0 Hz F3=0x00-0 Hz F4=0x00-0 Hz 0x00 C1=0x00 C2=0x00 C3=0x0 c4=0x0"},
{0x08,"No Tone F1=0x00-0 Hz F2=0x00-0 Hz F3=0x00-0 Hz F4=0x00-0 Hz 0x00 C1=0x00 C2=0x00 C3=0x0 c4=0x0"},
{0x09,"No Tone F1=0x00-0 Hz F2=0x00-0 Hz F3=0x00-0 Hz F4=0x00-0 Hz 0x00 C1=0x00 C2=0x00 C3=0x0 c4=0x0"},
{0x0a,"No Tone F1=0x00-0 Hz F2=0x00-0 Hz F3=0x00-0 Hz F4=0x00-0 Hz 0x00 C1=0x00 C2=0x00 C3=0x0 c4=0x0"},
{0x0b,"No Tone F1=0x00-0 Hz F2=0x00-0 Hz F3=0x00-0 Hz F4=0x00-0 Hz 0x00 C1=0x00 C2=0x00 C3=0x0 c4=0x0"},
{0x0c,"No Tone F1=0x00-0 Hz F2=0x00-0 Hz F3=0x00-0 Hz F4=0x00-0 Hz 0x00 C1=0x00 C2=0x00 C3=0x0 c4=0x0"},
{0x0d,"No Tone F1=0x00-0 Hz F2=0x00-0 Hz F3=0x00-0 Hz F4=0x00-0 Hz 0x00 C1=0x00 C2=0x00 C3=0x0 c4=0x0"},
{0x0e,"No Tone F1=0x00-0 Hz F2=0x00-0 Hz F3=0x00-0 Hz F4=0x00-0 Hz 0x00 C1=0x00 C2=0x00 C3=0x0 c4=0x0"},
{0x0f,"No Tone F1=0x00-0 Hz F2=0x00-0 Hz F3=0x00-0 Hz F4=0x00-0 Hz 0x00 C1=0x00 C2=0x00 C3=0x0 c4=0x0"},
{0,NULL}
};
static const value_string stream_base_vol_level[]={
/*{0x6F,"C1=0xFF00 C2=0x00 C3=0x00 c4=0x00 Steady on. -13 dBmO per frequency."},*/
{0x6F,"C1=0x0505 C2=0x0505 C3=0x0505 c4=0xFF00 3 burst(0.1 sec on,0.1 sec off),Then steady on.-13 dBmO per frequency."},
{0x60,"C1=0x1919 C2=0x00 C3=0x00 c4=0x00 0.5 sec on, 0.5 sec off, repeating. -24 dBmO per frequency."},
{0x67,"C1=0x64C8 C2=0x00 C3=0x00 c4=0x00 2 sec on, 4 sec off, repeating. -19 dBmO per frequency."},
{0x80,"C1=0xFF00 C2=0x00 C3=0x00 c4=0x00 0.1 sec on, 0.1 sec off, repeating. +3 to -6 dBmO/frequency."},
{0,NULL}
};
static const value_string special_tones_vals[]={
{0x01,"250Hz"},
{0x02,"333Hz"},
{0x04,"500Hz"},
{0x08,"667Hz"},
{0x10,"1000Hz"},
{0,NULL}
};
static const value_string transducer_routing_vals[]={
{0x00,"Handset Speaker"},
{0x01,"Headset Speaker"},
{0x02,"Handsfree Speaker"},
{0,NULL}
};
static const value_string cadence_select_vals[]={
{0x00,"cadence 0 (2 secs on, 4 secs off, cyclic)"},
{0x01,"cadence 1 (0.5 secs on, 0.3 secs off, 1.2 secs on, 4 secs off, cyclic)"},
{0x02,"cadence 2 (0.7 secs on, 0.5 secs off, 0.7 secs on, 4 secs off, cyclic)"},
{0x03,"cadence 3 (0.5 secs on then off, one-shot)"},
{0x04,"cadence 4 (test cadence)"},
{0x05,"cadence 5 (test cadence)"},
{0x06," cadence 6 (test cadence)"},
{0x07,"downloadable alerter tone cadence"},
{0,NULL}
};
static const true_false_string audio_mgr_mute_val={
"Following Stream will be Muted",
"Following Stream will be UnMuted"
};
static const true_false_string audio_mgr_tx_rx_val={
"Next Byte specifies an RX Stream ID",
"Next Byte specifies an TX Stream ID"
};
static const true_false_string audio_opts_enable_max_tone_vol={
"Maximum tone volume is set equal to the physical maximum",
"Maximum tone volume is one level lower than physical maximum"
};
static const true_false_string audio_opts_adjust_volume={
"Volume level adjustments are performed locally in the phone",
"Volume level adjustments are not performed locally in the phone"
};
static const true_false_string audio_opts_automatic_adjustable={
"Adjustable Rx volume reports sent to the switch when volume keys are pressed",
"Adjustable Rx volume reports not sent to the switch when volume keys are pressed Rx Volume Report"
};
static const true_false_string audio_opts_hs_on_air_feature={
"Single tone frequency sent to Handset port while call in progress",
"Single tone frequency NOT sent to Handset (HS) port while call in progress"
};
static const true_false_string audio_opts_hd_on_air_feature={
"Single tone frequency sent to Headset (HD) port while call in progress",
"Single tone frequency NOT sent to Headset (HD) port while call in progress"
};
static const true_false_string noise_sqlch_disable={
"Automatic noise squelching enabled",
"Automatic noise squelching disabled"
};
static const value_string default_rx_vol_id[]={
{0x00,"none"},
{0x01,"Audio Param Bank 1"},
{0x02,"Audio Param Bank 2"},
{0x03,"Audio Param Bank 3"},
{0x04,"Audio Param Bank 4"},
{0x05,"Audio Param Bank 5"},
{0x06,"Audio Param Bank 6"},
{0x07,"Audio Param Bank 7"},
{0x08,"Audio Param Bank 8"},
{0x09,"Audio Param Bank 9"},
{0x0a,"Audio Param Bank a"},
{0x0b,"Audio Param Bank b"},
{0x0c,"Audio Param Bank c"},
{0x0d,"Audio Param Bank d"},
{0x0e,"Audio Param Bank e"},
{0x0f,"Audio Param Bank f"},
{0x10,"Alerting"},
{0x11,"Special Tones"},
{0x12,"Paging Tones"},
{0,NULL}
};
static const value_string trans_base_tone_ids[]={
{0x00,"Alerting"},
{0x01,"Special Tones"},
{0x02,"Paging Tones"},
{0,NULL}
};
#endif |
C/C++ | wireshark/plugins/epan/unistim/basic.h | /* basic.h
* header field declarations, value_string def and true_false_string
* definitions for basic manager messages
* Copyright 2007 Don Newton <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef UNISTIM_BASIC_H
#define UNISTIM_BASIC_H
static int hf_basic_switch_query_flags=-1;
static int hf_basic_switch_query_attr=-1;
static int hf_basic_switch_query_opts=-1;
static int hf_basic_switch_query_fw=-1;
static int hf_basic_switch_query_hw_id=-1;
static int hf_basic_switch_query_it_type=-1;
static int hf_basic_switch_query_prod_eng_code=-1;
static int hf_basic_switch_query_gray_mkt_info=-1;
static int hf_basic_switch_options_secure=-1;
static int hf_basic_switch_element_id=-1;
static int hf_basic_switch_eeprom_data=-1;
static int hf_basic_switch_terminal_id=-1;
static int hf_basic_phone_eeprom_stat_cksum=-1;
static int hf_basic_phone_eeprom_dynam=-1;
static int hf_basic_phone_eeprom_net_config_cksum=-1;
static int hf_basic_phone_hw_id=-1;
static int hf_basic_phone_fw_ver=-1;
static int hf_basic_it_type=-1;
static int hf_basic_prod_eng_code=-1;
static int hf_basic_ether_address=-1;
static const value_string it_types[]={
{0x02,"i2004"},
{0x03,"i2002 Basic Etherset"},
{0x04,"Nortel Conference phone 2033 (polycom)"},
{0x10,"Juniper 7308"},
{0x11,"i2050 Softphone"},
{0x30,"Meridian M6350"},
{0,NULL}
};
static const value_string basic_switch_msgs[]={
{0x01,"Query Basic Manager"},
{0x02,"Basic Manager Options"},
{0x06,"EEprom Write"},
{0x07,"Assign Terminal ID"},
{0x08,"Encapsulate Command"},
{0xff,"Reserved"},
{0,NULL}
};
static const value_string basic_phone_msgs[]={
{0x00,"Basic Manager Attributes Info"},
{0x01,"Basic Manager Options Report"},
{0x02,"Firmware Version"},
{0x03,"IT Type"},
{0x07,"Hardware ID"},
{0x08,"Product Engineering Code"},
{0x09,"Grey Market Info"},
{0x0a,"Encapsulate Command"},
{0x11,"Phone Ethernet Address"},
{0x0b,"Startup reason"},
{0xff,"Reserved"},
{0,NULL}
};
#endif |
C/C++ | wireshark/plugins/epan/unistim/broadcast.h | /* broadcast.h
* header field declarations, value_string def and true_false_string
* definitions for broadcast manager messages
* Copyright 2007 Don Newton <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef UNISTIM_BROADCAST_H
#define UNISTIM_BROADCAST_H
static int hf_broadcast_year=-1;
static int hf_broadcast_month=-1;
static int hf_broadcast_day=-1;
static int hf_broadcast_hour=-1;
static int hf_broadcast_minute=-1;
static int hf_broadcast_second=-1;
static int hf_broadcast_icon_state=-1;
static int hf_broadcast_icon_cadence=-1;
static const value_string broadcast_switch_msgs[]={
{0x00,"Accessory Sync Update"},
{0x01,"Logical Icon Update"},
{0x02,"Time and Date Download"},
{0x03,"Set Default Character Table Config"},
{0xff,"Reserved"},
{0,NULL}
};
#if 0
static const value_string broadcast_phone_msgs[]={
{0xff,"Reserved"},
{0,NULL}
};
#endif
static const value_string bcast_icon_states[]={
{0x00,"I-Idle"},
{0x01,"U-Idle"},
{0x02,"I-Ring"},
{0x03,"U-Ring"},
{0x04,"I-Active"},
{0x05,"U-Active"},
{0x06,"I-Hold"},
{0x07,"U-Hold"},
{0x08,"I-Group Listen"},
{0x09,"U-Group Listen"},
{0x0A,"Feature Active"},
{0x0B,"Feature Inactive"},
{0x0C,"I-Hold Ringing"},
{0x0D,"U-Hold Ringing"},
{0x0E,"Active Audio"},
{0x0F,"Hold Audio"},
{0x10,"Home"},
{0x11,"Business"},
{0x12,"Extension Number"},
{0x13,"Pager"},
{0x14,"Voice"},
{0x15,"Fax"},
{0x16,"Email"},
{0x17,"Wireless"},
{0x18,"Internet Address"},
{0x19,"Set-to-Set command"},
{0x1A,"Secured"},
{0x1B,"Trash Can"},
{0x1C,"In Box"},
{0x1D,"Out box"},
{0x1E,"Video"},
{0x1F,"Other/Misc"},
{0,NULL}
};
static const value_string bcast_icon_cadence[]={
{0x00,"Cadence off, On continuously"},
{0x01,"Cadence on, Off continuously"},
{0x02,"Flash, [1Hz]/[1/2]"},
{0x03,"Flicker, [0.5Hz]/[13/16]"},
{0x04,"Wink, [2Hz]/[3/4]"},
{0x07,"Downloaded Cadence"},
{0,NULL}
};
#endif |
Text | wireshark/plugins/epan/unistim/CMakeLists.txt | # CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <[email protected]>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
include(WiresharkPlugin)
# Plugin name and version info (major minor micro extra)
set_module_info(unistim 0 0 2 0)
set(DISSECTOR_SRC
packet-unistim.c
)
set(PLUGIN_FILES
plugin.c
${DISSECTOR_SRC}
)
set_source_files_properties(
${PLUGIN_FILES}
PROPERTIES
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
)
register_plugin_files(plugin.c
plugin
${DISSECTOR_SRC}
)
add_wireshark_plugin_library(unistim epan)
target_link_libraries(unistim epan)
install_plugin(unistim epan)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
unistim
SWITCHES
--group dissectors-prohibited
--group dissectors-restricted
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
)
#
# Editor modelines - https://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
# |
C/C++ | wireshark/plugins/epan/unistim/defines.h | /* defines.h
* Contains all bitmask defines for unistim dissecting
* Copyright 2007 Don Newton <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef UNISTIM_DEFINES
#define UNISTIM_DEFINES
#define QUERY_AUDIO_MGR_ATTRIBUTES 0x01
#define QUERY_AUDIO_MGR_OPTIONS 0x02
#define QUERY_AUDIO_MGR_ALERTING 0x04
#define QUERY_AUDIO_MGR_ADJ_RX_VOL 0x08
#define QUERY_AUDIO_MGR_DEF_RX_VOL 0x10
#define QUERY_AUDIO_MGR_HANDSET 0x40
#define QUERY_AUDIO_MGR_HEADSET 0x80
#define AUDIO_MGR_OPTS_MAX_VOL 0x01
#define AUDIO_MGR_ADJ_VOL 0x02
#define AUDIO_MGR_AUTO_RX_VOL_RPT 0x04
#define AUDIO_MGR_HS_ON_AIR 0x08
#define AUDIO_MGR_HD_ON_AIR 0x10
#define AUDIO_MGR_NOISE_SQUELCH 0x20
#define AUDIO_MGR_MUTE 0x01
#define AUDIO_MGR_TX_RX 0x02
#define AUDIO_MGR_ATTENUATED 0x08
#define AUDIO_MGR_VISUAL_TONE 0x01
#define AUDIO_STREAM_BASED_TONE_RX_TX 0x40
#define AUDIO_STREAM_BASED_TONE_MUTE 0x80
#define AUDIO_VOCODER_CONFIG_PARAM 0x3f
#define AUDIO_VOCODER_CONFIG_ENTITY 0xc0
#define AUDIO_VOCODER_ANNEXA 0x01
#define AUDIO_VOCODER_ANNEXB 0x02
#define AUDIO_TYPE_OF_SERVICE 0x0f
#define AUDIO_PRECENDENCE 0x70
#define AUDIO_FRF_11 0x80
#define AUDIO_RTCP_BUCKET_ID 0x0f
#define AUDIO_CLEAR_BUCKET 0x10
#define AUDIO_TRANSDUCER_PAIR_ID 0x3f
#define AUDIO_RX_ENABLE 0x40
#define AUDIO_TX_ENABLE 0x80
#define AUDIO_APB_NUMBER 0x0f
#define AUDIO_SIDETONE_DISABLE 0x10
#define AUDIO_DESTRUCT_ADD 0x20
#define AUDIO_DONT_FORCE_ACTIVE 0x40
#define AUDIO_SOURCE_DESCRIPTION 0x0f
#define AUDIO_SDES_RTCP_BUCKET 0xf0
#define AUDIO_DIRECTION_CODE 0x03
#define AUDIO_HF_SUPPORT 0x01
#define AUDIO_ENABLED_MAX_TONE 0x01
#define AUDIO_ENABLED_ADJ_VOL 0x02
#define AUDIO_AUTO_ADJ_RX_REP 0x04
#define AUDIO_HS_ON_AIR_FEATURE 0x08
#define AUDIO_HD_ON_AIR_FEATURE 0x10
#define AUDIO_NOISE_SQUELCH_DIS 0x20
#define AUDIO_APB_VOL_RPT 0x1f
#define AUDIO_VOL_UP_RPT 0x20
#define AUDIO_VOL_FLR_RPT 0x40
#define AUDIO_VOL_CEIL_RPT 0x80
#define AUDIO_ALERT_CADENCE_SEL 0x07
#define AUDIO_ALERT_WARBLER_SEL 0x38
#define AUDIO_SDES_INFO_RPT_DESC 0x0f
#define AUDIO_SDES_INFO_RPT_BUK 0xf0
#define AUDIO_STREAM_DIRECTION 0x03
#define AUDIO_STREAM_DIRECTION_RX 0x01
#define AUDIO_STREAM_DIRECTION_TX 0x02
#define AUDIO_STREAM_STATE 0x01
#define BASIC_QUERY_ATTRIBUTES 0x01
#define BASIC_QUERY_OPTIONS 0x02
#define BASIC_QUERY_FW 0x04
#define BASIC_QUERY_HW_ID 0x08
#define BASIC_QUERY_IT_TYPE 0x10
#define BASIC_QUERY_PROD_ENG_CODE 0x40
#define BASIC_QUERY_GRAY_MKT_INFO 0x80
#define BASIC_OPTION_SECURE 0x01
#define QUERY_NETWORK_MANAGER_DIAGNOSTIC 0x01
#define QUERY_NETWORK_MANAGER_MANAGERS 0x02
#define QUERY_NETWORK_MANAGER_ATTRIBUTES 0x04
#define QUERY_NETWORK_MANAGER_SERVER_INFO 0x08
#define QUERY_NETWORK_MANAGER_OPTIONS 0x10
#define QUERY_NETWORK_MANAGER_SANITY 0x80
#define NETWORK_MANAGER_ENABLE_DIAG 0x01
#define NETWORK_MANAGER_ENABLE_RUDP 0x02
#define RX_BUFFER_OVERFLOW 0x01
#define TX_BUFFER_OVERFLOW 0x02
#define RX_UNEXPECT_EMPTY 0x08
#define INVALID_MSG 0x20
#define EEPROM_INSANE 0x40
#define EEPROM_UNSAFE 0x80
#define NETWORK_MGR_REPORT_DIAG 0x01
#define NETWORK_MGR_REPORT_RUDP 0x02
#define DISPLAY_WRITE_ADDRESS_NUMERIC_FLAG 0x01
#define DISPLAY_WRITE_ADDRESS_CONTEXT_FLAG 0x02
#define DISPLAY_WRITE_ADDRESS_LINE_FLAG 0x04
#define DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG 0x08
#define DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG 0x10
#define DISPLAY_WRITE_ADDRESS_SOFT_KEY_ID 0xe0
#define DISPLAY_WRITE_ADDRESS_CHAR_POS 0x1f
#define DISPLAY_WRITE_ADDRESS_LINE_NUM 0xe0
#define DISPLAY_WRITE_CURSOR_MOVE 0x01
#define DISPLAY_WRITE_CLEAR_LEFT 0x02
#define DISPLAY_WRITE_CLEAR_RIGHT 0x04
#define DISPLAY_WRITE_SHIFT_LEFT 0x08
#define DISPLAY_WRITE_SHIFT_RIGHT 0x10
#define DISPLAY_WRITE_HIGHLIGHT 0x20
#define DISPLAY_CURSOR_BLINK 0x80
#define DISPLAY_CURSOR_MOVE_CMD 0x0f
#define DISPLAY_CLEAR_NUMERIC 0x01
#define DISPLAY_CLEAR_CONTEXT 0x02
#define DISPLAY_CLEAR_DATE 0x04
#define DISPLAY_CLEAR_TIME 0x08
#define DISPLAY_CLEAR_LINE 0x10
#define DISPLAY_CLEAR_STATUS_BAR_ICON 0x20
#define DISPLAY_CLEAR_SOFTKEY 0x40
#define DISPLAY_CLEAR_SOFTKEY_LABEL 0x80
#define DISPLAY_CLEAR_LINE_1 0x01
#define DISPLAY_CLEAR_LINE_2 0x02
#define DISPLAY_CLEAR_LINE_3 0x04
#define DISPLAY_CLEAR_LINE_4 0x08
#define DISPLAY_CLEAR_LINE_5 0x10
#define DISPLAY_CLEAR_LINE_6 0x20
#define DISPLAY_CLEAR_LINE_7 0x40
#define DISPLAY_CLEAR_LINE_8 0x80
#define DISPLAY_STATUS_BAR_ICON_1 0x01
#define DISPLAY_STATUS_BAR_ICON_2 0x02
#define DISPLAY_STATUS_BAR_ICON_3 0x04
#define DISPLAY_STATUS_BAR_ICON_4 0x08
#define DISPLAY_STATUS_BAR_ICON_5 0x10
#define DISPLAY_STATUS_BAR_ICON_6 0x20
#define DISPLAY_STATUS_BAR_ICON_7 0x40
#define DISPLAY_STATUS_BAR_ICON_8 0x80
#define DISPLAY_ICON_ID 0x1f
#define DISPLAY_SOFT_KEY_1 0x01
#define DISPLAY_SOFT_KEY_2 0x02
#define DISPLAY_SOFT_KEY_3 0x04
#define DISPLAY_SOFT_KEY_4 0x08
#define DISPLAY_SOFT_KEY_5 0x10
#define DISPLAY_SOFT_KEY_6 0x20
#define DISPLAY_SOFT_KEY_7 0x40
#define DISPLAY_SOFT_KEY_8 0x80
#define DISPLAY_CLEAR_SK_LABEL_KEY_ID 0x1f
#define DISPLAY_CLEAR_ALL_SLKS 0x20
#define KEY_LED_CADENCE 0x07
#define KEY_LED_ID 0x18
#define DISPLAY_LINE_WIDTH 0x1f
#define DISPLAY_LINES 0xe0
#define DISPLAY_SKEY_WIDTH 0x0f
#define DISPLAY_SKEYS 0x70
#define DISPLAY_ICON 0x80
#define DISPLAY_SOFTLABEL_WIDTH 0x0f
#define DISPLAY_CONTEXT_WIDTH 0xf0
#define DISPLAY_NUMERIC_WIDTH 0x03
#define DISPLAY_TIME_WIDTH 0x1c
#define DISPLAY_DATE_WIDTH 0xe0
#define DISPLAY_CHAR_DLOAD 0x0f
#define DISPLAY_FFORM_ICON_DLOAD 0x70
#define DISPLAY_ICON_TYPE 0x80
#define DISPLAY_CHARSET 0x0f
#define DISPLAY_CURSOR_NUMERIC 0x01
#define DISPLAY_CURSOR_CONTEXT 0x02
#define DISPLAY_CURSOR_LINE 0x04
#define DISPLAY_CURSOR_SKEY 0x08
#define DISPLAY_CURSOR_SKEY_ID 0xe0
#define DISPLAY_CURSOR_CHAR_POS 0x1f
#define DISPLAY_CURSOR_LINE_NUM 0xe0
#define DISPLAY_TIME_FORMAT 0x03
#define DISPLAY_DATE_FORMAT 0x0c
#define DISPLAY_USE_DATE_FORMAT 0x20
#define DISPLAY_USE_TIME_FORMAT 0x10
#define DISPLAY_CTX_FORMAT 0x0f
#define DISPLAY_CTX_FIELD 0x30
#define DISPLAY_LAYER_SKEY_ID 0x07
#define DISPLAY_LAYER_ALL_SKEYS 0x80
#define DISPLAY_ONE_OR_CYCLIC 0x80
#define DISPLAY_CALL_TIMER_MODE 0x01
#define DISPLAY_CALL_TIMER_RESET 0x02
#define DISPLAY_CALL_TIMER_DISPLAY 0x04
#define DISPLAY_CALL_TIMER_DELAY 0x08
#define DISPLAY_CALL_TIMER_ID 0x3f
#define KEY_NUM_PROG_KEYS 0x1f
#define KEY_NUM_SOFT_KEYS 0xe0
#define KEY_HD_KEY_EXISTS 0x01
#define KEY_MUTE_KEY_EXISTS 0x02
#define KEY_QUIT_KEY_EXISTS 0x04
#define KEY_COPY_KEY_EXISTS 0x08
#define KEY_MWI_EXISTS 0x10
#define KEY_NUM_NAV_KEYS 0x03
#define KEY_NUM_CONSPIC_KEYS 0x1c
#define KEY_SEND_KEY_RELEASE 0x01
#define KEY_ENABLE_VOL_KEY 0x02
#define KEY_CONSPIC_PROG_KEY0 0x08
#define KEY_ACD_SUP_CONTROL 0x10
#define KEY_LOCAL_DIAL_PAD_FEED 0x60
#define KEY_ADMIN_CMD 0xe0
#define NETWORK_FILE_XFER_MODE 0x1f
#define NETWORK_FORCE_DLOAD 0x20
#define NETWORK_USE_FSERV_PORT 0x40
#define NETWORK_USE_LOCAL_PORT 0x80
#endif |
C/C++ | wireshark/plugins/epan/unistim/display.h | /*display.h
* header field declarations, value_string def and true_false_string
* definitions for display manager messages
* Copyright 2007 Don Newton <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef UNISTIM_DISPLAY_H
#define UNISTIM_DISPLAY_H
static int hf_display_write_cursor_move=-1;
static int hf_display_write_clear_left=-1;
static int hf_display_write_clear_right=-1;
static int hf_display_write_shift_left=-1;
static int hf_display_write_shift_right=-1;
static int hf_display_write_highlight=-1;
static int hf_display_write_tag=-1;
static int hf_display_write_address_numeric=-1;
static int hf_display_write_address_context=-1;
static int hf_display_write_address_line=-1;
static int hf_display_write_address_soft_key=-1;
static int hf_display_write_address_soft_label=-1;
static int hf_display_write_address_softkey_id=-1;
static int hf_display_write_address_char_pos=-1;
static int hf_display_write_address_line_number=-1;
static int hf_display_cursor_move_cmd=-1;
static int hf_display_cursor_blink=-1;
static int hf_icon_id=-1;
static int hf_display_arrow=-1;
static int hf_display_clear_numeric =-1;
static int hf_display_clear_context =-1;
static int hf_display_clear_date =-1;
static int hf_display_clear_time =-1;
static int hf_display_clear_line =-1;
static int hf_display_clear_status_bar_icon =-1;
static int hf_display_clear_softkey =-1;
static int hf_display_clear_softkey_label =-1;
static int hf_display_clear_line_1 =-1;
static int hf_display_clear_line_2 =-1;
static int hf_display_clear_line_3 =-1;
static int hf_display_clear_line_4 =-1;
static int hf_display_clear_line_5 =-1;
static int hf_display_clear_line_6 =-1;
static int hf_display_clear_line_7 =-1;
static int hf_display_clear_line_8 =-1;
static int hf_display_clear_status_bar_icon_1 =-1;
static int hf_display_clear_status_bar_icon_2 =-1;
static int hf_display_clear_status_bar_icon_3 =-1;
static int hf_display_clear_status_bar_icon_4 =-1;
static int hf_display_clear_status_bar_icon_5 =-1;
static int hf_display_clear_status_bar_icon_6 =-1;
static int hf_display_clear_status_bar_icon_7 =-1;
static int hf_display_clear_status_bar_icon_8 =-1;
static int hf_display_clear_soft_key_1 =-1;
static int hf_display_clear_soft_key_2 =-1;
static int hf_display_clear_soft_key_3 =-1;
static int hf_display_clear_soft_key_4 =-1;
static int hf_display_clear_soft_key_5 =-1;
static int hf_display_clear_soft_key_6 =-1;
static int hf_display_clear_soft_key_7 =-1;
static int hf_display_clear_soft_key_8 =-1;
static int hf_display_clear_sk_label_key_id=-1;
static int hf_display_clear_all_slks=-1;
static int hf_display_line_width=-1;
static int hf_display_lines=-1;
static int hf_display_softkey_width=-1;
static int hf_display_softkeys=-1;
static int hf_display_icon=-1;
static int hf_display_softlabel_key_width=-1;
static int hf_display_context_width=-1;
static int hf_display_numeric_width=-1;
static int hf_display_time_width=-1;
static int hf_display_date_width=-1;
static int hf_display_char_dload=-1;
static int hf_display_freeform_icon_dload=-1;
static int hf_display_icon_type=-1;
static int hf_display_charsets=-1;
static int hf_display_contrast=-1;
static int hf_display_cursor_numeric=-1;
static int hf_display_cursor_context =-1;
static int hf_display_cursor_line =-1;
static int hf_display_cursor_softkey =-1;
static int hf_display_cursor_softkey_id =-1;
static int hf_display_cursor_char_pos =-1;
static int hf_display_cursor_line_number =-1;
static int hf_display_hlight_start=-1;
static int hf_display_hlight_end=-1;
static int hf_display_date_format=-1;
static int hf_display_time_format=-1;
static int hf_display_use_time_format=-1;
static int hf_display_use_date_format=-1;
static int hf_display_context_format=-1;
static int hf_display_context_field=-1;
static int hf_display_char_address=-1;
static int hf_display_layer_number=-1;
static int hf_display_layer_skey_id=-1;
static int hf_display_layer_all_skeys=-1;
static int hf_display_once_or_cyclic=-1;
static int hf_display_layer_duration=-1;
static int hf_display_call_timer_mode=-1;
static int hf_display_call_timer_reset=-1;
static int hf_display_call_timer_display=-1;
static int hf_display_call_timer_delay=-1;
static int hf_display_call_timer_id=-1;
static const value_string arrow_dirs[]={
{0x00,"Down"},
{0x01,"Up"},
{0x02,"Right"},
{0x03,"Left"},
{0,NULL}
};
static const value_string cursor_move_cmds[]={
{0x00,"Set cursor at home (first character on the first text line)"},
{0x01,"Set cursor at the address specified in the following byte"},
{0x02,"Move the cursor by one to the left"},
{0x03,"Move the cursor by one to the right"},
{0x04,"Move the cursor to the left as specified by the Character Position field contained in the last byte"},
{0x05,"Move the cursor to the right as specified by the Character Position field contained in the last byte"},
{0x06,"Cursor ON"},
{0x07,"Cursor OFF"},
{0xff,"No Movement command"},
{0,NULL}
};
static const value_string display_switch_msgs[]={
{0x01,"Restore Default Character Table Configuration"},
{0x04,"Arrow"},
{0x05,"Query Status Bar Icon"},
{0x06,"Highlight Off"},
{0x07,"Highlight On"},
{0x09,"Restore Time and Date"},
{0x0a,"Clear Time and Date"},
{0x0b,"Call Duration Timer"},
{0x0c,"Query Display Manager"},
{0x0d,"Download Call Duration Timer Delay"},
{0x0e,"Disable Display Field"},
{0x0f,"Clear Field"},
{0x10,"Cursor Control"},
{0x12,"Display Scroll with Data (before)"},
{0x13,"Display Scroll with Data (after)"},
{0x14,"Status Bar Icon Update"},
{0x15,"Month Labels Download"},
{0x16,"Call Duration Timer Label Download"},
{0x17,"Time and Date Format"},
{0x18,"Display Data Write address|no control|no tag|no"},
{0x19,"Display Data Write address|yes control|no tag|no"},
{0x1a,"Display Data Write address|no control|yes tag|no"},
{0x1b,"Display Data Write address|yes control|yes tag|no"},
{0x1c,"Display Data Write address|no control|no tag|yes"},
{0x1d,"Display Data Write address|yes control|no tag|yes"},
{0x1e,"Display Data Write address|no control|yes tag|yes"},
{0x1f,"Display Data Write address|yes control|yes tag|yes"},
{0x20,"Context Info Bar Format"},
{0x21,"Set Default Character Table Configuration"},
{0x22,"Special Character Download"},
{0x23,"Highlighted Field Definition"},
{0x24,"Contrast"},
{0x25,"Caller Log Download"},
{0x30,"Layered Softkey Text Download"},
{0x31,"Layered Softkey Clear"},
{0x32,"Set Visible Softkey Layer"},
{0x33,"Layered Softkey Cadence Download"},
{0x34,"Layered Softkey Cadencing On"},
{0x35,"Layered Softkey Cadencing Off"},
{0xff,"Reserved"},
{0,NULL}
};
static const value_string display_phone_msgs[]={
{0x00,"Display Manager Attributes Info"},
{0x01,"Contrast Level Report"},
{0x02,"Cursor Location Report"},
{0x03,"Highlight Status On"},
{0x04,"Current Character Table Configuration Status"},
{0x05,"Default Character Table Configuration Status"},
{0x06,"Timer And Date Format Report"},
{0x07,"Status Bar Icon State Report"},
{0x0a,"Highlight Status Off"},
{0xff,"Reserved"},
{0,NULL}
};
static const true_false_string once_or_cyclic={
"After the full cadence sequence is executed, softkey field will be updated ",
"After the full cadence sequence is executed, it is restarted from the top"
};
static const value_string display_formats[]={
{0x00,"None"},
{0x01,"Underline"},
{0x02,"Overline"},
{0x03,"Marquee (combination of an overline and an underline)"},
{0x04,"Border"},
{0x05,"Reverse-video"},
{0x06,"Reverse-video with border"},
{0,NULL}
};
static const value_string display_format_fields[]={
{0x00,"Numeric Index field"},
{0x01,"Context field"},
{0x02,"Date field"},
{0x03,"Time field"},
{0,NULL}
};
static const value_string time_formats[]={
{0x00,"12-hour clock, e.g. 10:34pm"},
{0x01,"French clock, e.g. 22h34"},
{0x02,"24-hour clock, e.g. 22:34"},
{0x03,"Reserved"},
{0,NULL}
};
static const value_string date_formats[]={
{0x00,"Day first, e.g. 16Sep"},
{0x01,"Month first, e.g. Sep16"},
{0x02," Numeric standard, e.g. 09/16"},
{0x03,"Numeric inverse, e.g. 16/09"},
{0,NULL}
};
static const value_string icon_types[]={
{0x00,"Fixed Form Icons"},
{0x01,"Free Form Icons"},
{0,NULL}
};
static const true_false_string call_duration_timer_mode={
"Mode = start timer",
"Mode = stop timer"
};
static const true_false_string call_duration_timer_reset={
"Reset time to zero",
"Do not reset timer"
};
static const true_false_string call_duration_display_timer={
"Call Duration timer is shown on the display",
"Call Duration timer is not shown on the display"
};
static const true_false_string call_duration_timer_delay={
"Action occurs after Call Duration Timer Delay",
"Action occurs immediately"
};
#endif |
C/C++ | wireshark/plugins/epan/unistim/expansion.h | /* expansion.h
* header field declarations, value_string def and true_false_string
* definitions for basic manager messages
* Copyright 2007 Don Newton <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef UNISTIM_EXPANSION_H
#define UNISTIM_EXPANSION_H
static int hf_expansion_softlabel_number=-1;
static const value_string expansion_switch_msgs[]={
{0x17,"Next Display/Write command regards expansion module"},
{0x57,"Display Data Write"},
{0x59,"Icon Update"},
{0,NULL}
};
static const value_string expansion_phone_msgs[]={
{0x59,"Expansion Key Pressed"},
{0,NULL}
};
#endif |
C/C++ | wireshark/plugins/epan/unistim/key.h | /* key.h
* header field declarations, value_string def and true_false_string
* definitions for key manager messages
* Copyright 2007 Don Newton <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef UNISTIM_KEY_H
#define UNISTIM_KEY_H
static int hf_key_icon_id=-1;
static int hf_key_led_cadence=-1;
static int hf_key_led_id=-1;
static int hf_key_programmable_keys=-1;
static int hf_keys_soft_keys=-1;
static int hf_keys_hd_key=-1;
static int hf_keys_mute_key=-1;
static int hf_keys_quit_key=-1;
static int hf_keys_copy_key=-1;
static int hf_keys_mwi_key=-1;
static int hf_keys_num_nav_keys=-1;
static int hf_keys_num_conspic_keys=-1;
static int hf_keys_send_key_rel=-1;
static int hf_keys_enable_vol=-1;
static int hf_keys_conspic_prog_key=-1;
static int hf_keys_acd_super_control=-1;
static int hf_keys_local_dial_feedback=-1;
static int hf_keys_admin_command=-1;
static int hf_keys_logical_icon_id=-1;
static int hf_keys_repeat_timer_one=-1;
static int hf_keys_repeat_timer_two=-1;
static int hf_keys_led_id=-1;
static int hf_keys_phone_icon_id=-1;
static int hf_keys_cadence_on_time=-1;
static int hf_keys_cadence_off_time=-1;
static int hf_keys_user_activity_timeout=-1;
static const value_string keys_led_ids[]={
{0x00,"Message Waiting LED"},
{0x01,"Handsfree or Supervisor Access* LED"},
{0x02,"Headset LED"},
{0x03,"Mute LED"},
{0x07,"Query all LEDs"},
{0,NULL}
};
static const value_string admin_commands[]={
{0x00,"Global NIL mapping"},
{0x01,"One-to-one mapping"},
{0x02,"Single mapping"},
{0x03,"RESERVED"},
{0,NULL}
};
static const value_string key_switch_msgs[]={
{0x00,"LED Update"},
{0x01,"Query Hookswitch"},
{0x02,"User Activity Timer Stop"},
{0x03,"User Activity Timer Start"},
{0x04,"Downloadable Free Form Icon Access (Hardcoded)"},
{0x05,"Downloadable Free Form Icon Access (Downloadable)"},
{0x06,"Query Key/Indicator Manager"},
{0x07,"Key/Indicator Manager Options"},
{0x08,"Logical Icon Mapping"},
{0x09,"Key Repeat Timer Download"},
{0x0a,"Query LED State"},
{0x0b,"Query Phone Icon State"},
{0x0c,"Indicator Cadence Download"},
{0x0d,"User Activity Timer Download"},
{0x0e,"Free Form Icon Download"},
{0x0f,"Phone Icon Update"},
{0xff,"Reserved"},
{0,NULL}
};
static const value_string key_phone_msgs[]={
{0x00,"Key Event"},
{0x01,"LED Status Report"},
{0x03,"On Hook"},
{0x04,"Off Hook"},
{0x05,"User Activity Timer Expired"},
{0x06,"Hookswitch State (on hook)"},
{0x07,"Hookswitch State (off hook)"},
{0x08,"Key/Indicator Manager Attributes Info"},
{0x09,"Key/Indicator Manager Options Report"},
{0x0a,"Phone Icon Status Report"},
{0xff,"Reserved"},
{0,NULL}
};
static const true_false_string key_release={
"The Key code will be sent when a valid key release occurs",
"No command will be sent when a key is released"
};
static const true_false_string enable_vol={
"Volume key depression will be sent",
"Volume Key depression will not be sent"
};
static const true_false_string conspic_prog={
"Forces the keycode associated with conspicuous key0 to be the same as progkey0",
"Conspicuous value key 0 and programmable key 0 have different keycodes"
};
static const true_false_string acd_supervisor={
"ACD supervisor path and indicator controlled by the Switch",
"ACD supervisor path and indicator controlled by the Phone"
};
static const value_string local_dialpad_feedback[]={
{0x00,"No tone feedback provided when a dial pad key is depressed"},
{0x01,"Short 'click' provided when a dial pad key is depressed"},
{0x02,"Corresponding DTMF tone provided when a dial pad key is depressed"},
{0x03,"Reserved"},
{0,NULL}
};
static const value_string number_nav_keys[]={
{0x00,"no navigation keys"},
{0x01,"two navigation keys"},
{0x02,"four navigation keys"},
{0x03,"not available"},
{0,NULL}
};
static const value_string led_ids[]={
{0x00,"Message Waiting LED"},
{0x01,"Handsfree or Supervisor Access* LED"},
{0x02,"Headset LED"},
{0x03,"Mute LED"},
{0,NULL}
};
static const value_string led_cadences[]={
{0x00,"Off"},
{0x01,"On"},
{0x02,"Flash"},
{0x03,"Flicker"},
{0x04,""},
{0x05,""},
{0x06,"Blink"},
{0x07,"Downloadable cadence"},
{0,NULL}
};
#endif |
C/C++ | wireshark/plugins/epan/unistim/network.h | /* network.h
* header field declarations, value_string def and true_false_string
* definitions for network manager messages
* Copyright 2007 Don Newton <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef UNISTIM_NETWORK_H
#define UNISTIM_NETWORK_H
static int hf_net_diag_flag=-1;
static int hf_net_managers_flag=-1;
static int hf_net_attributes_flag=-1;
static int hf_net_serv_info_flag=-1;
static int hf_net_options_flag=-1;
static int hf_net_sanity_flag=-1;
static int hf_net_enable_diag=-1;
static int hf_net_enable_rudp=-1;
static int hf_net_server_id=-1;
static int hf_net_server_port=-1;
static int hf_net_server_action=-1;
static int hf_net_server_retry_count=-1;
static int hf_net_server_failover_id=-1;
static int hf_net_server_ip_address=-1;
static int hf_net_server_time_out=-1;
static int hf_net_server_config_element=-1;
static int hf_net_server_recovery_time_low=-1;
static int hf_net_server_recovery_time_high=-1;
static int hf_net_phone_rx_ovr_flag=-1;
static int hf_net_phone_tx_ovr_flag=-1;
static int hf_net_phone_rx_empty_flag=-1;
static int hf_net_phone_invalid_msg_flag=-1;
static int hf_net_phone_eeprom_insane_flag=-1;
static int hf_net_phone_eeprom_unsafe_flag=-1;
static int hf_net_phone_diag=-1;
static int hf_net_phone_rudp=-1;
static int hf_net_phone_primary_server_id=-1;
static int hf_net_phone_server_port=-1;
static int hf_net_phone_server_action=-1;
static int hf_net_phone_server_retry_count=-1;
static int hf_net_phone_server_failover_id=-1;
static int hf_net_phone_server_ip=-1;
static int hf_net_file_xfer_mode =-1;
static int hf_net_force_download =-1;
static int hf_net_use_file_server_port =-1;
static int hf_net_use_local_port=-1;
static int hf_net_file_server_port=-1;
static int hf_net_local_port=-1;
static int hf_net_file_server_address=-1;
static int hf_net_full_pathname=-1;
static int hf_net_file_identifier=-1;
static const value_string file_xfer_modes[]={
{0x00,"TFTP"},
{0x01,"TFTP with active UNIStim channel"},
{0x02,"UFTP"},
{0x03,"UFTP with active UNIStim channel"},
{0x04,"Future Use"},
{0,NULL}
};
static const value_string action_bytes[]={
{0x00,"Reserved"},
{0x01,"Establish Unistim connection with Server"},
{0x02,"Not Assigned"},
{0,NULL}
};
static int hf_key_code=-1;
static int hf_key_command=-1;
static const value_string key_cmds[]={
{0x00,"Key Released"},
{0x01,"Key Depressed"},
{0x02,"Key Repeated"},
{0,NULL}
};
static const value_string key_names[]={
{0x00,"Dial Pad 0"},
{0x01,"Dial Pad 1"},
{0x02,"Dial Pad 2"},
{0x03,"Dial Pad 3"},
{0x04,"Dial Pad 4"},
{0x05,"Dial Pad 5"},
{0x06,"Dial Pad 6"},
{0x07,"Dial Pad 7"},
{0x08,"Dial Pad 8"},
{0x09,"Dial Pad 9"},
{0x0a,"Dial Pad *"},
{0x0b,"Dial Pad #"},
{0x0c,"Navigation Up"},
{0x0d,"Navigation Down"},
{0x0e,"Navigation Right"},
{0x0f,"Navigation Left"},
{0x10,"Quit"},
{0x11,"Copy"},
{0x12,"Volume Up"},
{0x13,"Volume Down"},
{0x14,"Soft Key 0"},
{0x15,"Soft Key 1"},
{0x16,"Soft Key 2"},
{0x17,"Soft Key 3"},
{0x1a,"Supervisor Access Key"},
{0x1b,"Hold"},
{0x1c,"Release"},
{0x1d,"Mute"},
{0x1e,"Headset"},
{0x1f,"Handsfree"},
{0x20,"Prog Key 0"},
{0x21,"Prog Key 1"},
{0x22,"Prog Key 2"},
{0x23,"Prog Key 3"},
{0x24,"Prog Key 4"},
{0x25,"Prog Key 5"},
{0x26,"Prog Key 6"},
{0x27,"Prog Key 7"},
{0x28,"Prog Key 8"},
{0x29,"Prog Key 9"},
{0x2a,"Prog Key 10"},
{0x2b,"Prog Key 11"},
{0x2c,"Prog Key 12"},
{0x2d,"Prog Key 13"},
{0x2e,"Prog Key 14"},
{0x2f,"Prog Key 15"},
{0x30,"Prog Key 16"},
{0x31,"Prog Key 17"},
{0x32,"Prog Key 18"},
{0x33,"Prog Key 19"},
{0x34,"Prog Key 20"},
{0x35,"Prog Key 21"},
{0x36,"Prog Key 22"},
{0x37,"Prog Key 23"},
{0x38,"Prog Key 24"},
{0x3b,"Conspicuous Key 0"},
{0x3c,"Conspicuous Key 1"},
{0x3d,"Conspicuous Key 2"},
{0x3e,"Conspicuous Key 3"},
{0x3f,"Conspicuous Key 4"},
{0,NULL}
};
static const value_string network_switch_msgs[]={
{0x02,"Soft Reset"},
{0x03,"Hard Reset"},
{0x04,"Query Network Manager"},
{0x05,"Network Manager Options"},
{0x06,"QoS Configuration"},
{0x09,"Set RTCP Source Description Item"},
{0x0b,"Download Server Information"},
{0x0c,"Server Switch"},
{0x0d,"Query Network Configuration Element"},
{0x0e,"Download Software Upgrade"},
{0x0f,"Set RTCP Report Interval"},
{0x10,"Set Primary Server"},
{0x12,"Reset Watchdog"},
{0x13,"Set Recovery Procedure Time Interval"},
{0x14,"Transport Reliability Layer Parameters Download"},
{0xff,"Reserved"},
{0,NULL}
};
static const value_string network_phone_msgs[]={
{0x00,"Soft Reset Ack"},
{0x01,"Sanity OK"},
{0x02,"Network Manager Attributes Info"},
{0x03,"Network Manager Diagnostic Info"},
{0x04,"Manager IDs"},
{0x05,"Network Manager Options Report"},
{0x08,"Resume Connection with Server"},
{0x09,"Suspend Connection with Server"},
{0x0b,"Network Configuration Element Report"},
{0x0c,"Server Information Report"},
{0xff,"Reserved"},
{0,NULL}
};
static const value_string network_server_id[]={
{0x00,"First Server"},
{0x01,"Second Server"},
{0x02,"Third Server"},
{0x03,"Fourth Server"},
{0x04,"Fifth Server"},
{0x05,"Sixth Server"},
{0x06,"Seventh Server"},
{0x07,"Eighth Server"},
{0x08,"Ninth Server"},
{0x09,"Tenth Server"},
{0,NULL}
};
static const value_string server_action[]={
{0x00,"Reserved"},
{0x01,"Establish UNISTIM Connection with Server"},
{0,NULL}
};
static const value_string network_elements[]={
{0x00,"IT IP Address"},
{0x01,"IT Netmask"},
{0x02,"Default Gateway IP Address"},
{0x03,"First Server IP Address"},
{0x04,"First Server Port Number"},
{0x05,"Second Server IP Address"},
{0x06,"Second Server Port Number"},
{0x07,"First Server Action"},
{0x08,"First Server Retry Count"},
{0x09,"Boot Mode"},
{0x0b,"Second Server Action"},
{0x0c,"Second Server Retry Count"},
{0x0e,"8-byte User PIN"},
{0,NULL}
};
#endif |
C | wireshark/plugins/epan/unistim/packet-unistim.c | /* packet-unistim.c
* Routines for unistim packet dissection
* Copyright 2007 Don Newton <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <string.h>
#include <epan/packet.h>
#include <epan/tap.h>
#include <epan/expert.h>
#include <epan/dissectors/packet-rtp.h>
#include <epan/dissectors/packet-rtcp.h>
#include "packet-unistim.h"
#include "defines.h"
#include "audio.h"
#include "basic.h"
#include "display.h"
#include "network.h"
#include "key.h"
#include "broadcast.h"
#include "uftp.h"
#include "expansion.h"
void proto_register_unistim(void);
static dissector_handle_t unistim_handle;
static unistim_info_t *uinfo;
static int unistim_tap = -1;
void proto_reg_handoff_unistim(void);
static void dissect_payload(proto_tree *unistim_tree,tvbuff_t *tvb,gint offset, packet_info *pinfo);
static gint dissect_broadcast_switch(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_expansion_switch(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_display_switch(proto_tree *msg_tree, packet_info *pinfo,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_key_indicator_switch(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_basic_switch(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_network_switch(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_broadcast_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_audio_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_expansion_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_display_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_key_indicator_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_basic_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_network_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len);
static gint dissect_unistim_message(proto_tree *unistim_tree, packet_info *pinfo,
tvbuff_t *tvb,gint offset);
static gint dissect_uftp_message(proto_tree *unistim_tree, packet_info *pinfo,
tvbuff_t *tvb,gint offset);
static int proto_unistim = -1;
static int hf_unistim_seq_nu = -1;
static int hf_unistim_packet_type = -1;
static int hf_unistim_payload = -1;
static int hf_unistim_cmd_add = -1;
static int hf_unistim_len =-1;
static int hf_terminal_id=-1;
static int hf_basic_bit_field=-1;
static int hf_basic_switch_cmd=-1;
static int hf_basic_phone_cmd=-1;
static int hf_broadcast_switch_cmd=-1;
/* static int hf_broadcast_phone_cmd=-1; */
static int hf_audio_switch_cmd=-1;
static int hf_audio_phone_cmd=-1;
static int hf_display_switch_cmd=-1;
static int hf_display_phone_cmd=-1;
static int hf_key_switch_cmd=-1;
static int hf_key_phone_cmd=-1;
static int hf_network_switch_cmd=-1;
static int hf_network_phone_cmd=-1;
static int hf_expansion_switch_cmd=-1;
static int hf_expansion_phone_cmd=-1;
static int hf_module_key_number=-1;
static int hf_generic_data=-1;
static int hf_generic_string=-1;
static gint ett_unistim = -1;
static expert_field ei_unistim_len = EI_INIT;
static const value_string packet_names[]={
{0,"NAK"},
{1,"ACK"},
{2,"Payload"},
{0,NULL}
};
static const value_string payload_names[]={
{0x00,"NULL Protocol"},
{0x01,"Aggregate Unistim"},
{0x02,"Aggregate Unistim with Terminal ID"},
{0x03,"UFTP"},
{0xff,"Free Form Protocol"},
{0,NULL}
};
static const range_string sequence_numbers[]={
{0x00,0xFFFFFFFE,"Normal Sequence Number"},
{0xFFFFFFFF,0xFFFFFFFF, "RESET Sequence Number"},
{0,0,NULL}
};
static const value_string command_address[]={
{0x09,"Expansion Module-1 Manager Switch"},
{0x0A,"Expansion Module-2 Manager Switch"},
{0x0B,"Expansion Module-3 Manager Switch"},
{0x0C,"Expansion Module-4 Manager Switch"},
{0x0D,"Expansion Module-5 Manager Switch"},
{0x0E,"Expansion Module-6 Manager Switch"},
{0x10,"Expansion Module Manager Phone"},
{0x11,"Broadcast Manager Switch"},
{0x16,"Audio Manager Switch"},
{0x17,"Display Manager Switch"},
{0x19,"Key/Indicator Manager Switch"},
{0x1a,"Basic Manager Switch"},
{0x1e,"Network Manager Switch"},
{0x89,"Expansion Module-1 Manager Phone"},
{0x8A,"Expansion Module-2 Manager Phone"},
{0x8B,"Expansion Module-3 Manager Phone"},
{0x8C,"Expansion Module-4 Manager Phone"},
{0x8D,"Expansion Module-5 Manager Phone"},
{0x8E,"Expansion Module-6 Manager Phone"},
{0x91,"Broadcast Manager Phone"},
{0x96,"Audio Manager Phone"},
{0x97,"Display Manager Phone"},
{0x99,"Key/Indicator Manager Phone"},
{0x9a,"Basic Manager Phone"},
{0x9e,"Network Manager Phone"},
{0,NULL}
};
static int
dissect_unistim(tvbuff_t *tvb,packet_info *pinfo,proto_tree *tree,void *data _U_){
gint offset=0;
proto_item *ti= NULL;
proto_tree *overall_unistim_tree = NULL;
proto_tree *rudpm_tree=NULL;
/* heuristic*/
switch(tvb_get_guint8(tvb,offset+4)) {/*rudp packet type 0,1,2 only */
case 0x0:/*NAK*/
case 0x1:/*ACK*/
break;
case 0x2:/*PAYLOAD*/
switch(tvb_get_guint8(tvb,offset+5)){/*payload type 0,1,2,3,ff only */
case 0x0: /*NULL*/
case 0x1: /*UNISTIM*/
case 0x2: /*UNISTIM WITH TERM ID*/
case 0x3: /*UFTP*/
case 0xff:/*UNKNOWN BUT VALID*/
break;
default:
return 0;
}
break;
default:
return 0;
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "UNISTIM");
/* Clear out stuff in the info column */
col_clear(pinfo->cinfo, COL_INFO);
ti = proto_tree_add_item(tree,proto_unistim,tvb,offset,-1,ENC_NA);
overall_unistim_tree = proto_item_add_subtree(ti,ett_unistim);
rudpm_tree=proto_tree_add_subtree(overall_unistim_tree,tvb,offset,5,ett_unistim,NULL,"Reliable UDP");
proto_tree_add_item(rudpm_tree,hf_unistim_seq_nu,tvb,offset,4,ENC_BIG_ENDIAN);
/* Allocate new mem for queueing */
uinfo = wmem_new(pinfo->pool, unistim_info_t);
/* Clear tap struct */
uinfo->rudp_type = 0;
uinfo->payload_type = 0;
uinfo->sequence = tvb_get_ntohl(tvb,offset);
uinfo->termid = 0;
uinfo->key_val = -1;
uinfo->key_state = -1;
uinfo->hook_state = -1;
uinfo->stream_connect = -1;
uinfo->trans_connect = -1;
uinfo->set_termid = -1;
uinfo->string_data = NULL;
uinfo->key_buffer = NULL;
clear_address(&uinfo->it_ip);
clear_address(&uinfo->ni_ip);
uinfo->it_port = 0;
offset+=4;
proto_tree_add_item(rudpm_tree,hf_unistim_packet_type,tvb,offset,1,ENC_BIG_ENDIAN);
uinfo->rudp_type = tvb_get_guint8(tvb,offset);
switch(tvb_get_guint8(tvb,offset)) {
case 0x00:
/*NAK*/
col_add_fstr(pinfo->cinfo, COL_INFO, "NAK for seq - 0x%X",
tvb_get_ntohl(tvb, offset-4));
break;
case 0x01:
/*ACK*/
col_add_fstr(pinfo->cinfo, COL_INFO, "ACK for seq - 0x%X",
tvb_get_ntohl(tvb, offset-4));
break;
case 0x02:
col_add_fstr(pinfo->cinfo, COL_INFO, "Payload seq - 0x%X",
tvb_get_ntohl(tvb, offset-4));
offset+=1;
dissect_payload(overall_unistim_tree,tvb,offset,pinfo);
break;
default:
return 0;
break;
}
/* Queue packet for tap */
tap_queue_packet(unistim_tap, pinfo, uinfo);
return tvb_captured_length(tvb);
}
static void
dissect_payload(proto_tree *overall_unistim_tree,tvbuff_t *tvb, gint offset, packet_info *pinfo){
proto_item *ti;
proto_tree *unistim_tree;
guint payload_proto=tvb_get_guint8(tvb,offset);
/* Payload type for tap */
uinfo->payload_type = payload_proto;
ti=proto_tree_add_item(overall_unistim_tree,hf_unistim_payload,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
unistim_tree=proto_item_add_subtree(ti,ett_unistim);
switch(payload_proto){
case 0x00:
/*NULL PROTO - NOTHING LEFT TO DO*/
return;
case 0x01:
/*UNISTIM only so no term id but further payload work*/
/* Collect info for tap */
/* If no term id then packet sourced from NI */
copy_address(&(uinfo->ni_ip), &(pinfo->src));
copy_address(&(uinfo->it_ip), &(pinfo->dst));
uinfo->it_port = pinfo->destport;
break;
case 0x02:
/*UNISTIM with term id*/
/* Termid packs are always sourced from the it, so collect relevant infos */
copy_address(&(uinfo->ni_ip),&(pinfo->dst));
copy_address(&(uinfo->it_ip),&(pinfo->src));
uinfo->it_port = pinfo->srcport;
uinfo->termid = tvb_get_ntohl(tvb,offset);
proto_tree_add_item(unistim_tree,hf_terminal_id,tvb,offset,4,ENC_BIG_ENDIAN);
offset+=4;
break;
case 0x03:
/* UFTP */
offset = dissect_uftp_message(unistim_tree,pinfo,tvb,offset);
break;
case 0xff:
/*TODO flesh this out probably only for init*/
break;
}
/* Handle UFTP seperately because it is significantly different
than standard UNISTIM */
while (tvb_reported_length_remaining(tvb, offset) > 0)
offset = dissect_unistim_message(unistim_tree,pinfo,tvb,offset);
}
static gint
dissect_uftp_message(proto_tree *unistim_tree,packet_info *pinfo _U_,tvbuff_t *tvb,gint offset){
guint command;
guint str_len;
guint dat_len;
proto_tree *msg_tree;
msg_tree = proto_tree_add_subtree(unistim_tree,tvb,offset,-1,ett_unistim,NULL,"UFTP CMD");
command=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_uftp_command,tvb,offset,1,ENC_BIG_ENDIAN);
offset += 1;
switch(command)
{
case 0x80:
/* Connection request */
/* Nothing to do */
break;
case 0x81:
/* Connection Details */
/* Get datablock size */
proto_tree_add_item(msg_tree,hf_uftp_datablock_size,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;
/* Get datablock limit b4 flow control */
proto_tree_add_item(msg_tree,hf_uftp_datablock_limit,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
/* Get filename */
str_len = tvb_reported_length_remaining(tvb, offset);
proto_tree_add_item(msg_tree,hf_uftp_filename,tvb,offset,str_len,ENC_ASCII|ENC_NA);
offset += str_len;
break;
case 0x82:
/* Flow Control off */
/* Nothing to do */
break;
case 0x00:
/* Connection Granted */
/* Nothing to do */
break;
case 0x01:
/* Connection Denied */
/* Nothing to do */
break;
case 0x02:
/* File Data Block */
/* Raw Data.. */
dat_len = tvb_reported_length_remaining(tvb, offset);
proto_tree_add_item(msg_tree,hf_uftp_datablock,tvb,offset,dat_len,ENC_NA);
offset += dat_len;
break;
}
return offset;
}
static gint
dissect_unistim_message(proto_tree *unistim_tree,packet_info *pinfo,tvbuff_t *tvb,gint offset){
guint addr;
guint msg_len;
proto_item *ti;
proto_tree *msg_tree;
msg_tree = proto_tree_add_subtree(unistim_tree,tvb,offset,-1,ett_unistim,&ti,"Unistim CMD");
addr=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_unistim_cmd_add,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
msg_len=tvb_get_guint8(tvb,offset);
if (msg_len<=2)
{
ti=proto_tree_add_item(msg_tree,hf_unistim_len,tvb,offset,1,ENC_BIG_ENDIAN);
expert_add_info(pinfo,ti,&ei_unistim_len);
return tvb_reported_length(tvb);
} else {
proto_item_set_len(ti,msg_len);
proto_tree_add_item(msg_tree,hf_unistim_len,tvb,offset,1,ENC_BIG_ENDIAN);
}
offset+=1;
/*from switch*/
switch(addr){
case 0x00:
/*Nothing*/
break;
/*Expansion Manager Switch*/
case 0x09:
case 0x0A:
case 0x0B:
case 0x0C:
case 0x0D:
case 0x0E:
offset = dissect_expansion_switch(msg_tree,tvb,offset,msg_len-2);
break;
case 0x11:
/*Broadcast Manager Switch*/
offset = dissect_broadcast_switch(msg_tree,tvb,offset,msg_len-2);
break;
case 0x16:
/*Audio Manager Switch*/
offset = dissect_audio_switch(msg_tree,pinfo,tvb,offset,msg_len-2);
break;
case 0x17:
/*Display Manager Switch*/
offset = dissect_display_switch(msg_tree,pinfo,tvb,offset,msg_len-2);
break;
case 0x19:
/*Key Indicator Manager Switch*/
offset = dissect_key_indicator_switch(msg_tree,tvb,offset,msg_len-2);
break;
case 0x1a:
/*Basic Manager Switch*/
offset = dissect_basic_switch(msg_tree,tvb,offset,msg_len-2);
break;
case 0x1e:
/*Network Manager Switch*/
offset = dissect_network_switch(msg_tree,tvb,offset,msg_len-2);
break;
case 0x89:
case 0x8A:
case 0x8B:
case 0x8C:
case 0x8D:
case 0x8E:
/*Expansion Manager Phone*/
offset = dissect_expansion_phone(msg_tree,tvb,offset,msg_len-2);
break;
case 0x91:
/*Broadcast Manager phone*/
offset = dissect_broadcast_phone(msg_tree,tvb,offset,msg_len-2);
break;
case 0x96:
/*Audio Manager phone*/
offset = dissect_audio_phone(msg_tree,tvb,offset,msg_len-2);
break;
case 0x97:
/*Display Manager phone*/
offset = dissect_display_phone(msg_tree,tvb,offset,msg_len-2);
break;
case 0x99:
/*Key/Indicator Manager phone*/
offset = dissect_key_indicator_phone(msg_tree,tvb,offset,msg_len-2);
break;
case 0x9a:
/*Basic Manager phone*/
offset = dissect_basic_phone(msg_tree,tvb,offset,msg_len-2);
break;
case 0x9e:
/*Network Manager Switch*/
offset = dissect_network_phone(msg_tree,tvb,offset,msg_len-2);
break;
default:
/*See some undocumented messages. Don't want to miss the ones we understand*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len-2,ENC_NA);
offset+=(msg_len-2);
}
if(msg_len){
/* TODO: add Expert info to indicate there is unknown data !
For the moment, this code only remove Clang Warnings about not used msg_len... */
}
return offset;
}
/*DONE*/
static gint
dissect_basic_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset, guint msg_len){
guint basic_cmd;
basic_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_basic_phone_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
switch(basic_cmd){
case 0x00:
/*Basic Manager Attributes Info*/
proto_tree_add_item(msg_tree,hf_basic_phone_eeprom_stat_cksum,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_basic_phone_eeprom_dynam,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_basic_phone_eeprom_net_config_cksum,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x01:
/*Basic Manager Options Report*/
proto_tree_add_item(msg_tree,hf_basic_switch_options_secure,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x02:
/*Firmware Version*/
proto_tree_add_item(msg_tree,hf_basic_phone_fw_ver,
tvb,offset,msg_len,ENC_ASCII|ENC_NA);
offset+=msg_len;
break;
case 0x03:
/*IT Type*/
proto_tree_add_item(msg_tree,hf_basic_it_type,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x07:
/*Hardware ID*/
proto_tree_add_item(msg_tree,hf_basic_phone_hw_id,
tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x08:
/*Product Engineering Code*/
proto_tree_add_item(msg_tree,hf_basic_prod_eng_code,
tvb,offset,msg_len,ENC_ASCII|ENC_NA);
offset+=msg_len;
break;
case 0x09:
/*Grey Market Info*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x0a:
/*Encapsulate Command*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x11:
/*Phone Ethernet address*/
proto_tree_add_item(msg_tree,hf_basic_ether_address,
tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x0b:
/*not in pdf but get them*/
proto_tree_add_item(msg_tree,hf_generic_string,tvb,offset,msg_len,ENC_ASCII|ENC_NA);
offset+=msg_len;
break;
case 0xff:
/*Reserved*/
break;
default:
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
}
if(msg_len){
/* TODO: add Expert info to indicate there is unknown data !
For the moment, this code only remove Clang Warnings about not used msg_len... */
}
return offset;
}
/*DONE*/
static gint
dissect_basic_switch(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len){
guint basic_cmd;
basic_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_basic_switch_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
switch(basic_cmd){
case 0x01:
/*Query Basic Manager*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_basic_switch_query_attr,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_basic_switch_query_opts,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_basic_switch_query_fw,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_basic_switch_query_hw_id,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_basic_switch_query_it_type,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_basic_switch_query_prod_eng_code,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_basic_switch_query_gray_mkt_info,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x02:
/*Basic Manager Options*/
proto_tree_add_item(msg_tree,hf_basic_switch_options_secure,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x06:
/*EEprom Write*/
proto_tree_add_item(msg_tree,hf_basic_switch_element_id,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_basic_switch_eeprom_data,
tvb,offset,msg_len,ENC_NA);
offset+=1;
break;
case 0x07:
/*Assign Terminal ID*/
/* Set tap info */
uinfo->set_termid = 1;
proto_tree_add_item(msg_tree,hf_basic_switch_terminal_id,
tvb,offset,msg_len,ENC_BIG_ENDIAN);
offset+=msg_len;
break;
case 0x08:
/*Encapsulate Command*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x0f:
/*showing up in captures but not in pdf*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
case 0xff:
/*Reserved*/
break;
default:
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
}
if(msg_len){
/* TODO: add Expert info to indicate there is unknown data !
For the moment, this code only remove Clang Warnings about not used msg_len... */
}
return offset;
}
/*DONE*/
static gint
dissect_broadcast_switch(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset, guint msg_len){
guint bcast_cmd;
guint year,month,day,hour,minute,second;
proto_tree *date_tree;
proto_tree *time_tree;
bcast_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_broadcast_switch_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
switch(bcast_cmd){
case 0x00:
/*Accessory Sync Update - len=3 */
break;
case 0x01:
/*Logical Icon Update*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_broadcast_icon_state,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x02:
/*Time and Date Download*/
year=tvb_get_guint8(tvb,offset);
month=tvb_get_guint8(tvb,offset+1);
day=tvb_get_guint8(tvb,offset+2);
hour=tvb_get_guint8(tvb,offset+3);
minute=tvb_get_guint8(tvb,offset+4);
second=tvb_get_guint8(tvb,offset+5);
date_tree=proto_tree_add_subtree_format(msg_tree,tvb,offset,3,ett_unistim,NULL,
"Date %i/%i/%i",month,day,year%100);
proto_tree_add_item(date_tree,hf_broadcast_year,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(date_tree,hf_broadcast_month,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(date_tree,hf_broadcast_day,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
time_tree=proto_tree_add_subtree_format(msg_tree,tvb,offset,3,ett_unistim,NULL,
"Time %i:%i:%i",hour,minute,second);
proto_tree_add_item(time_tree,hf_broadcast_hour,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(time_tree,hf_broadcast_minute,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(time_tree,hf_broadcast_second,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x03:
/*Set Default Character Table Config */
/* UGLY may work may not*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0xff:
/*Reserved*/
break;
default:
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
}
if(msg_len){
/* TODO: add Expert info to indicate there is unknown data !
For the moment, this code only remove Clang Warnings about not used msg_len... */
}
return offset;
}
/*DONE Haven't seen any phone broadcasts, wouldn't expect to*/
static gint
dissect_broadcast_phone(proto_tree *msg_tree,
tvbuff_t *tvb, gint offset,guint msg_len){
proto_tree_add_item(msg_tree,hf_generic_data, tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
return offset;
}
/*DONE*/
static gint
dissect_display_switch(proto_tree *msg_tree, packet_info *pinfo,
tvbuff_t *tvb, gint offset,guint msg_len){
guint clear_mask;
guint highlight_cmd;
guint time_date_mask;
guint display_cmd;
guint address_byte;
guint movement_byte;
proto_tree *address_tree;
display_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_display_switch_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
switch(display_cmd){
case 0x01:
/*Restore Default Character Table Configuration length = 3*/
break;
case 0x04:
/*Arrow*/
proto_tree_add_item(msg_tree,hf_display_arrow,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x05:
/*Query Status Bar Icon*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x06:
/*Highlight Off length = 3*/
break;
case 0x07:
/*Highlight On length = 3*/
break;
case 0x09:
/*Restore Time and Date length = 3*/
break;
case 0x0a:
/*Clear Time and Date length = 3*/
break;
case 0x0b:
/*Call Duration Timer*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_call_timer_mode,tvb,offset,
1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_call_timer_reset,tvb,offset,
1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_call_timer_display,tvb,offset,
1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_call_timer_delay,tvb,offset,
1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_call_timer_id,tvb,offset,
1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x0c:
/*Query Display Manager*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x0d:
/*Download Call Duration Timer Delay*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x0e:
/*Disable Display Field*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x0f:
/*Clear Field*/
clear_mask=tvb_get_guint8(tvb,offset);
/*need to know which paths to take*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_numeric,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_context,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_date,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_time,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_line,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_softkey,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_softkey_label,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
if((clear_mask&DISPLAY_CLEAR_LINE)==DISPLAY_CLEAR_LINE){
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_line_1,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_line_2,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_line_3,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_line_4,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_line_5,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_line_6,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_line_7,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_line_8,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
if((clear_mask&DISPLAY_CLEAR_STATUS_BAR_ICON)==
DISPLAY_CLEAR_STATUS_BAR_ICON){
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_1,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_2,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_3,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_4,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_5,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_6,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_7,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_8,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
if((clear_mask&DISPLAY_CLEAR_SOFTKEY)==DISPLAY_CLEAR_SOFTKEY){
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_soft_key_1,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_soft_key_2,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_soft_key_3,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_soft_key_4,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_soft_key_5,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_soft_key_6,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_soft_key_7,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_soft_key_8,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
if((clear_mask&DISPLAY_CLEAR_SOFTKEY_LABEL)==DISPLAY_CLEAR_SOFTKEY_LABEL){
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_sk_label_key_id,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_clear_all_slks,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
break;
case 0x10:
/*Cursor Control*/
movement_byte=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_move_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_blink,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
if(msg_len==0){
/*turn cursor off*/
break;
}
if((movement_byte&0x01)==0x01){
address_byte=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_write_address_numeric,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_write_address_context,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_write_address_line,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_write_address_soft_key,
tvb,offset,1,ENC_BIG_ENDIAN);
if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)==
DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)
proto_tree_add_item(msg_tree,
hf_display_write_address_softkey_id,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
if(msg_len==0){
/*turn cursor off*/
break;
}
}
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_write_address_char_pos,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_write_address_line_number,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x12:
/*Display Scroll with Data (before)*/
proto_tree_add_item(msg_tree,hf_generic_string,tvb,offset,msg_len,ENC_ASCII|ENC_NA);
offset+=msg_len;
break;
case 0x13:
/*Display Scroll with Data (after)*/
proto_tree_add_item(msg_tree,hf_generic_string,tvb,offset,msg_len,ENC_ASCII|ENC_NA);
offset+=msg_len;
break;
case 0x14:
/*Status Bar Icon Update*/
proto_tree_add_item(msg_tree,hf_basic_bit_field, tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_icon_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_basic_bit_field, tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_broadcast_icon_state,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x15:
/*Month Labels Download*/
proto_tree_add_item(msg_tree,hf_generic_string,tvb,offset,msg_len,ENC_ASCII|ENC_NA);
offset+=msg_len;
break;
case 0x16:
/*Call Duration Timer Label Download*/
proto_tree_add_item(msg_tree,hf_generic_string,tvb,offset,msg_len,ENC_ASCII|ENC_NA);
offset+=1;msg_len-=1;
break;
case 0x17:
/*Time and Date Format*/
time_date_mask=tvb_get_guint8(tvb,offset);
if((time_date_mask&DISPLAY_USE_TIME_FORMAT)==DISPLAY_USE_TIME_FORMAT){
proto_tree_add_item(msg_tree,hf_display_time_format,tvb,offset,1,ENC_BIG_ENDIAN);
}
if((time_date_mask&DISPLAY_USE_DATE_FORMAT)==DISPLAY_USE_DATE_FORMAT){
proto_tree_add_item(msg_tree,hf_display_date_format,tvb,offset,1,ENC_BIG_ENDIAN);
}
proto_tree_add_item(msg_tree,hf_display_use_time_format,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_use_date_format,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
/*Address, control, tag: treat as bitmask to reduce code duplication*/
case 0x18: /*address|no control|no tag|no*/
case 0x19: /*address|yes control|no tag|no*/
case 0x1A: /*address|no control|yes tag|no*/
case 0x1B: /*address|yes control|yes tag|no*/
case 0x1C: /*address|no control|no tag|yes*/
case 0x1D: /*address|yes control|no tag|yes*/
case 0x1E: /*address|no control|yes tag|yes*/
case 0x1F: /*address|yes control|yes tag|yes*/
#define F_ADDR 1
#define F_CTRL 2
#define F_TAG 4
if((display_cmd&F_ADDR)==F_ADDR){
address_tree=proto_tree_add_subtree(msg_tree,tvb,offset,0,ett_unistim,NULL,"Address Data");
address_byte=tvb_get_guint8(tvb,offset);
proto_tree_add_item(address_tree,hf_basic_bit_field,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(address_tree,hf_display_write_address_numeric,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(address_tree,hf_display_write_address_context,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(address_tree,hf_display_write_address_line,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(address_tree,hf_display_write_address_soft_key,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(address_tree,hf_display_write_address_soft_label,
tvb,offset,1,ENC_BIG_ENDIAN);
if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)==
DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG){
proto_tree_add_item(address_tree,
hf_display_write_address_softkey_id,
tvb,offset,1,ENC_BIG_ENDIAN);
}
offset+=1;msg_len-=1;
if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)==
DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG){
proto_tree_add_item(address_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(address_tree,
hf_display_write_address_char_pos,
tvb,offset,1,ENC_BIG_ENDIAN);
if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)!=
DISPLAY_WRITE_ADDRESS_LINE_FLAG){
offset+=1;msg_len-=1;
}
}
if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)==
DISPLAY_WRITE_ADDRESS_LINE_FLAG){
proto_tree_add_item(address_tree,
hf_display_write_address_char_pos,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(address_tree,
hf_display_write_address_line_number,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
}
if((display_cmd&F_CTRL)==F_CTRL){
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_write_cursor_move,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_write_clear_left,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_write_clear_right,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_write_shift_left,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_write_shift_right,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_write_highlight,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
if((display_cmd&F_TAG)==F_TAG){
proto_tree_add_item(msg_tree,hf_display_write_tag,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
/* whatever's left is the message */
if(msg_len>0){
/* I'm guessing this will work flakily at best */
proto_tree_add_item_ret_string(msg_tree,hf_generic_string,tvb,offset,msg_len, ENC_ASCII|ENC_NA, pinfo->pool, &uinfo->string_data);
offset+=msg_len;
}
break;
#undef F_ADDR
#undef F_CTRL
#undef F_TAG
case 0x20:
/*Context Info Bar Format*/
while(msg_len>0){
proto_tree_add_item(msg_tree,hf_display_context_format,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_context_field,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
break;
case 0x21:
/*Set Default Character Table Configuration VERY UGLY*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x22:
/*Special Character Download*/
proto_tree_add_item(msg_tree,hf_display_char_address,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x23:
/*Highlighted Field Definition*/
highlight_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_display_cursor_numeric,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_context ,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_line,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_softkey,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_softkey_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;proto_tree_add_item(msg_tree,hf_display_hlight_start,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_hlight_end,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
if(msg_len==0)
break;
if((highlight_cmd&DISPLAY_CURSOR_LINE)==DISPLAY_CURSOR_LINE){
proto_tree_add_item(msg_tree,hf_display_cursor_char_pos,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_line_number,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x24:
/*Contrast*/
proto_tree_add_item(msg_tree,hf_display_contrast,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x25:
/*Caller Log Download*/
proto_tree_add_item(msg_tree,hf_broadcast_hour,tvb,offset,msg_len,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_broadcast_minute,tvb,offset,msg_len,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x30:
/*Layered Softkey Text Download*/
proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_layer_number,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_generic_string,tvb,offset,msg_len,ENC_ASCII|ENC_NA);
offset+=msg_len;
break;
case 0x31:
/*Layered Softkey Clear*/
proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_layer_all_skeys,tvb,offset,msg_len,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_layer_number,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x32:
/*Set Visible Softkey Layer*/
proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_layer_all_skeys,tvb,offset,msg_len,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_layer_number,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x33:
/*Layered Softkey Cadence Download*/
proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_once_or_cyclic,tvb,offset,msg_len,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
while(msg_len>0){
proto_tree_add_item(msg_tree,hf_display_layer_number,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_layer_duration,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
break;
case 0x34:
/*Layered Softkey Cadencing On*/
proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x35:
/*Layered Softkey Cadencing Off*/
proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0xff:
/*Reserved*/
break;
default:
proto_tree_add_item(msg_tree,hf_generic_data,
tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
}
if(msg_len){
/* TODO: add Expert info to indicate there is unknown data !
For the moment, this code only remove Clang Warnings about not used msg_len... */
}
return offset;
}
/*DONE*/
static gint
dissect_display_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len){
guint display_cmd;
guint highlight_cmd;
display_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_display_phone_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
switch(display_cmd){
case 0x00:
/*Display Manager Attributes Info*/
proto_tree_add_item(msg_tree,hf_display_line_width,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_lines,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_softkey_width,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_softkeys,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_icon,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_softlabel_key_width,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_context_width,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_numeric_width,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_time_width,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_date_width,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_char_dload,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_freeform_icon_dload,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_icon_type,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_charsets,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x01:
/*Contrast Level Report*/
proto_tree_add_item(msg_tree,hf_display_contrast,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x02:
/*Cursor Location Report*/
proto_tree_add_item(msg_tree,hf_display_cursor_numeric,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_context ,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_line,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_softkey,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_softkey_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_cursor_char_pos,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_line_number,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x03:
/*Highlight Status On*/
highlight_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_display_cursor_numeric,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_context ,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_line,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_softkey,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_softkey_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;proto_tree_add_item(msg_tree,hf_display_hlight_start,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_display_hlight_end,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
if((highlight_cmd&DISPLAY_CURSOR_LINE)==DISPLAY_CURSOR_LINE){
proto_tree_add_item(msg_tree,hf_display_cursor_char_pos,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_cursor_line_number,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
break;
case 0x04:
/*Current Character Table Configuration Status VERY UGLY*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x05:
/*Default Character Table Configuration Status VERY UGLY*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x06:
/*Timer And Date Format Report*/
proto_tree_add_item(msg_tree,hf_display_time_format,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_display_date_format,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x07:
/*Status Bar Icon State Report*/
proto_tree_add_item(msg_tree,hf_icon_id,tvb,offset,msg_len,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_broadcast_icon_state,tvb,offset,msg_len,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,tvb,offset,msg_len,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x0a:
/*Highlight Status Off length = 3*/
break;
case 0xff:
/*Reserved*/
break;
default:
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
}
if(msg_len){
/* TODO: add Expert info to indicate there is unknown data !
For the moment, this code only remove Clang Warnings about not used msg_len... */
}
return offset;
}
static gint
dissect_key_indicator_switch(proto_tree *msg_tree,
tvbuff_t *tvb, gint offset,guint msg_len){
guint key_cmd;
key_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_key_switch_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
switch(key_cmd){
case 0x00:
/*LED Update*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_key_led_cadence,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_key_led_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x01:
/*Query Hookswitch length = 3 */
break;
case 0x02:
/*User Activity Timer Stop length = 3*/
break;
case 0x03:
/*User Activity Timer Start length = 3*/
break;
case 0x04:
/*Downloadable Free Form Icon Access (Hardcoded) length of 3*/
break;
case 0x05:
/*Downloadable Free Form Icon Access (Downloadable) length of 3*/
break;
case 0x06:
/*Query Key/Indicator Manager*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x07:
/*Key/Indicator Manager Options*/
proto_tree_add_item(msg_tree,hf_keys_send_key_rel,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_enable_vol,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_conspic_prog_key,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_acd_super_control,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_local_dial_feedback,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x08:
/*Logical Icon Mapping*/
proto_tree_add_item(msg_tree,hf_key_icon_id,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_admin_command,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_keys_logical_icon_id,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
break;
case 0x09:
/*Key Repeat Timer Download*/
proto_tree_add_item(msg_tree,hf_keys_repeat_timer_one,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_keys_repeat_timer_two,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x0a:
/*Query LED State*/
proto_tree_add_item(msg_tree,hf_keys_led_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x0b:
/*Query Phone Icon State*/
proto_tree_add_item(msg_tree,hf_keys_phone_icon_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x0c:
/*Indicator Cadence Download*/
while(msg_len>0){
proto_tree_add_item(msg_tree,hf_keys_cadence_on_time,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_keys_cadence_off_time,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
break;
case 0x0d:
/*User Activity Timer Download*/
proto_tree_add_item(msg_tree,hf_keys_user_activity_timeout,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x0e:
/*Free Form Icon Download*/
proto_tree_add_item(msg_tree,hf_key_icon_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x0f:
/*Phone Icon Update*/
proto_tree_add_item(msg_tree,hf_key_icon_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_broadcast_icon_state,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0xff:
/*Reserved*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
default:
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
}
if(msg_len){
/* TODO: add Expert info to indicate there is unknown data !
For the moment, this code only remove Clang Warnings about not used msg_len... */
}
return offset;
}
/*DONE*/
static gint
dissect_key_indicator_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset, guint msg_len){
guint key_cmd;
key_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_key_phone_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
switch(key_cmd){
case 0x00:
/*Key Event*/
/* Set the tap info */
uinfo->key_state = tvb_get_guint8(tvb,offset);
uinfo->key_state >>= 6;
/* Extract the key code */
uinfo->key_val = (tvb_get_guint8(tvb,offset) & 0x3F);
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_key_code,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_key_command,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x01:
/*LED Status Report*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x03:
/*On Hook length = 3*/
/* Set tap info.. */
uinfo->hook_state = 0;
break;
case 0x04:
/*Off Hook length = 3*/
/* Set tap info.. */
uinfo->hook_state = 1;
break;
case 0x05:
/*User Activity Timer Expired length = 3*/
break;
case 0x06:
/*Hookswitch State (on hook) length = 3*/
break;
case 0x07:
/*Hookswitch State (off hook) length = 3*/
break;
case 0x08:
/*Key/Indicator Manager Attributes Info*/
proto_tree_add_item(msg_tree,hf_key_programmable_keys,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_soft_keys,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_keys_hd_key,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_mute_key,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_quit_key,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_copy_key,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_mwi_key,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_keys_num_nav_keys,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_num_conspic_keys,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x09:
/*Key/Indicator Manager Options Report*/
proto_tree_add_item(msg_tree,hf_keys_send_key_rel,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_enable_vol,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_conspic_prog_key,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_acd_super_control,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_keys_local_dial_feedback,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x0a:
/*Phone Icon Status Report*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0xff:
/*Reserved*/
break;
default:
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
}
if(msg_len){
/* TODO: add Expert info to indicate there is unknown data !
For the moment, this code only remove Clang Warnings about not used msg_len... */
}
return offset;
}
/*Done*/
static gint
dissect_network_switch(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset, guint msg_len){
guint network_cmd;
guint string_len;
network_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_network_switch_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
switch(network_cmd){
case 0x02:
/*Soft Reset done*/
break;
case 0x03:
/*Hard Reset done*/
break;
case 0x04:
/*Query Network Manager*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_diag_flag,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_managers_flag,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_attributes_flag,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_serv_info_flag,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_options_flag,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_sanity_flag,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x05:
/*Network Manager Options*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_enable_diag,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_enable_rudp,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x06:
/*QoS Configuration*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x09:
/*Set RTCP Source Description Item*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x0b:
/*Download Server Information*/
proto_tree_add_item(msg_tree,hf_net_server_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_net_server_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;
proto_tree_add_item(msg_tree,hf_net_server_action,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_net_server_retry_count,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_net_server_failover_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_net_server_ip_address,tvb,offset,4,ENC_BIG_ENDIAN);
offset+=4;
break;
case 0x0c:
/*Server Switch*/
proto_tree_add_item(msg_tree,hf_net_server_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x0d:
/*Query Network Configuration Element*/
proto_tree_add_item(msg_tree,hf_net_server_config_element,
tvb,offset-1,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x0e:
/*Download Software Upgrade*/
proto_tree_add_item(msg_tree,hf_net_file_xfer_mode,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_force_download,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_use_file_server_port,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_use_local_port,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,1,ENC_NA);
offset+=1;msg_len-=1;
string_len=tvb_strsize(tvb,offset);
proto_tree_add_item(msg_tree,hf_net_full_pathname,tvb,offset,string_len,ENC_ASCII|ENC_NA);
offset+=string_len;msg_len-=string_len;
string_len=tvb_strsize(tvb,offset);
proto_tree_add_item(msg_tree,hf_net_file_identifier,tvb,offset,string_len,ENC_ASCII|ENC_NA);
offset+=string_len;msg_len-=string_len;
proto_tree_add_item(msg_tree,hf_net_file_server_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_net_local_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_net_file_server_address,tvb,offset,4,ENC_BIG_ENDIAN);
offset+=4;msg_len-=4;
break;
case 0x0f:
/*Set RTCP Report Interval*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x10:
/*Set Primary Server*/
proto_tree_add_item(msg_tree,hf_net_server_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x12:
/*Reset Watchdog*/
proto_tree_add_item(msg_tree,hf_net_server_time_out,
tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;
break;
case 0x13:
/*Set Recovery Procedure Time Interval*/
proto_tree_add_item(msg_tree,hf_net_server_recovery_time_low,
tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;
proto_tree_add_item(msg_tree,hf_net_server_recovery_time_high,
tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;
break;
case 0x14:
/*Transport Reliability Layer Parameters Download*/
proto_tree_add_item(msg_tree,hf_generic_data,
tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0xff:
/*Reserved*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
default:
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
}
if(msg_len){
/* TODO: add Expert info to indicate there is unknown data !
For the moment, this code only remove Clang Warnings about not used msg_len... */
}
return offset;
}
/*DONE*/
static gint
dissect_expansion_switch(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset, guint msg_len){
guint expansion_cmd;
expansion_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_expansion_switch_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1; msg_len-=1;
switch(expansion_cmd){
case 0x17:
break;
case 0x57:
/*skip a byte for now, not sure what it means*/
offset+=1;
msg_len-=1;
proto_tree_add_item(msg_tree,hf_expansion_softlabel_number,tvb,
offset,1,ENC_BIG_ENDIAN);
offset+=1;
msg_len-=1;
proto_tree_add_item(msg_tree,hf_generic_string,tvb,offset,msg_len,ENC_ASCII|ENC_NA);
break;
case 0x59:
/*skip a byte for now, not sure what it means*/
offset+=1;
msg_len-=1;
proto_tree_add_item(msg_tree,hf_expansion_softlabel_number,tvb,
offset,1,ENC_BIG_ENDIAN);
offset+=1;
msg_len-=1;
proto_tree_add_item(msg_tree,hf_basic_bit_field,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_broadcast_icon_state,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
msg_len-=1;
break;
}
offset+=msg_len;
return offset;
}
static gint
dissect_expansion_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset, guint msg_len){
guint expansion_cmd;
guint key_number;
expansion_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_expansion_phone_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1; msg_len-=1;
key_number=(tvb_get_guint8(tvb,offset))-64;
switch(expansion_cmd){
case 0x59:
proto_tree_add_int(msg_tree,hf_module_key_number,tvb,offset,1,key_number);
offset+=1;
msg_len-=1;
break;
}
offset+=msg_len;
return offset;
}
static gint
dissect_network_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset, guint msg_len){
guint network_cmd;
proto_tree *server_tree;
guint i;
network_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_network_phone_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
switch(network_cmd){
case 0x00:
/*Soft Reset Ack done length = 3*/
break;
case 0x01:
/*Sanity OK done length = 3*/
break;
case 0x02:
/*Network Manager Attributes Info*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x03:
/*Network Manager Diagnostic Info*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_phone_rx_ovr_flag,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_phone_tx_ovr_flag,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_phone_rx_empty_flag,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_phone_invalid_msg_flag,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_phone_eeprom_insane_flag,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_net_phone_eeprom_unsafe_flag,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x04:
/*Manager IDs*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x05:
/*Network Manager Options Report*/
proto_tree_add_boolean(msg_tree,hf_net_phone_diag,tvb,offset,1,FALSE);
proto_tree_add_item(msg_tree,hf_net_phone_rudp,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x08:
/*Resume Connection with Server done*/
break;
case 0x09:
/*Suspend Connection with Server done*/
break;
case 0x0b:
/*Network Configuration Element Report*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x0c:
/*Server Information Report*/
proto_tree_add_item(msg_tree,hf_net_phone_primary_server_id,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
for (i=1; msg_len>8; i++){
/*if less than 9 not full report so punt*/
/* guint16 port_num;
port_num=tvb_get_ntohs(tvb,offset);
if(port_num<1064)
break;
*/
server_tree=proto_tree_add_subtree_format(msg_tree,tvb,offset,9,
ett_unistim,NULL,"Server (S%d) Server ID: %X",i,i-1);
proto_tree_add_item(server_tree,
hf_net_phone_server_port,
tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(server_tree,
hf_net_phone_server_action,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(server_tree,
hf_net_phone_server_retry_count,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(server_tree,
hf_net_phone_server_failover_id,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(server_tree,hf_net_phone_server_ip,
tvb,offset,4,ENC_BIG_ENDIAN);
offset+=4;msg_len-=4;
}
break;
case 0xff:
/*Reserved*/
break;
default:
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
}
if(msg_len){
/* TODO: add Expert info to indicate there is unknown data !
For the moment, this code only remove Clang Warnings about not used msg_len... */
}
return offset;
}
/*DONE*/
static gint
dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo,
tvbuff_t *tvb,gint offset,guint msg_len){
proto_tree *param_tree;
guint audio_cmd;
guint apb_op_code;
guint apb_data_len;
guint vocoder_param;
audio_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_audio_switch_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
switch(audio_cmd){
case 0x00:
/*Query Audio Manager*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_attr,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_opts,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_alert,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_adj_rx_vol,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_def_rx_vol,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_handset,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_headset,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_audio_default_rx_vol_id,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x01:
/*Query Supervisor Headset Status*/
/*done*/
break;
case 0x02:
/*Audio Manager Options*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_opt_max_vol,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_opt_adj_vol,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_opt_aa_rx_vol_rpt,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_opt_hs_on_air,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_opt_hd_on_air,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_opt_noise_squelch,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x04:
/*Mute/Unmute*/
while(msg_len>0){
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_mute,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_tx_rx,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
break;
case 0x10:
/*Transducer Based Tone On*/
proto_tree_add_item(msg_tree,
hf_audio_mgr_transducer_based_tone_id,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_attenuated,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x11:
/*Transducer Based Tone Off*/
proto_tree_add_item(msg_tree,hf_audio_mgr_transducer_based_tone_id,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x12:
/*Alerting Tone Configuration*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_warbler_select,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_transducer_routing,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_tone_vol_range,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_cadence_select,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x13:
/*Special Tone Configuration*/
proto_tree_add_item(msg_tree,hf_audio_mgr_transducer_routing,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_audio_mgr_tone_vol_range,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_audio_special_tone,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x14:
/*Paging Tone Configuration*/
proto_tree_add_item(msg_tree,hf_audio_mgr_transducer_routing,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_audio_mgr_tone_vol_range,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_mgr_cadence_select,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x15:
/*Alerting Tone Cadence Download*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
/*TODO UGLY*/
case 0x17:
/*Paging Tone Cadence Download*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
/*TODO UGLY*/
case 0x18:
/*Transducer Based Tone Volume Level*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,
hf_audio_mgr_transducer_based_tone_id,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_tone_level,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x1a:
/*Visual Transducer Based Tone Enable*/
proto_tree_add_item(msg_tree,hf_audio_visual_tones,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x1b:
/*Stream Based Tone On*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_id,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_rx_tx,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_mute,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_audio_stream_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_audio_stream_based_volume,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x1c:
/*Stream Based Tone Off*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_id,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_rx_tx,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
proto_tree_add_item(msg_tree,hf_audio_stream_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x1d:
/*Stream Based Tone Frequency Component List Download*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x1e:
/*Stream Based Tone Cadence Download*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x20:
/*Select Adjustable Rx Volume*/
proto_tree_add_item(msg_tree,hf_audio_default_rx_vol_id,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x21:
/*Set APB's Rx Volume Level*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x22:
/*Change Adjustable Rx Volume (quieter) DONE*/
proto_tree_add_item(msg_tree,hf_generic_data,
tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x23:
/*Change Adjustable Rx Volume (louder) DONE*/
proto_tree_add_item(msg_tree,hf_generic_data,
tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x24:
/*Adjust Default Rx Volume(quieter)*/
proto_tree_add_item(msg_tree,hf_audio_default_rx_vol_id,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x25:
/*Adjust Default Rx Volume(louder)*/
proto_tree_add_item(msg_tree,hf_audio_default_rx_vol_id,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;
break;
case 0x28:
/*APB Download*/
proto_tree_add_item(msg_tree,hf_audio_apb_number,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
while(msg_len>0){
apb_op_code=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_audio_apb_op_code,tvb,
offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
if(apb_op_code>0x39){
/*should have a len + data*/
apb_data_len=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_audio_apb_param_len,tvb,
offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_apb_data,tvb,
offset,apb_data_len,ENC_NA);
offset+=apb_data_len;msg_len-=apb_data_len;
}
}
break;
case 0x30:
/*Open Audio Stream*/
/* Set the tap info */
uinfo->stream_connect = 1;
proto_tree_add_item(msg_tree,hf_audio_rx_stream_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_tx_stream_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_rx_vocoder_type,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_tx_vocoder_type,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_frames_per_packet,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_tos,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_precedence,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_frf_11,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_rtcp_bucket_id,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_generic_data,
tvb,offset,4,ENC_NA);
offset+=4;msg_len-=4;
proto_tree_add_item(msg_tree,hf_audio_lcl_rtp_port,
tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_lcl_rtcp_port,
tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_far_rtp_port,
tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_far_rtcp_port,
tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
/* Sometimes the open stream does not specify an endpoint */
/* In this circumstance the packet is truncated at the far end */
/* rtp port */
if(msg_len > 0){
proto_tree_add_item(msg_tree,hf_audio_far_ip_add,tvb,offset,4,ENC_BIG_ENDIAN);
offset+=4;msg_len-=4;
{
guint32 far_ip_addr;
address far_addr;
guint16 far_port;
far_ip_addr = tvb_get_ipv4(tvb, offset-4);
set_address(&far_addr, AT_IPv4, 4, &far_ip_addr);
far_port = tvb_get_ntohs(tvb, offset-8);
rtp_add_address(pinfo, PT_UDP, &far_addr, far_port, 0, "UNISTIM", pinfo->num, FALSE, NULL);
far_port = tvb_get_ntohs(tvb, offset-6);
rtcp_add_address(pinfo, &far_addr, far_port, 0, "UNISTIM", pinfo->num);
}
}
break;
case 0x31:
/*Close Audio Stream*/
/* Set the tap info */
uinfo->stream_connect = 0;
proto_tree_add_item(msg_tree,hf_audio_rx_stream_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_tx_stream_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x32:
/*Connect Transducer*/
/* Tap info again */
uinfo->trans_connect = 1;
proto_tree_add_item(msg_tree,hf_basic_bit_field, tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_transducer_pair,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_enable,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_tx_enable,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_basic_bit_field, tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_apb_number,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_sidetone_disable,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_destruct_additive,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_dont_force_active,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
while(msg_len>0){
proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,ENC_LITTLE_ENDIAN);
offset+=1;msg_len-=1;
}
break;
case 0x34:
/*Filter Block Download*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x37:
/*Query RTCP Statistics*/
proto_tree_add_item(msg_tree,hf_audio_rtcp_bucket_id,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_clear_bucket,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x38:
/*Configure Vocoder Parameters*/
proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,ENC_LITTLE_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_vocoder_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
while(msg_len>0){
param_tree=proto_tree_add_subtree(msg_tree,tvb,offset,0,ett_unistim,NULL,"Param");
vocoder_param=tvb_get_guint8(tvb,offset);
proto_tree_add_item(param_tree,hf_basic_bit_field,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(param_tree,hf_audio_vocoder_param,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(param_tree,hf_audio_vocoder_entity,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
if((vocoder_param&0x0a)==0x0a){
proto_tree_add_item(param_tree,hf_audio_vocoder_annexa,
tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(param_tree,hf_audio_vocoder_annexb,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
else if((vocoder_param&0x0b)==0x0b){
proto_tree_add_item(param_tree,hf_audio_sample_rate,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
else if((vocoder_param&0x0c)==0x0c){
proto_tree_add_item(param_tree,hf_audio_rtp_type,
tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
else if((vocoder_param&0x20)==0x20){
proto_tree_add_item(param_tree,hf_audio_bytes_per_frame,
tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
}
}
break;
case 0x39:
/*Query RTCP Bucket's SDES Information*/
proto_tree_add_item(msg_tree,hf_audio_source_descr,tvb,offset,msg_len,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_sdes_rtcp_bucket,tvb,offset,msg_len,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x3a:
/*Jitter Buffer Parameters Configuration*/
proto_tree_add_item(msg_tree,hf_audio_rx_stream_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_desired_jitter,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_high_water_mark,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_early_packet_resync_thresh,tvb,
offset,4,ENC_BIG_ENDIAN);
offset+=4;msg_len-=4;
proto_tree_add_item(msg_tree,hf_audio_late_packet_resync_thresh,tvb,
offset,4,ENC_BIG_ENDIAN);
offset+=4;msg_len-=4;
break;
case 0x3b:
/*Resolve Port Mapping*/
proto_tree_add_item(msg_tree,hf_audio_resolve_phone_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_far_end_echo_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_far_end_ip_address,tvb,offset,4,ENC_BIG_ENDIAN);
offset+=4;msg_len-=4;
break;
case 0x3c:
/*Port Mapping Discovery Ack*/
proto_tree_add_item(msg_tree,hf_audio_nat_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_nat_ip_address,tvb,offset,4,ENC_BIG_ENDIAN);
offset+=4;msg_len-=4;
break;
case 0x3d:
/*Query Audio Stream Status*/
proto_tree_add_item(msg_tree,hf_audio_direction_code,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0xff:
/*Reserved*/
default:
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
}
if(msg_len){
/* TODO: add Expert info to indicate there is unknown data !
For the moment, this code only remove Clang Warnings about not used msg_len... */
}
return offset;
}
/*DONE*/
static gint
dissect_audio_phone(proto_tree *msg_tree,
tvbuff_t *tvb,gint offset,guint msg_len){
guint audio_cmd;
guint apb_op_code;
guint apb_data_len;
guint stream_dir;
guint stream_state;
audio_cmd=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_audio_phone_cmd,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
switch(audio_cmd){
case 0x00:
/*Handset Connected length =3*/
/* Set the tap info */
uinfo->hook_state = 1;
break;
case 0x01:
/*Handset Disconnected length =3*/
/* Set the tap info */
uinfo->hook_state = 0;
break;
case 0x02:
/*Headset Connected length =3*/
/* Set the tap info */
uinfo->hook_state = 1;
break;
case 0x03:
/*Headset Disconnected length =3*/
/* Set the tap info */
uinfo->hook_state = 0;
break;
case 0x04:
/*Supervisor Headset Connected length =3*/
/* Set the tap info */
uinfo->hook_state = 1;
break;
case 0x05:
/*Supervisor Headset Disconnected length =3*/
/* Set the tap info */
uinfo->hook_state = 0;
break;
case 0x07:
/*Audio Manager Attributes Info*/
proto_tree_add_item(msg_tree,hf_audio_hf_support,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
while(msg_len>0){
proto_tree_add_item(msg_tree,hf_rx_vocoder_type,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
break;
case 0x08:
/*Audio Manager Options Report*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_opt_rpt_max,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_opt_rpt_adj_vol,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_opt_rpt_auto_adj_vol,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_opt_rpt_hs_on_air,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_opt_rpt_hd_on_air,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_opt_rpt_noise_squelch,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x09:
/*Adjustable Rx Volume Report*/
proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_vol_apb_rpt,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_up,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_floor,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_ceiling,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x0a:
/*Adjustable Rx Volume Information*/
proto_tree_add_item(msg_tree,hf_audio_current_adj_vol_id,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_vol_apb_rpt,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_up,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_floor,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_ceiling,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_current_rx_level,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_current_rx_range,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x0b:
/*APB's Default Rx Volume Value*/
proto_tree_add_item(msg_tree,hf_audio_current_adj_vol_id,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_vol_apb_rpt,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_up,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_floor,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_ceiling,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_current_rx_level,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_current_rx_range,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x0c:
/*Alerting Tone Select*/
proto_tree_add_item(msg_tree,hf_audio_cadence_select,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_warbler_select,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x0e:
/*RTCP Statistics Report UGLY*/
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
break;
case 0x0f:
/*Open Audio Stream Report*/
proto_tree_add_item(msg_tree,hf_audio_open_stream_rpt,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x10:
/*RTCP Bucket SDES Information Report*/
proto_tree_add_item(msg_tree,hf_audio_sdes_rpt_source_desc,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_sdes_rpt_buk_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_generic_string,tvb,offset,msg_len,ENC_ASCII|ENC_NA);
offset+=msg_len;
break;
case 0x11:
/*Port Mapping Discovery*/
proto_tree_add_item(msg_tree,hf_audio_phone_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_phone_ip,tvb,offset,4,ENC_BIG_ENDIAN);
offset+=4;msg_len-=4;
break;
case 0x12:
/*Resolve Port Mapping*/
proto_tree_add_item(msg_tree,hf_audio_nat_listen_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_nat_ip,tvb,offset,4,ENC_BIG_ENDIAN);
offset+=4;msg_len-=4;
proto_tree_add_item(msg_tree,hf_audio_nat_add_len,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_phone_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_phone_ip,tvb,offset,4,ENC_BIG_ENDIAN);
offset+=4;msg_len-=4;
proto_tree_add_item(msg_tree,hf_audio_phone_add_len,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
break;
case 0x13:
/*Audio Stream Status Report*/
stream_dir=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_audio_stream_direction_code,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
stream_state=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_audio_stream_state,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
if((AUDIO_STREAM_STATE&stream_state)!=AUDIO_STREAM_STATE)
break;
if((AUDIO_STREAM_DIRECTION_RX&stream_dir)==AUDIO_STREAM_DIRECTION_RX)
proto_tree_add_item(msg_tree,hf_rx_vocoder_type,tvb,offset,1,ENC_BIG_ENDIAN);
else if((AUDIO_STREAM_DIRECTION_TX&stream_dir)==AUDIO_STREAM_DIRECTION_TX)
proto_tree_add_item(msg_tree,hf_tx_vocoder_type,tvb,offset,1,ENC_BIG_ENDIAN);
else
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,1,ENC_NA);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_frames_per_packet,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_tos,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_precedence,tvb,offset,1,ENC_BIG_ENDIAN);
proto_tree_add_item(msg_tree,hf_audio_frf_11,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_rtcp_bucket_id,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_lcl_rtp_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_lcl_rtcp_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_far_rtp_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_far_rtcp_port,tvb,offset,2,ENC_BIG_ENDIAN);
offset+=2;msg_len-=2;
proto_tree_add_item(msg_tree,hf_audio_far_ip_add,tvb,offset,4,ENC_BIG_ENDIAN);
offset+=4;msg_len-=4;
proto_tree_add_item(msg_tree,hf_audio_transducer_list_length,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
while(msg_len>0){
proto_tree_add_item(msg_tree,hf_audio_transducer_pair,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
}
break;
case 0x14:
/*Query APB Response*/
proto_tree_add_item(msg_tree,hf_audio_apb_number,tvb,offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
while(msg_len>0){
apb_op_code=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_audio_apb_op_code,tvb,
offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
if(apb_op_code>0x39){
/*should have a len + data*/
apb_data_len=tvb_get_guint8(tvb,offset);
proto_tree_add_item(msg_tree,hf_audio_apb_param_len,tvb,
offset,1,ENC_BIG_ENDIAN);
offset+=1;msg_len-=1;
proto_tree_add_item(msg_tree,hf_audio_apb_data,tvb,
offset,apb_data_len,ENC_NA);
offset+=apb_data_len;msg_len-=apb_data_len;
}
}
break;
case 0xff:
/*Reserved*/
break;
default:
proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,ENC_NA);
offset+=msg_len;
}
if(msg_len){
/* TODO: add Expert info to indicate there is unknown data !
For the moment, this code only remove Clang Warnings about not used msg_len... */
}
return offset;
}
void
proto_register_unistim(void){
static hf_register_info hf[] = {
{ &hf_unistim_seq_nu,
{ "RUDP Seq Num","unistim.num",FT_UINT32,
BASE_HEX|BASE_RANGE_STRING, RVALS(sequence_numbers), 0x0, NULL, HFILL}
},
{ &hf_unistim_cmd_add,
{ "UNISTIM CMD Address","unistim.add",FT_UINT8,
BASE_HEX,VALS(command_address),0x0,NULL,HFILL}
},
{ &hf_uftp_command,
{ "UFTP CMD","unistim.uftp.cmd",FT_UINT8,
BASE_HEX,VALS(uftp_commands),0x0,NULL,HFILL}
},
{ &hf_uftp_datablock_size,
{ "UFTP Datablock Size","unistim.uftp.blocksize",FT_UINT32,
BASE_DEC,NULL,0x0,NULL,HFILL}
},
{ &hf_uftp_datablock_limit,
{ "UFTP Datablock Limit","unistim.uftp.limit",FT_UINT8,
BASE_DEC,NULL,0x0,NULL,HFILL}
},
{ &hf_uftp_filename,
{ "UFTP Filename","unistim.uftp.filename",FT_STRINGZ,
BASE_NONE,NULL,0x0,NULL,HFILL}
},
{ &hf_uftp_datablock,
{ "UFTP Data Block","unistim.uftp.datablock",FT_BYTES,
BASE_NONE,NULL,0x0,NULL,HFILL}
},
{ &hf_unistim_packet_type,
{ "RUDP Pkt type","unistim.type",FT_UINT8,
BASE_DEC, VALS(packet_names),0x0,NULL,HFILL}
},
{ &hf_unistim_payload,
{ "UNISTIM Payload","unistim.pay",FT_UINT8,
BASE_HEX, VALS(payload_names),0x0,NULL,HFILL}
},
{ &hf_unistim_len ,
{ "UNISTIM CMD Length","unistim.len",FT_UINT8,
BASE_DEC,NULL,0x0,NULL,HFILL}
},
{ &hf_basic_bit_field,
{"FLAGS","unistim.bit.fields",FT_BOOLEAN,
8,NULL,0xff,NULL,HFILL}
},
{ &hf_basic_switch_cmd ,
{"Basic Cmd (switch)","unistim.basic.switch",FT_UINT8,
BASE_HEX,VALS(basic_switch_msgs),0x0,NULL,HFILL}
},
{ &hf_basic_phone_cmd ,
{"Basic Cmd (phone)","unistim.basic.phone",FT_UINT8,
BASE_HEX,VALS(basic_phone_msgs),0x0,NULL,HFILL}
},
{ &hf_broadcast_switch_cmd ,
{"Broadcast Cmd (switch)","unistim.broadcast.switch",FT_UINT8,
BASE_HEX,VALS(broadcast_switch_msgs),0x0,NULL,HFILL}
},
#if 0
{ &hf_broadcast_phone_cmd ,
{"Broadcast Cmd (phone)","unistim.broadcast.phone",FT_UINT8,
BASE_HEX,VALS(broadcast_phone_msgs),0x0,NULL,HFILL}
},
#endif
{ &hf_audio_switch_cmd ,
{"Audio Cmd (switch)","unistim.audio.switch",FT_UINT8,
BASE_HEX,VALS(audio_switch_msgs),0x0,NULL,HFILL}
},
{ &hf_audio_phone_cmd ,
{"Audio Cmd (phone)","unistim.audio.phone",FT_UINT8,
BASE_HEX,VALS(audio_phone_msgs),0x0,NULL,HFILL}
},
{ &hf_display_switch_cmd ,
{"Display Cmd (switch)","unistim.display.switch",FT_UINT8,
BASE_HEX,VALS(display_switch_msgs),0x0,NULL,HFILL}
},
{ &hf_display_phone_cmd ,
{"Display Cmd (phone)","unistim.display.phone",FT_UINT8,
BASE_HEX,VALS(display_phone_msgs),0x0,NULL,HFILL}
},
{ &hf_key_switch_cmd ,
{"Key Cmd (switch)","unistim.key.switch",FT_UINT8,
BASE_HEX,VALS(key_switch_msgs),0x0,NULL,HFILL}
},
{ &hf_key_phone_cmd ,
{"Key Cmd (phone)","unistim.key.phone",FT_UINT8,
BASE_HEX,VALS(key_phone_msgs),0x0,NULL,HFILL}
},
{ &hf_network_switch_cmd ,
{"Network Cmd (switch)","unistim.network.switch",FT_UINT8,
BASE_HEX,VALS(network_switch_msgs),0x0,NULL,HFILL}
},
{ &hf_network_phone_cmd ,
{"Network Cmd (phone)","unistim.network.phone",FT_UINT8,
BASE_HEX,VALS(network_phone_msgs),0x0,NULL,HFILL}
},
{ &hf_terminal_id,
{"Terminal ID","unistim.terminal.id",FT_IPv4,
BASE_NONE,NULL,0x0,NULL,HFILL}
},
{ &hf_broadcast_year,
{"Year","unistim.broadcast.year",FT_UINT8,
BASE_DEC,NULL,0x7f,NULL,HFILL}
},
{ &hf_broadcast_month,
{"Month","unistim.broadcast.month",FT_UINT8,
BASE_DEC,NULL,0x0,NULL,HFILL}
},
{ &hf_broadcast_day,
{"Day","unistim.broadcast.day",FT_UINT8,
BASE_DEC,NULL,0x0,NULL,HFILL}
},
{ &hf_broadcast_hour,
{"Hour","unistim.broadcast.hour",FT_UINT8,
BASE_DEC,NULL,0x0,NULL,HFILL}
},
{ &hf_broadcast_minute,
{"Minute","unistim.broadcast.minute",FT_UINT8,
BASE_DEC,NULL,0x0,NULL,HFILL}
},
{ &hf_broadcast_second,
{"Second","unistim.broadcast.second",FT_UINT8,
BASE_DEC,NULL,0x0,NULL,HFILL}
},
{ &hf_net_diag_flag,
{"Query Network Manager Diagnostic","unistim.query.diagnostic",
FT_BOOLEAN,8, NULL,
QUERY_NETWORK_MANAGER_DIAGNOSTIC, NULL,HFILL}
},
{ &hf_net_managers_flag,
{"Query Network Manager Managers","unistim.query.managers",
FT_BOOLEAN,8, NULL,
QUERY_NETWORK_MANAGER_MANAGERS, NULL,HFILL}
},
{ &hf_net_attributes_flag,
{"Query Network Manager Attributes","unistim.query.attributes",
FT_BOOLEAN, 8,NULL,
QUERY_NETWORK_MANAGER_ATTRIBUTES,NULL,HFILL}
},
{ &hf_net_serv_info_flag,
{"Query Network Manager Server Info","unistim.query.serverInfo",
FT_BOOLEAN, 8,NULL,
QUERY_NETWORK_MANAGER_SERVER_INFO,NULL,HFILL}
},
{ &hf_net_options_flag,
{"Query Network Manager Options","unistim.query.options",
FT_BOOLEAN, 8,NULL,
QUERY_NETWORK_MANAGER_OPTIONS,NULL,HFILL}
},
{ &hf_net_sanity_flag,
{"Query Network Manager Sanity","unistim.query.sanity",
FT_BOOLEAN, 8,NULL,
QUERY_NETWORK_MANAGER_SANITY,NULL,HFILL}
},
{ &hf_net_enable_diag,
{"Network Manager Enable DIAG","unistim.enable.diag",
FT_BOOLEAN, 8,NULL,
NETWORK_MANAGER_ENABLE_DIAG,NULL,HFILL}
},
{ &hf_net_enable_rudp,
{"Network Manager Enable RUDP","unistim.enable.network.rel.udp",
FT_BOOLEAN, 8,NULL,
NETWORK_MANAGER_ENABLE_RUDP,NULL,HFILL}
},
{ &hf_net_server_id,
{"Download Server ID","unistim.download.id",FT_UINT8,
BASE_HEX, VALS(network_server_id),0x00,NULL,HFILL}
},
{ &hf_net_server_port,
{"Download Server Port","unistim.download.port",FT_UINT16,
BASE_DEC, NULL,0x00,NULL,HFILL}
},
{ &hf_net_server_action,
{"Download Server Action","unistim.download.action",FT_UINT8,
BASE_HEX, VALS(server_action),0x00,NULL,HFILL}
},
{ &hf_net_server_retry_count,
{"Download Retry Count","unistim.download.retry",FT_UINT8,
BASE_DEC, NULL,0x00,NULL,HFILL}
},
{ &hf_net_server_failover_id,
{"Download Failover Server ID","unistim.download.failover",FT_UINT8,
BASE_HEX, VALS(network_server_id),0x00,NULL,HFILL}
},
{ &hf_net_server_ip_address,
{"Download Server Address","unistim.download.address",FT_IPv4,
BASE_NONE, NULL,0x00,NULL,HFILL}
},
{ &hf_net_server_time_out,
{"Watchdog Timeout","unistim.watchdog.timeout",FT_UINT16,
BASE_DEC, NULL,0x00,NULL,HFILL}
},
{ &hf_net_server_config_element,
{"Configure Network Element","unistim.config.element",FT_UINT8,
BASE_HEX, VALS(network_elements),0x00,NULL,HFILL}
},
{ &hf_net_server_recovery_time_low,
{"Recovery Procedure Idle Low Boundary","unistim.recovery.low",FT_UINT16,
BASE_DEC, NULL,0x00,NULL,HFILL}
},
{ &hf_net_server_recovery_time_high,
{"Recovery Procedure Idle High Boundary","unistim.recovery.high",FT_UINT16,
BASE_DEC, NULL,0x00,NULL,HFILL}
},
{ &hf_net_phone_rx_ovr_flag,
{"Receive Buffer Overflow","unistim.receive.overflow",
FT_BOOLEAN, 8,NULL,
RX_BUFFER_OVERFLOW,NULL,HFILL}
},
{ &hf_net_phone_tx_ovr_flag,
{"Transmit Buffer Overflow","unistim.trans.overflow",
FT_BOOLEAN, 8,NULL,
TX_BUFFER_OVERFLOW,NULL,HFILL}
},
{ &hf_net_phone_rx_empty_flag,
{"Receive Buffer Unexpectedly Empty","unistim.receive.empty",
FT_BOOLEAN, 8,NULL,
RX_UNEXPECT_EMPTY,NULL,HFILL}
},
{ &hf_net_phone_invalid_msg_flag,
{"Received Invalid MSG","unistim.invalid.msg",
FT_BOOLEAN, 8,NULL,
INVALID_MSG,NULL,HFILL}
},
{ &hf_net_phone_eeprom_insane_flag,
{"EEProm Insane","unistim.eeprom.insane",
FT_BOOLEAN, 8,NULL,
EEPROM_INSANE,NULL,HFILL}
},
{ &hf_net_phone_eeprom_unsafe_flag,
{"EEProm Unsafe","unistim.eeprom.unsafe",
FT_BOOLEAN, 8,NULL,
EEPROM_UNSAFE,NULL,HFILL}
},
{ &hf_net_phone_diag,
{"Diagnostic Command Enabled","unistim.diag.enabled",FT_BOOLEAN,
8,NULL,NETWORK_MGR_REPORT_DIAG,NULL,HFILL}
},
{ &hf_net_phone_rudp,
{"Reliable UDP Active","unistim.rudp.active",FT_BOOLEAN,
8,NULL,NETWORK_MGR_REPORT_RUDP,NULL,HFILL}
},
{ &hf_basic_switch_query_flags,
{"Query Basic Manager","unistim.basic.query",FT_UINT8,
BASE_HEX, NULL,0x00,"INITIAL PHONE QUERY",HFILL}
},
{ &hf_basic_switch_query_attr,
{"Query Basic Manager Attributes","unistim.basic.attrs",FT_BOOLEAN,
8,NULL,BASIC_QUERY_ATTRIBUTES,"Basic Query Attributes",HFILL}
},
{ &hf_basic_switch_query_opts,
{"Query Basic Manager Options","unistim.basic.opts",FT_BOOLEAN,
8,NULL,BASIC_QUERY_OPTIONS,"Basic Query Options",HFILL}
},
{ &hf_basic_switch_query_fw,
{"Query Basic Switch Firmware","unistim.basic.fw",FT_BOOLEAN,
8,NULL,BASIC_QUERY_FW,"Basic Query Firmware",HFILL}
},
{ &hf_basic_switch_query_hw_id,
{"Query Basic Manager Hardware ID","unistim.basic.hwid",FT_BOOLEAN,
8,NULL,BASIC_QUERY_HW_ID,"Basic Query Hardware ID",HFILL}
},
{ &hf_basic_switch_query_it_type,
{"Query Basic Manager Phone Type","unistim.basic.type",FT_BOOLEAN,
8,NULL,BASIC_QUERY_IT_TYPE,"Basic Query Phone Type",HFILL}
},
{ &hf_basic_switch_query_prod_eng_code,
{"Query Basic Manager Prod Eng Code","unistim.basic.code",FT_BOOLEAN,
8,NULL,BASIC_QUERY_PROD_ENG_CODE,"Basic Query Production Engineering Code",HFILL}
},
{ &hf_basic_switch_query_gray_mkt_info,
{"Query Basic Manager Gray Mkt Info","unistim.basic.gray",FT_BOOLEAN,
8,NULL,BASIC_QUERY_GRAY_MKT_INFO,"Basic Query Gray Market Info",HFILL}
},
{ &hf_basic_switch_options_secure,
{"Basic Switch Options Secure Code","unistim.basic.secure",FT_BOOLEAN,
8,NULL,BASIC_OPTION_SECURE,NULL,HFILL}
},
{ &hf_basic_switch_element_id,
{"Basic Element ID","unistim.basic.element.id",FT_UINT8,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_basic_switch_eeprom_data,
{"EEProm Data","unistim.basic.eeprom.data",FT_BYTES,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_basic_phone_eeprom_stat_cksum,
{"Basic Phone EEProm Static Checksum","unistim.static.cksum",FT_UINT8,
BASE_HEX,NULL,0x0,NULL,HFILL}
},
{ &hf_basic_phone_eeprom_dynam,
{"Basic Phone EEProm Dynamic Checksum","unistim.dynam.cksum",FT_UINT8,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_basic_phone_eeprom_net_config_cksum,
{"Basic Phone EEProm Net Config Checksum","unistim.netconfig.cksum",FT_UINT8,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_basic_phone_hw_id,
{"Basic Phone Hardware ID","unistim.basic.hw.id",FT_BYTES,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_basic_phone_fw_ver,
{"Basic Phone Firmware Version","unistim.basic.fw.ver",FT_STRING,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_key_code,
{"Key Name","unistim.key.name",FT_UINT8,
BASE_HEX,VALS(key_names),0x3f,NULL,HFILL}
},
{ &hf_key_command,
{"Key Action","unistim.key.action",FT_UINT8,
BASE_HEX,VALS(key_cmds),0xc0,NULL,HFILL}
},
{ &hf_icon_id,
{"Icon ID","unistim.icon.id",FT_UINT8,
BASE_HEX,NULL, DISPLAY_ICON_ID,NULL,HFILL}
},
{ &hf_broadcast_icon_state,
{"Icon State","unistim.icon.state",FT_UINT8,
BASE_HEX,VALS(bcast_icon_states),0x1f,NULL,HFILL}
},
{ &hf_broadcast_icon_cadence,
{"Icon Cadence","unistim.icon.cadence",FT_UINT8,
BASE_HEX,VALS(bcast_icon_cadence),0xe0,NULL,HFILL}
},
{ &hf_audio_mgr_attr,
{"Query Audio Manager Attributes","unistim.audio.attr",FT_BOOLEAN,
8,NULL,QUERY_AUDIO_MGR_ATTRIBUTES,NULL,HFILL}
},
{ &hf_audio_mgr_opts,
{"Query Audio Manager Options","unistim.audio.options",FT_BOOLEAN,
8,NULL,QUERY_AUDIO_MGR_OPTIONS,NULL,HFILL}
},
{ &hf_audio_mgr_alert,
{"Query Audio Manager Alerting","unistim.audio.alerting",FT_BOOLEAN,
8,NULL,QUERY_AUDIO_MGR_ALERTING ,NULL,HFILL}
},
{ &hf_audio_mgr_adj_rx_vol,
{"Query Audio Manager Adjustable Receive Volume","unistim.audio.adj.volume",FT_BOOLEAN,
8,NULL,QUERY_AUDIO_MGR_ADJ_RX_VOL,NULL,HFILL}
},
{ &hf_audio_mgr_def_rx_vol,
{"Query Audio Manager Default Receive Volume","unistim.audio.def.volume",FT_BOOLEAN,
8,NULL,QUERY_AUDIO_MGR_DEF_RX_VOL,NULL,HFILL}
},
{ &hf_audio_mgr_handset,
{"Query Audio Manager Handset","unistim.audio.handset",FT_BOOLEAN,
8,NULL,QUERY_AUDIO_MGR_HANDSET,NULL,HFILL}
},
{ &hf_audio_mgr_headset,
{"Query Audio Manager Headset","unistim.audio.headset",FT_BOOLEAN,
8,NULL,QUERY_AUDIO_MGR_HEADSET,NULL,HFILL}
},
{ &hf_audio_default_rx_vol_id,
{"Audio Manager Default Receive Volume ID","unistim.audio.volume.id",FT_UINT8,
BASE_HEX,VALS(default_rx_vol_id),0x00,NULL,HFILL}
},
{ &hf_audio_mgr_opt_max_vol,
{"Audio Manager Enable Max Tone Volume","unistim.audio.max.tone",FT_BOOLEAN,
8,TFS(&audio_opts_enable_max_tone_vol),AUDIO_MGR_OPTS_MAX_VOL,NULL,HFILL}
},
{ &hf_audio_mgr_opt_adj_vol,
{"Audio Manager Adjust Volume","unistim.audio.opts.adj.vol",FT_BOOLEAN,
8,TFS(&audio_opts_adjust_volume),AUDIO_MGR_ADJ_VOL,NULL,HFILL}
},
{ &hf_audio_mgr_opt_aa_rx_vol_rpt,
{"Audio Manager Auto Adjust Volume RPT","unistim.audio.aa.vol.rpt",FT_BOOLEAN,
8,TFS(&audio_opts_automatic_adjustable),AUDIO_MGR_AUTO_RX_VOL_RPT,NULL,HFILL}
},
{ &hf_audio_mgr_opt_hs_on_air,
{"Audio Manager Handset","unistim.audio.handset",FT_BOOLEAN,
8,TFS(&audio_opts_hs_on_air_feature),AUDIO_MGR_HS_ON_AIR,NULL,HFILL}
},
{ &hf_audio_mgr_opt_hd_on_air,
{"Audio Manager Headset","unistim.audio.headset",FT_BOOLEAN,
8,TFS(&audio_opts_hd_on_air_feature),AUDIO_MGR_HD_ON_AIR,NULL,HFILL}
},
{ &hf_audio_mgr_opt_noise_squelch,
{"Audio Manager Noise Squelch","unistim.audio.squelch",FT_BOOLEAN,
8,TFS(&noise_sqlch_disable), AUDIO_MGR_NOISE_SQUELCH,NULL,HFILL}
},
{ &hf_audio_mgr_mute,
{"Audio Manager Mute","unistim.audio.mute",FT_BOOLEAN,
8,TFS(&audio_mgr_mute_val),AUDIO_MGR_MUTE,NULL,HFILL}
},
{ &hf_audio_mgr_tx_rx,
{"Audio Manager RX or TX","unistim.audio.rx.tx",FT_BOOLEAN,
8,TFS(&audio_mgr_tx_rx_val),AUDIO_MGR_TX_RX,NULL,HFILL}
},
{ &hf_audio_mgr_stream_id,
{"Audio Manager Stream ID","unistim.audio.stream.id",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_mgr_transducer_based_tone_id,
{"Audio Manager Transducer Based Tone On","unistim.audio.transducer.on",FT_UINT8,
BASE_HEX,VALS(trans_base_tone_ids),0x07,NULL,HFILL}
},
{ &hf_audio_mgr_attenuated,
{"Audio Manager Transducer Tone Attenuated","unistim.audio.attenuated.on",FT_BOOLEAN,
8,NULL,AUDIO_MGR_ATTENUATED,NULL,HFILL}
},
{ &hf_audio_mgr_warbler_select,
{"Warbler Select","unistim.warbler.select",FT_UINT8,
BASE_HEX,NULL,0x07,NULL,HFILL}
},
{ &hf_audio_mgr_transducer_routing,
{"Transducer Routing","unistim.transducer.routing",FT_UINT8,
BASE_HEX,VALS(transducer_routing_vals),0xf8,NULL,HFILL}
},
{ &hf_audio_mgr_tone_vol_range,
{"Tone Volume Range in Steps","unistim.tone.volume.range",FT_UINT8,
BASE_HEX,NULL,0x0f,NULL,HFILL}
},
{ &hf_audio_mgr_cadence_select,
{"Cadence Select","unistim.cadence.select",FT_UINT8,
BASE_HEX,VALS(cadence_select_vals),0xf0,NULL,HFILL}
},
{ &hf_audio_special_tone,
{"Special Tone Select","unistim.special.tone.select",FT_UINT8,
BASE_HEX,VALS(special_tones_vals),0x00,NULL,HFILL}
},
{ &hf_audio_tone_level,
{"Tone Level","unistim.audio.tone.level",FT_UINT8,
BASE_DEC,NULL,0xf0,NULL,HFILL}
},
{ &hf_audio_visual_tones,
{"Enable Visual Tones","unistim.visual.tones",FT_BOOLEAN,
8,NULL,AUDIO_MGR_VISUAL_TONE,NULL,HFILL}
},
{ &hf_audio_stream_based_tone_id,
{"Stream Based Tone ID","unistim.stream.tone.id",FT_UINT8,
BASE_HEX,VALS(stream_based_tone_vals),0x1f,NULL,HFILL}
},
{ &hf_audio_stream_based_tone_rx_tx,
{"Stream Based Tone RX or TX","unistim.stream.based.tone.rx.tx",FT_BOOLEAN,
8,TFS(&stream_based_tone_rx_tx_yn),AUDIO_STREAM_BASED_TONE_RX_TX,NULL,HFILL}
},
{ &hf_audio_stream_based_tone_mute,
{"Stream Based Tone Mute","unistim.stream.tone.mute",FT_BOOLEAN,
8,TFS(&stream_based_tone_mute_yn),AUDIO_STREAM_BASED_TONE_MUTE,NULL,HFILL}
},
{ &hf_audio_stream_id,
{"Stream ID","unistim.audio.stream.id",FT_UINT8,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_stream_based_volume,
{"Stream Based Volume ID","unistim.stream.volume.id",FT_UINT8,
BASE_HEX,VALS(stream_base_vol_level),0x00,NULL,HFILL}
},
{ &hf_basic_switch_terminal_id,
{"Terminal ID assigned by Switch","unistim.switch.terminal.id",FT_IPv4,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_basic_it_type,
{"IT (Phone) Type","unistim.it.type",FT_UINT8,
BASE_HEX,VALS(it_types),0x00,NULL,HFILL}
},
{ &hf_basic_prod_eng_code,
{"Product Engineering Code for phone","unistim.basic.eng.code",FT_STRING,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_net_phone_primary_server_id,
{"Phone Primary Server ID","unistim.net.phone.primary.id",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_net_phone_server_port,
{"Port Number","unistim.server.port",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_net_phone_server_action,
{"Action","unistim.server.action.byte",FT_UINT8,
BASE_HEX,VALS(action_bytes),0x00,NULL,HFILL}
},
{ &hf_net_phone_server_retry_count,
{"Number of times to Retry","unistim.server.retry.count",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_net_phone_server_failover_id,
{"Failover Server ID","unistim.server.failover.id",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_net_phone_server_ip,
{"IP address","unistim.server.ip.address",FT_IPv4,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_apb_number,
{"APB Number","unistim.audio.apb.number",FT_UINT8,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ & hf_audio_apb_op_code,
{"APB Operation Code","unistim.audio.apb.op.code",FT_UINT8,
BASE_HEX,VALS(apb_op_codes),0x00,NULL,HFILL}
},
{ &hf_audio_apb_param_len,
{"APB Operation Parameter Length","unistim.apb.param.len",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_apb_data,
{"APB Operation Data","unistim.apb.operation.data",FT_BYTES,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_display_write_address_numeric,
{"Is Address Numeric","unistim.write.address.numeric",FT_BOOLEAN,
8,NULL,DISPLAY_WRITE_ADDRESS_NUMERIC_FLAG,NULL,HFILL}
},
{ &hf_display_write_address_context,
{"Context Field in the Info Bar","unistim.write.address.context",FT_BOOLEAN,
8,NULL,DISPLAY_WRITE_ADDRESS_CONTEXT_FLAG,NULL,HFILL}
},
{ &hf_display_write_address_line,
{"Write A Line","unistim.write.address.line",FT_BOOLEAN,
8,NULL,DISPLAY_WRITE_ADDRESS_LINE_FLAG ,NULL,HFILL}
},
{ &hf_display_write_address_soft_key,
{"Write a SoftKey","unistim.write.address.softkey",FT_BOOLEAN,
8,NULL,DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG,NULL,HFILL}
},
{ &hf_display_write_address_soft_label,
{"Write A Softkey Label","unistim.write.address.softkey.label",FT_BOOLEAN,
8,NULL,DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG,NULL,HFILL}
},
{ &hf_display_write_address_softkey_id,
{"Soft Key ID","unistim.write.address.softkey.id",FT_UINT8,
BASE_HEX,NULL,DISPLAY_WRITE_ADDRESS_SOFT_KEY_ID,NULL,HFILL}
},
{ &hf_display_write_address_char_pos,
{"Character Position or Soft-Label Key ID","unistim.display.write.address.char.pos",FT_UINT8,
BASE_HEX,NULL,DISPLAY_WRITE_ADDRESS_CHAR_POS,NULL,HFILL}
},
{ &hf_display_write_address_line_number,
{"Line Number","unistim.write.address.line.number",FT_UINT8,
BASE_DEC,NULL,DISPLAY_WRITE_ADDRESS_LINE_NUM,NULL,HFILL}
},
{ &hf_display_write_cursor_move,
{"Cursor Move","unistim.display.cursor.move",FT_BOOLEAN,
8,NULL,DISPLAY_WRITE_CURSOR_MOVE,NULL,HFILL}
},
{ &hf_display_write_clear_left,
{"Clear Left","unistim.display.clear.left",FT_BOOLEAN,
8,NULL,DISPLAY_WRITE_CLEAR_LEFT,NULL,HFILL}
},
{ &hf_display_write_clear_right,
{"Clear Right","unistim.display.clear.right",FT_BOOLEAN,
8,NULL,DISPLAY_WRITE_CLEAR_RIGHT,NULL,HFILL}
},
{ &hf_display_write_shift_left,
{"Shift Left","unistim.display.shift.left",FT_BOOLEAN,
8,NULL,DISPLAY_WRITE_SHIFT_LEFT,NULL,HFILL}
},
{ &hf_display_write_shift_right,
{"Shift Right","unistim.display.shift.right",FT_BOOLEAN,
8,NULL,DISPLAY_WRITE_SHIFT_RIGHT,NULL,HFILL}
},
{ &hf_display_write_highlight,
{"Highlight","unistim.display.highlight",FT_BOOLEAN,
8,NULL,DISPLAY_WRITE_HIGHLIGHT,NULL,HFILL}
},
{ &hf_display_write_tag,
{"Tag for text","unistim.display.text.tag",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_display_cursor_move_cmd,
{"Cursor Movement Command","unistim.cursor.move.cmd",FT_UINT8,
BASE_HEX,VALS(cursor_move_cmds),DISPLAY_CURSOR_MOVE_CMD,NULL,HFILL}
},
{ &hf_display_cursor_blink,
{"Should Cursor Blink","unistim.cursor.blink",FT_BOOLEAN,
8,NULL,DISPLAY_CURSOR_BLINK,NULL,HFILL}
},
{ &hf_audio_vocoder_id,
{"Vocoder Protocol","unistim.vocoder.id",FT_UINT8,
BASE_HEX,VALS(vocoder_ids),0x00,NULL,HFILL}
},
{ &hf_audio_vocoder_param,
{"Vocoder Config Param","unistim.vocoder.config.param",FT_UINT8,
BASE_HEX,VALS(vocoder_config_params),AUDIO_VOCODER_CONFIG_PARAM,NULL,HFILL}
},
{ &hf_audio_vocoder_entity,
{"Vocoder Entity","unistim.vocoder.entity",FT_UINT8,
BASE_HEX,VALS(config_param_entities),AUDIO_VOCODER_CONFIG_ENTITY,NULL,HFILL}
},
{ &hf_audio_vocoder_annexa,
{"Enable Annex A","unistim.enable.annexa",FT_BOOLEAN,
8,NULL,AUDIO_VOCODER_ANNEXA,NULL,HFILL}
},
{ &hf_audio_vocoder_annexb,
{"Enable Annex B","unistim.enable.annexb",FT_BOOLEAN,
8,NULL,AUDIO_VOCODER_ANNEXB,NULL,HFILL}
},
{ &hf_audio_sample_rate,
{"Sample Rate","unistim.audio.sample.rate",FT_UINT8,
BASE_HEX,VALS(sample_rates),0x00,NULL,HFILL}
},
{ &hf_audio_rtp_type,
{"RTP Type","unistim.audio.rtp.type",FT_UINT8,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_bytes_per_frame,
{"Bytes Per Frame","unistim.audio.bytes.per.frame",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_rx_stream_id,
{"Receive Stream Id","unistim.rx.stream.id",FT_UINT8,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_tx_stream_id,
{"Transmit Stream Id","unistim.tx.stream.id",FT_UINT8,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_rx_vocoder_type,
{"Receive Vocoder Protocol","unistim.vocoder.id",FT_UINT8,
BASE_HEX,VALS(vocoder_ids),0x00,NULL,HFILL}
},
{ &hf_tx_vocoder_type,
{"Transmit Vocoder Protocol","unistim.vocoder.id",FT_UINT8,
BASE_HEX,VALS(vocoder_ids),0x00,NULL,HFILL}
},
{ &hf_frames_per_packet,
{"Frames Per Packet","unistim.vocoder.frames.per.packet",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_tos,
{"Type of Service","unistim.audio.type.service",FT_UINT8,
BASE_HEX,VALS(types_of_service),AUDIO_TYPE_OF_SERVICE,NULL,HFILL}
},
{ &hf_audio_precedence,
{"Precedence","unistim.audio.precedence",FT_UINT8,
BASE_HEX,VALS(precedences),AUDIO_PRECENDENCE,NULL,HFILL}
},
{ &hf_audio_frf_11,
{"FRF.11 Enable","unistim.audio.frf.11",FT_BOOLEAN,
8,NULL,AUDIO_FRF_11,NULL,HFILL}
},
{ &hf_audio_lcl_rtp_port,
{"Phone RTP Port","unistim.local.rtp.port",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_lcl_rtcp_port,
{"Phone RTCP Port","unistim.local.rtcp.port",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_far_rtp_port,
{"Distant RTP Port","unistim.far.rtp.port",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_far_rtcp_port,
{"Distant RTCP Port","unistim.far.rtcp.port",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_far_ip_add,
{"Distant IP Address for RT[C]P","unistim.far.ip.address",FT_IPv4,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_rtcp_bucket_id,
{"RTCP Bucket ID","unistim.rtcp.bucket.id",FT_UINT16,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_key_icon_id,
{"Icon ID","unistim.key.icon.id",FT_UINT8,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_display_clear_numeric,
{"Numeric Index Field in InfoBar","unistim.display.clear.numeric",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_NUMERIC,NULL,HFILL}
},
{ &hf_display_clear_context ,
{"Context Field in InfoBar","unistim.display.clear.context",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_CONTEXT,NULL,HFILL}
},
{ &hf_display_clear_date ,
{"Date Field","unistim.display.clear.date",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_DATE,NULL,HFILL}
},
{ &hf_display_clear_time,
{"Time Field","unistim.display.clear.time",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_TIME,NULL,HFILL}
},
{ &hf_display_clear_line,
{"Line Data","unistim.display.clear.line",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_LINE,NULL,HFILL}
},
{ &hf_display_clear_status_bar_icon,
{"Status Bar Icon","unistim.display.statusbar.icon",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_STATUS_BAR_ICON,NULL,HFILL}
},
{ &hf_display_clear_softkey,
{"Soft Key","unistim.display.clear.softkey",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_SOFTKEY,NULL,HFILL}
},
{ &hf_display_clear_softkey_label ,
{"Soft Key Label","unistim.display.clear.softkey.label",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_SOFTKEY_LABEL,NULL,HFILL}
},
{ &hf_display_clear_line_1 ,
{"Line 1","unistim.display.clear.line1",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_LINE_1,NULL,HFILL}
},
{ &hf_display_clear_line_2 ,
{"Line 2","unistim.display.clear.line2",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_LINE_2,NULL,HFILL}
},
{ &hf_display_clear_line_3 ,
{"Line 3","unistim.display.clear.line3",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_LINE_3,NULL,HFILL}
},
{ &hf_display_clear_line_4 ,
{"Line 4","unistim.display.clear.line4",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_LINE_4,NULL,HFILL}
},
{ &hf_display_clear_line_5 ,
{"Line 5","unistim.display.clear.line5",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_LINE_5,NULL,HFILL}
},
{ &hf_display_clear_line_6 ,
{"Line 6","unistim.display.clear.line6",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_LINE_6,NULL,HFILL}
},
{ &hf_display_clear_line_7 ,
{"Line 7","unistim.display.clear.line7",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_LINE_7,NULL,HFILL}
},
{ &hf_display_clear_line_8 ,
{"Line 8","unistim.display.clear.line8",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_LINE_8,NULL,HFILL}
},
{ &hf_display_clear_status_bar_icon_1 ,
{"Status Bar Icon 1","unistim.display.clear.sbar.icon1",FT_BOOLEAN,
8,NULL,DISPLAY_STATUS_BAR_ICON_1,NULL,HFILL}
},
{ &hf_display_clear_status_bar_icon_2 ,
{"Status Bar Icon 2","unistim.display.clear.sbar.icon2",FT_BOOLEAN,
8,NULL,DISPLAY_STATUS_BAR_ICON_2,NULL,HFILL}
},
{ &hf_display_clear_status_bar_icon_3 ,
{"Status Bar Icon 3","unistim.display.clear.sbar.icon3",FT_BOOLEAN,
8,NULL,DISPLAY_STATUS_BAR_ICON_3,NULL,HFILL}
},
{ &hf_display_clear_status_bar_icon_4 ,
{"Status Bar Icon 4","unistim.display.clear.sbar.icon4",FT_BOOLEAN,
8,NULL,DISPLAY_STATUS_BAR_ICON_4,NULL,HFILL}
},
{ &hf_display_clear_status_bar_icon_5 ,
{"Status Bar Icon 5","unistim.display.clear.sbar.icon5",FT_BOOLEAN,
8,NULL,DISPLAY_STATUS_BAR_ICON_5,NULL,HFILL}
},
{ &hf_display_clear_status_bar_icon_6 ,
{"Status Bar Icon 6","unistim.display.clear.sbar.icon6",FT_BOOLEAN,
8,NULL,DISPLAY_STATUS_BAR_ICON_6,NULL,HFILL}
},
{ &hf_display_clear_status_bar_icon_7 ,
{"Status Bar Icon 7","unistim.display.clear.sbar.icon7",FT_BOOLEAN,
8,NULL,DISPLAY_STATUS_BAR_ICON_7,NULL,HFILL}
},
{ &hf_display_clear_status_bar_icon_8 ,
{"Status Bar Icon 8","unistim.display.clear.sbar.icon8",FT_BOOLEAN,
8,NULL,DISPLAY_STATUS_BAR_ICON_8,NULL,HFILL}
},
{ &hf_display_clear_soft_key_1 ,
{"Soft Key 1","unistim.display.clear.soft.key1",FT_BOOLEAN,
8,NULL,DISPLAY_SOFT_KEY_1,NULL,HFILL}
},
{ &hf_display_clear_soft_key_2 ,
{"Soft Key 2","unistim.display.clear.soft.key2",FT_BOOLEAN,
8,NULL,DISPLAY_SOFT_KEY_2,NULL,HFILL}
},
{ &hf_display_clear_soft_key_3 ,
{"Soft Key 3","unistim.display.clear.soft.key3",FT_BOOLEAN,
8,NULL,DISPLAY_SOFT_KEY_3,NULL,HFILL}
},
{ &hf_display_clear_soft_key_4 ,
{"Soft Key 4","unistim.display.clear.soft.key4",FT_BOOLEAN,
8,NULL,DISPLAY_SOFT_KEY_4,NULL,HFILL}
},
{ &hf_display_clear_soft_key_5 ,
{"Soft Key 5","unistim.display.clear.soft.key5",FT_BOOLEAN,
8,NULL,DISPLAY_SOFT_KEY_5,NULL,HFILL}
},
{ &hf_display_clear_soft_key_6 ,
{"Soft Key 6","unistim.display.clear.soft.key6",FT_BOOLEAN,
8,NULL,DISPLAY_SOFT_KEY_6,NULL,HFILL}
},
{ &hf_display_clear_soft_key_7 ,
{"Soft Key 7","unistim.display.clear.soft.key7",FT_BOOLEAN,
8,NULL,DISPLAY_SOFT_KEY_7,NULL,HFILL}
},
{ &hf_display_clear_soft_key_8 ,
{"Soft Key 8","unistim.display.clear.soft.key8",FT_BOOLEAN,
8,NULL,DISPLAY_SOFT_KEY_8,NULL,HFILL}
},
{ &hf_display_clear_sk_label_key_id,
{"Soft Key Label ID","unistim.display.clear.sk.label.id",FT_UINT8,
BASE_HEX,NULL, DISPLAY_CLEAR_SK_LABEL_KEY_ID,NULL,HFILL}
},
{ &hf_display_clear_all_slks,
{"Clear All Soft Key Labels","unistim.display.clear.all.sks",FT_BOOLEAN,
8,NULL,DISPLAY_CLEAR_ALL_SLKS,NULL,HFILL}
},
{ &hf_key_led_cadence,
{"LED Cadence","unistim.key.led.cadence",FT_UINT8,
BASE_HEX,VALS(led_cadences),KEY_LED_CADENCE,NULL,HFILL}
},
{ &hf_key_led_id,
{"LED ID","unistim.key.led.id",FT_UINT8,
BASE_HEX,VALS(led_ids),KEY_LED_ID,NULL,HFILL}
},
{ &hf_basic_ether_address,
{"Phone Ethernet Address","unistim.phone.ether",FT_ETHER,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_rtcp_bucket_id,
{"RTCP Bucket ID","unistim.audio.rtcp.bucket.id",FT_UINT8,
BASE_HEX,NULL,AUDIO_RTCP_BUCKET_ID,NULL,HFILL}
},
{ &hf_audio_clear_bucket,
{"Clear Bucket Counter","unistim.clear.bucket",FT_BOOLEAN,
8,NULL,AUDIO_CLEAR_BUCKET,NULL,HFILL}
},
{ &hf_display_arrow,
{"Arrow Display Direction","unistim.arrow.direction",FT_UINT8,
BASE_HEX,VALS(arrow_dirs),0x00,NULL,HFILL}
},
{ &hf_audio_transducer_pair,
{"Audio Transducer Pair","unistim.transducer.pairs",FT_UINT8,
BASE_HEX,VALS(transducer_pairs),AUDIO_TRANSDUCER_PAIR_ID,NULL,HFILL}
},
{ &hf_audio_rx_enable,
{"RX Enable","unistim.receive.enable",FT_BOOLEAN,
8,NULL,AUDIO_RX_ENABLE,NULL,HFILL}
},
{ &hf_audio_tx_enable,
{"TX Enable","unistim.transmit.enable",FT_BOOLEAN,
8,NULL,AUDIO_TX_ENABLE,NULL,HFILL}
},
{ &hf_audio_sidetone_disable,
{"Disable Sidetone","unistim.audio.sidetone.disable",FT_BOOLEAN,
8,NULL,AUDIO_SIDETONE_DISABLE,NULL,HFILL}
},
{ &hf_audio_destruct_additive,
{"Destructive/Additive","unistim.destructive.additive",FT_BOOLEAN,
8,TFS(&destruct_additive),AUDIO_DESTRUCT_ADD,NULL,HFILL}
},
{ &hf_audio_dont_force_active,
{"Don't Force Active","unistim.dont.force.active",FT_BOOLEAN,
8,TFS(&dont_force_active),AUDIO_DONT_FORCE_ACTIVE,NULL,HFILL}
},
{ &hf_display_line_width,
{"Phone Line Width","unistim.line.width",FT_UINT8,
BASE_DEC,NULL,DISPLAY_LINE_WIDTH,NULL,HFILL}
},
{ &hf_display_lines,
{"Number Of Lines","unistim.number.lines",FT_UINT8,
BASE_DEC,NULL,DISPLAY_LINES,NULL,HFILL}
},
{ &hf_display_softkey_width,
{"Phone Softkey Width","unistim.softkey.width",FT_UINT8,
BASE_DEC,NULL,DISPLAY_SKEY_WIDTH,NULL,HFILL}
},
{ &hf_display_softkeys,
{"Phone Softkeys","unistim.phone.softkeys",FT_UINT8,
BASE_DEC,NULL,DISPLAY_SKEYS,NULL,HFILL}
},
{ &hf_display_icon,
{"Phone Icon Type","unistim.phone.icon.type",FT_UINT8,
BASE_HEX,VALS(icon_types),DISPLAY_ICON,NULL,HFILL}
},
{ &hf_display_softlabel_key_width,
{"Soft-Label Key width","unistim.softlabel.key.width",FT_UINT8,
BASE_DEC,NULL,DISPLAY_SOFTLABEL_WIDTH,NULL,HFILL}
},
{ &hf_display_context_width,
{"Phone Context Width","unistim.context.width",FT_UINT8,
BASE_DEC,NULL,DISPLAY_CONTEXT_WIDTH,NULL,HFILL}
},
{ &hf_display_numeric_width,
{"Phone Numeric Width","unistim.numeric.width",FT_UINT8,
BASE_DEC,NULL,DISPLAY_NUMERIC_WIDTH,NULL,HFILL}
},
{ &hf_display_time_width,
{"Phone Time Width","unistim.time.width",FT_UINT8,
BASE_DEC,NULL,DISPLAY_TIME_WIDTH,NULL,HFILL}
},
{ &hf_display_date_width,
{"Phone Date Width","unistim.date.width",FT_UINT8,
BASE_DEC,NULL,DISPLAY_DATE_WIDTH,NULL,HFILL}
},
{ &hf_display_char_dload,
{"Number of Downloadable Chars","unistim.number.dload.chars",FT_UINT8,
BASE_DEC,NULL,DISPLAY_CHAR_DLOAD,NULL,HFILL}
},
{ &hf_display_freeform_icon_dload,
{"Number of Freeform Icon Downloads","unistim.number.dload.icons",FT_UINT8,
BASE_DEC,NULL,DISPLAY_FFORM_ICON_DLOAD,NULL,HFILL}
},
{ &hf_display_icon_type,
{"Icon Types","unistim.icon.types",FT_UINT8,
BASE_HEX,NULL,DISPLAY_ICON_TYPE,NULL,HFILL}
},
{ &hf_display_charsets,
{"Character Sets","unistim.phone.charsets",FT_UINT8,
BASE_HEX,NULL,DISPLAY_CHARSET,NULL,HFILL}
},
{ &hf_display_contrast,
{"Phone Contrast Level","unistim.phone.contrast.level",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_display_cursor_numeric,
{"Numeric Index Field","unistim.field.numeric",FT_BOOLEAN,
8,NULL,DISPLAY_CURSOR_NUMERIC,NULL,HFILL}
},
{ &hf_display_cursor_context,
{"Context Field","unistim.field.context",FT_BOOLEAN,
8,NULL,DISPLAY_CURSOR_CONTEXT,NULL,HFILL}
},
{ &hf_display_cursor_line,
{"Text Line","unistim.field.text.line",FT_BOOLEAN,
8,NULL,DISPLAY_CURSOR_LINE,NULL,HFILL}
},
{ &hf_display_cursor_softkey,
{"Softkey Position","unistim.position.skey",FT_BOOLEAN,
8,NULL,DISPLAY_CURSOR_SKEY,NULL,HFILL}
},
{ &hf_display_cursor_softkey_id,
{"Soft Key Id","unistim.cursor.skey.id",FT_UINT8,
BASE_DEC,NULL,DISPLAY_CURSOR_SKEY_ID,NULL,HFILL}
},
{ &hf_display_cursor_char_pos,
{"Character Position","unistim.phone.char.pos",FT_UINT8,
BASE_DEC,NULL,DISPLAY_CURSOR_CHAR_POS,NULL,HFILL}
},
{ &hf_display_cursor_line_number,
{"Display Line Number","unistim.display.line.number",FT_UINT8,
BASE_DEC,NULL,DISPLAY_CURSOR_LINE_NUM,NULL,HFILL}
},
{ &hf_display_hlight_start,
{"Display Highlight Start Position","unistim.hilite.start.pos",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_display_hlight_end,
{"Display Highlight End Position","unistim.hilite.end.pos",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_display_date_format,
{"Date Format","unistim.display.date.format",FT_UINT8,
BASE_HEX,VALS(date_formats),DISPLAY_DATE_FORMAT,NULL,HFILL}
},
{ &hf_display_time_format,
{"Time Format","unistim.display.time.format",FT_UINT8,
BASE_HEX,VALS(time_formats),DISPLAY_TIME_FORMAT,NULL,HFILL}
},
{ &hf_display_use_time_format,
{"Use Time Format","unistim.display.use.time.format",FT_BOOLEAN,
8,NULL,DISPLAY_USE_TIME_FORMAT,NULL,HFILL}
},
{ &hf_display_use_date_format,
{"Use Date Format","unistim.display.use.date.format",FT_BOOLEAN,
8,NULL,DISPLAY_USE_DATE_FORMAT,NULL,HFILL}
},
{ &hf_display_context_format,
{"Context Info Bar Format","unistim.display.context.format",FT_UINT8,
BASE_HEX,VALS(display_formats),DISPLAY_CTX_FORMAT,NULL,HFILL}
},
{ &hf_display_context_field,
{"Context Info Bar Field","unistim.display.context.field",FT_UINT8,
BASE_HEX,VALS(display_format_fields),DISPLAY_CTX_FIELD,NULL,HFILL}
},
{ &hf_display_char_address,
{"Display Character Address","unistim.display.char.address",FT_UINT8,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_display_layer_number,
{"Softkey Layer Number","unistim.softkey.layer.num",FT_UINT8,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_display_layer_skey_id,
{"Softkey ID","unistim.layer.softkey.id",FT_UINT8,
BASE_DEC,NULL,DISPLAY_LAYER_SKEY_ID,NULL,HFILL}
},
{ &hf_display_layer_all_skeys,
{"All Softkeys","unistim.layer.all.skeys",FT_BOOLEAN,
8,NULL,DISPLAY_LAYER_ALL_SKEYS,NULL,HFILL}
},
{ &hf_display_once_or_cyclic,
{"Layer Softkey Once/Cyclic","unistim.layer.once.cyclic",FT_BOOLEAN,
8,TFS(&once_or_cyclic),DISPLAY_ONE_OR_CYCLIC,NULL,HFILL}
},
{ &hf_display_layer_duration,
{"Display Duration (20ms steps)","unistim.layer.display.duration",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_key_programmable_keys,
{"Number of Programmable Keys","unistim.num.prog.keys",FT_UINT8,
BASE_DEC,NULL,KEY_NUM_PROG_KEYS,NULL,HFILL}
},
{ &hf_keys_soft_keys,
{"Number of Soft Keys","unistim.num.soft.keys",FT_UINT8,
BASE_DEC,NULL,KEY_NUM_SOFT_KEYS,NULL,HFILL}
},
{ &hf_keys_hd_key,
{"Headset Key Exists","unistim.exist.hd.key",FT_BOOLEAN,
8,NULL,KEY_HD_KEY_EXISTS,NULL,HFILL}
},
{ &hf_keys_mute_key,
{"Mute Key Exists","unistim.exist.mute.key",FT_BOOLEAN,
8,NULL,KEY_MUTE_KEY_EXISTS,NULL,HFILL}
},
{ &hf_keys_quit_key,
{"Quit Key Exists","unistim.exist.quit.key",FT_BOOLEAN,
8,NULL,KEY_QUIT_KEY_EXISTS,NULL,HFILL}
},
{ &hf_keys_copy_key,
{"Copy Key Exists","unistim.exist.copy.key",FT_BOOLEAN,
8,NULL,KEY_COPY_KEY_EXISTS,NULL,HFILL}
},
{ &hf_keys_mwi_key,
{"Message Waiting Indicator Exists","unistim.exist.mwi.key",FT_BOOLEAN,
8,NULL,KEY_MWI_EXISTS,NULL,HFILL}
},
{ &hf_keys_num_nav_keys,
{"Number of Navigation Keys","unistim.num.nav.keys",FT_UINT8,
BASE_DEC,VALS(number_nav_keys),KEY_NUM_NAV_KEYS,NULL,HFILL}
},
{ &hf_keys_num_conspic_keys,
{"Number Of Conspicuous Keys","unistim.num.conspic.keys",FT_UINT8,
BASE_DEC,NULL,KEY_NUM_CONSPIC_KEYS,NULL,HFILL}
},
{ &hf_keys_send_key_rel,
{"Send Key Release","unistim.key.send.release",FT_BOOLEAN,
8,TFS(&key_release),KEY_SEND_KEY_RELEASE,NULL,HFILL}
},
{ &hf_keys_enable_vol,
{"Enable Volume Control","unistim.key.enable.vol",FT_BOOLEAN,
8,TFS(&enable_vol),KEY_ENABLE_VOL_KEY,NULL,HFILL}
},
{ &hf_keys_conspic_prog_key,
{"Conspicuous and Programmable Keys Same","unistim.conspic.prog.keys",FT_BOOLEAN,
8,TFS(&conspic_prog),KEY_CONSPIC_PROG_KEY0,NULL,HFILL}
},
{ &hf_keys_acd_super_control,
{"ACD Supervisor Control","unistim.acd.super.control",FT_BOOLEAN,
8,TFS(&acd_supervisor),KEY_ACD_SUP_CONTROL,NULL,HFILL}
},
{ &hf_keys_local_dial_feedback,
{"Local Keypad Feedback","unistim.key.feedback",FT_UINT8,
BASE_HEX,VALS(local_dialpad_feedback),KEY_LOCAL_DIAL_PAD_FEED,NULL,HFILL}
},
{ &hf_audio_source_descr,
{"Source Description Item","unistim.source.desc.item",FT_UINT8,
BASE_HEX,VALS(source_descriptions),AUDIO_SOURCE_DESCRIPTION,NULL,HFILL}
},
{ &hf_audio_sdes_rtcp_bucket,
{"RTCP Bucket Id","unistim.sdes.rtcp.bucket",FT_UINT8,
BASE_HEX,NULL,AUDIO_SDES_RTCP_BUCKET,NULL,HFILL}
},
{ &hf_audio_desired_jitter,
{"Desired Jitter","unistim.audio.desired.jitter",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_high_water_mark,
{"Threshold of audio frames where jitter buffer removes frames","unistim.high.water.mark",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_early_packet_resync_thresh,
{"Threshold in x/8000 sec where packets are too early","unistim.early.packet.thresh",FT_UINT32,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_late_packet_resync_thresh,
{"Threshold in x/8000 sec where packets are too late","unistim.late.packet.thresh",FT_UINT32,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_resolve_phone_port,
{"Resolve Phone Port","unistim.resolve.phone.port",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_far_end_echo_port,
{"Resolve Far End Port","unistim.resolve.far.port",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_far_end_ip_address,
{"Resolve Far End IP","unistim.resolve.far.ip",FT_IPv4,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_nat_port,
{"NAT Port","unistim.audio.nat.port",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_nat_ip_address,
{"NAT IP Address","unistim.audio.nat.ip",FT_IPv4,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_direction_code,
{"Stream Direction Code","unistim.audio.direction.codes",FT_UINT8,
BASE_HEX,VALS(direction_codes),AUDIO_DIRECTION_CODE,NULL,HFILL}
},
{ &hf_audio_hf_support,
{"Handsfree supported","unistim.handsfree.support",FT_BOOLEAN,
8,NULL,AUDIO_HF_SUPPORT,NULL,HFILL}
},
{ &hf_audio_opt_rpt_max,
{"Max Volume","unistim.max.vol",FT_BOOLEAN,
8,TFS(&opt_rpt_enable_max_tone_vol),AUDIO_ENABLED_MAX_TONE,NULL,HFILL}
},
{ &hf_audio_opt_rpt_adj_vol,
{"Volume Adjustments","unistim.audio.volume.adj",FT_BOOLEAN,
8,TFS(&opt_rpt_adjust_volume),AUDIO_ENABLED_ADJ_VOL,NULL,HFILL}
},
{ &hf_audio_opt_rpt_auto_adj_vol,
{"Auto Adjust RX Volume","unistim.auto.adj.rx.vol",FT_BOOLEAN,
8,TFS(&opt_rpt_automatic_adjustable_rx_volume_report),
AUDIO_AUTO_ADJ_RX_REP,NULL,HFILL}
},
{ &hf_audio_opt_rpt_hs_on_air,
{"HS On Air","unistim.audio.hs.on.air",FT_BOOLEAN,
8,TFS(&opt_rpths_on_air_feature),AUDIO_HS_ON_AIR_FEATURE,NULL,HFILL}
},
{ &hf_audio_opt_rpt_hd_on_air,
{"HD On Air","unistim.audio.hd.on.air",FT_BOOLEAN,
8,TFS(&opt_rpt_hd_on_air_feature),AUDIO_HD_ON_AIR_FEATURE,NULL,HFILL}
},
{ &hf_audio_opt_rpt_noise_squelch,
{"Automatic Squelch","unistim.auto.noise.squelch",FT_BOOLEAN,
8,TFS(&opt_rpt_noise_sqlch_disable),AUDIO_NOISE_SQUELCH_DIS,NULL,HFILL}
},
{ &hf_audio_rx_vol_apb_rpt,
{"APB Volume Report","unistim.apb.volume.rpt",FT_UINT8,
BASE_HEX,VALS(volume_rpt_apbs),AUDIO_APB_VOL_RPT,NULL,HFILL}
},
{ &hf_audio_rx_vol_vol_up,
{"Volume Up","unistim.audio.volume.up",FT_BOOLEAN,
8,NULL,AUDIO_VOL_UP_RPT,NULL,HFILL}
},
{ &hf_audio_rx_vol_vol_floor,
{"RX Volume at Floor","unistim.audio.rx.vol.floor",FT_BOOLEAN,
8,NULL,AUDIO_VOL_FLR_RPT,NULL,HFILL}
},
{ &hf_audio_rx_vol_vol_ceiling,
{"RX Volume at Ceiling","unistim.audio.rx.vol.ceiling",FT_BOOLEAN,
8,NULL,AUDIO_VOL_CEIL_RPT,NULL,HFILL}
},
{ &hf_audio_current_adj_vol_id,
{"Current APB Volume Report","unistim.current.volume.rpt",FT_UINT8,
BASE_HEX,VALS(volume_rpt_apbs),AUDIO_APB_VOL_RPT,NULL,HFILL}
},
{ &hf_audio_current_rx_level,
{"Current RX Volume Level","unistim.current.rx.vol.level",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_current_rx_range,
{"Current RX Volume Range","unistim.current.rx.vol.range",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_cadence_select,
{"Alerting Cadence Select","unistim.alert.cad.sel",FT_UINT8,
BASE_HEX,NULL,AUDIO_ALERT_CADENCE_SEL,NULL,HFILL}
},
{ &hf_audio_warbler_select,
{"Alerting Warbler Select","unistim.alert.warb.select",FT_UINT8,
BASE_HEX,NULL,AUDIO_ALERT_WARBLER_SEL,NULL,HFILL}
},
{ &hf_audio_open_stream_rpt,
{"Open Stream Report","unistim.open.audio.stream.rpt",FT_UINT8,
BASE_HEX,VALS(stream_result),0x00,NULL,HFILL}
},
{ &hf_audio_sdes_rpt_source_desc,
{"Report Source Description","unistim.rpt.src.desc",FT_UINT8,
BASE_HEX,VALS(source_descipts),AUDIO_SDES_INFO_RPT_DESC,NULL,HFILL}
},
{ &hf_audio_sdes_rpt_buk_id,
{"Report RTCP Bucket ID","unistim.rpt.rtcp.buk.id",FT_UINT8,
BASE_HEX,NULL,AUDIO_SDES_INFO_RPT_BUK,NULL,HFILL}
},
{ &hf_audio_phone_port,
{"Phone Listen Port","unistim.phone.listen.port",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_phone_ip,
{"Phone Listen Address","unistim.phone.listen.address",FT_IPv4,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_phone_add_len,
{"Phone Address Length","unistim.phone.address.len",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_nat_listen_port,
{"NAT Listen Port","unistim.nat.listen.port",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_nat_ip,
{"NAT Listen Address","unistim.nat.listen.address",FT_IPv4,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_nat_add_len,
{"NAT Address Length","unistim.nat.address.len",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_audio_stream_direction_code,
{"Audio Stream Direction","unistim.audio.stream.direction",FT_UINT8,
BASE_HEX,VALS(stream_direction_codes),AUDIO_STREAM_DIRECTION,NULL,HFILL}
},
{ &hf_audio_stream_state,
{"Audio Stream State","unistim.audio.stream.state",FT_BOOLEAN,
8,TFS(&stream_states),AUDIO_STREAM_STATE,NULL,HFILL}
},
{ &hf_audio_transducer_list_length,
{"Transducer List Length","unistim.trans.list.len",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_net_file_xfer_mode,
{"File Transfer Mode","unistim.net.file.xfer.mode",FT_UINT8,
BASE_HEX,VALS(file_xfer_modes),NETWORK_FILE_XFER_MODE,NULL,HFILL}
},
{ &hf_net_force_download ,
{"Force Download","unistim.net.force.download",FT_BOOLEAN,
8,NULL,NETWORK_FORCE_DLOAD,NULL,HFILL}
},
{ &hf_net_use_file_server_port,
{"Use Custom Server Port","unistim.net.use.server.port",FT_BOOLEAN,
8,NULL,NETWORK_USE_FSERV_PORT,NULL,HFILL}
},
{ &hf_net_use_local_port,
{"Use Custom Local Port","unistim.net.use.local.port",FT_BOOLEAN,
8,NULL,NETWORK_USE_LOCAL_PORT,NULL,HFILL}
},
{ &hf_net_file_server_port,
{"File Server Port","unistim.net.file.server.port",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_net_full_pathname,
{"Full Pathname","unistim.net.full_pathname",FT_STRINGZ,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_net_file_identifier,
{"File Identifier","unistim.net.file_identifier",FT_STRINGZ,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_net_local_port,
{"Local XFer Port","unistim.net.local.xfer.port",FT_UINT16,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_net_file_server_address,
{"File Server IP Address","unistim.net.file.server.address",FT_IPv4,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_keys_admin_command,
{"Admin Command","unistim.key.icon.admin.cmd",FT_UINT8,
BASE_HEX,VALS(admin_commands),KEY_ADMIN_CMD,NULL,HFILL}
},
{ &hf_keys_logical_icon_id,
{"Logical Icon ID","unistim.keys.logical.icon.id",FT_UINT16,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_keys_repeat_timer_one,
{"Key Repeat Timer 1 Value","unistim.keys.repeat.time.one",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_keys_repeat_timer_two,
{"Key Repeat Timer 2 Value","unistim.keys.repeat.time.two",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_keys_led_id,
{"Led ID","unistim.keys.led.id",FT_UINT8,
BASE_HEX,VALS(keys_led_ids),0x00,NULL,HFILL}
},
{ &hf_keys_phone_icon_id,
{"Phone Icon ID","unistim.keys.phone.icon.id",FT_UINT8,
BASE_HEX,NULL,0x00,NULL,HFILL}
},
{ &hf_keys_cadence_on_time,
{"Indicator Cadence On Time","unistim.keys.cadence.on.time",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_keys_cadence_off_time,
{"Indicator Cadence Off Time","unistim.keys.cadence.off.time",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_keys_user_activity_timeout,
{"User Activity Timeout Value","unistim.keys.user.timeout.value",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
{ &hf_display_call_timer_mode,
{"Call Timer Mode","unistim.display.call.timer.mode",FT_BOOLEAN,
8,TFS(&call_duration_timer_mode),DISPLAY_CALL_TIMER_MODE,NULL,HFILL}
},
{ &hf_display_call_timer_reset,
{"Call Timer Reset","unistim.display.call.timer.reset",FT_BOOLEAN,
8,TFS(&call_duration_timer_reset),DISPLAY_CALL_TIMER_RESET,NULL,HFILL}
},
{ &hf_display_call_timer_display,
{"Call Timer Display","unistim.display.call.timer.display",FT_BOOLEAN,
8,TFS(&call_duration_display_timer),DISPLAY_CALL_TIMER_DISPLAY,NULL,HFILL}
},
{ &hf_display_call_timer_delay,
{"Call Timer Delay","unistim.display.call.timer.delay",FT_BOOLEAN,
8,TFS(&call_duration_timer_delay),DISPLAY_CALL_TIMER_DELAY,NULL,HFILL}
},
{ &hf_display_call_timer_id,
{"Call Timer ID","unistim.display.call.timer.id",FT_UINT8,
BASE_DEC,NULL,DISPLAY_CALL_TIMER_ID,NULL,HFILL}
},
{ &hf_expansion_switch_cmd,
{"Expansion CMD (switch)","unistim.expansion.switch",FT_UINT8,
BASE_HEX,VALS(expansion_switch_msgs),0x0,NULL,HFILL}
},
{ &hf_expansion_phone_cmd,
{"Expansion CMD (phone)","unistim.expansion.phone",FT_UINT8,
BASE_HEX,VALS(expansion_phone_msgs),0x0,NULL,HFILL}
},
{ &hf_module_key_number,
{"Module Key Number","unistim.module.key.number",FT_INT32,
BASE_DEC,NULL,0x0,NULL,HFILL}
},
{ &hf_expansion_softlabel_number,
{"Module Soft Label Number","unistim.expansion.label.number",FT_UINT8,
BASE_DEC,NULL,0x00,NULL,HFILL}
},
/****LAST****/
{ &hf_generic_string,
{"DATA","unistim.generic.string_data",FT_STRING,
BASE_NONE,NULL,0x00,NULL,HFILL}
},
{ &hf_generic_data,
{"DATA","unistim.generic.data",FT_BYTES,
BASE_NONE,NULL,0x00,NULL,HFILL}
}
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_unistim
};
static ei_register_info ei[] = {
{ &ei_unistim_len, { "unistim.len.bad", PI_MALFORMED, PI_ERROR, "Length too short", EXPFILL }},
};
expert_module_t* expert_unistim;
proto_unistim=proto_register_protocol("UNISTIM Protocol", "UNISTIM", "unistim");
unistim_handle=register_dissector("unistim", dissect_unistim,proto_unistim);
proto_register_subtree_array(ett,array_length(ett));
proto_register_field_array(proto_unistim,hf,array_length(hf));
expert_unistim = expert_register_protocol(proto_unistim);
expert_register_field_array(expert_unistim, ei, array_length(ei));
unistim_tap = register_tap("unistim");
}
void
proto_reg_handoff_unistim(void) {
dissector_add_for_decode_as_with_preference("udp.port", unistim_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 3
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=3 tabstop=8 expandtab:
* :indentSize=3:tabSize=8:noTabs=true:
*/ |
C/C++ | wireshark/plugins/epan/unistim/packet-unistim.h | /* packet-unistim.h
* header field declarations, value_string definitions, true_false_string
* definitions and function prototypes for main dissectors
* Copyright 2007 Don Newton <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef PACKET_UNISTIM_H
#define PACKET_UNISTIM_H
typedef struct _unistim_info_t
{
guint8 rudp_type; /* NAK, ACK, Payload */
guint8 payload_type; /* unistim payload type (aggregate, non-aggregate, encapsulated) */
guint32 sequence; /* rudp sequence number */
guint32 termid; /* termid if available */
address it_ip; /* IP addr of it, determined by who is sending termids */
guint32 it_port; /* port of it (phone) */
address ni_ip; /* IP addr of ni (server) as determined by who's sending termids */
gint key_val; /* actual key pressed (-1 if not used) */
gint key_state; /* Key state 1=down 0=up */
gint hook_state; /* Hook state 1=offhook 0=onhook */
gint stream_connect; /* Audio stream connect 1=connect 0=disconnect */
gint trans_connect; /* Transducer connect? 1=connect 0=disconnect */
gint set_termid; /* Set the termid 1=set termid */
const guint8 *string_data; /* Any time a string is written to the display, this has the string */
gint call_state; /* Not used? */
guchar *key_buffer; /* Used in voip-calls.c tap, holds call keys pressed */
} unistim_info_t;
#endif |
wireshark/plugins/epan/unistim/TODO | * Add addr/cmd decoding to the summary line and info column
* Handle msg_len consistently
* Split up ett_unistim for various purposes |
|
C/C++ | wireshark/plugins/epan/unistim/uftp.h | /* uftp.h
* header field declarations, value_string def and true_false_string
* definitions for uftp commands and messages
* Copyright 2007 Chad Singer <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef UNISTIM_UFTP_H
#define UNISTIM_UFTP_H
static int hf_uftp_datablock_size=-1;
static int hf_uftp_datablock_limit=-1;
static int hf_uftp_filename=-1;
static int hf_uftp_datablock=-1;
static int hf_uftp_command=-1;
static const value_string uftp_commands[]={
{0x00,"Connection Granted"},
{0x01,"Connection Denied"},
{0x02,"File Data Block"},
{0x80,"Connection Request"},
{0x81,"Connection Details"},
{0x82,"Flow Control Off"},
{0,NULL}
};
#endif |
wireshark/plugins/epan/wimax/.editorconfig | #
# Editor configuration
#
# https://editorconfig.org/
#
[msg_dlmap.[ch]]
indent_style = tab
indent_size = tab |
|
wireshark/plugins/epan/wimax/AUTHORS | Authors:
Lu Pan <[email protected]>
Mike Harvey <[email protected]>
John R. Underwood <[email protected]>
Daniel J. Sauble <[email protected]> |
|
Text | wireshark/plugins/epan/wimax/CMakeLists.txt | # CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <[email protected]>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
include(WiresharkPlugin)
# Plugin name and version info (major minor micro extra)
set_module_info(wimax 1 2 0 0)
set(DISSECTOR_SRC
packet-m2m.c
packet-wmx.c
)
set(DISSECTOR_SUPPORT_SRC
wimax_ffb_decoder.c
wimax_fch_decoder.c
wimax_pdu_decoder.c
wimax_cdma_code_decoder.c
wimax_hack_decoder.c
wimax_phy_attributes_decoder.c
mac_hd_generic_decoder.c
mac_hd_type1_decoder.c
mac_hd_type2_decoder.c
mac_mgmt_msg_decoder.c
msg_dcd.c
msg_ucd.c
msg_dlmap.c
msg_ulmap.c
msg_rng_req.c
msg_rng_rsp.c
msg_reg_req.c
msg_reg_rsp.c
msg_dreg.c
msg_dsa.c
msg_dsc.c
msg_dsd.c
msg_arq.c
msg_sbc.c
msg_pkm.c
msg_aas_fbck.c
msg_fpc.c
msg_pmc.c
msg_prc_lt_ctrl.c
msg_aas_beam.c
msg_res_cmd.c
msg_rep.c
msg_clk_cmp.c
msg_dsx_rvd.c
wimax_harq_map_decoder.c
wimax_compact_dlmap_ie_decoder.c
wimax_compact_ulmap_ie_decoder.c
wimax_utils.c
crc.c
crc_data.c
wimax_tlv.c
)
set(PLUGIN_FILES
plugin.c
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
)
set_source_files_properties(
${PLUGIN_FILES}
PROPERTIES
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
)
register_plugin_files(plugin.c
plugin
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
)
add_wireshark_plugin_library(wimax epan)
target_link_libraries(wimax epan)
install_plugin(wimax epan)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
wimax
SWITCHES
--group dissectors-prohibited
--group dissectors-restricted
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_SUPPORT_SRC}
${DISSECTOR_HEADERS}
)
#
# Editor modelines - https://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
# |
C | wireshark/plugins/epan/wimax/crc.c | /* crc.c
* crc checksum generation and calculation functions: crc.c
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Mike Harvey <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "crc.h"
#define WMAX_MAC_CRC32_POLYNOMIAL 0x04c11db7U /* polynomial used in calculating the CRC-32 checksum */
#define CCITT_X25_CRC16_POLYNOMIAL 0x1021 /* polynomial used in calculating the CRC-16 checksum */
#define WMAX_MAC_CRC8_POLYNOMIAL 0x07 /* polynomial used in calculating the CRC-8 checksum */
#define CRC32_INITIAL_VALUE 0xFFFFFFFF
#define CRC16_INITIAL_VALUE 0xFFFF
#ifndef STATIC_DATA
static guint8 crc8_table[256];
static guint32 crc32_table[256];
extern guint16 crc16_table[256];
/*
void wimax_mac_gen_crc32_table(void)
REQUIRES: The functions must be called only once to initialze CRC table
DESCRIPTION: Generate the table of CRC remainders
for all possible bytes
ARGS:
RETURNS:
SIDE EFFECTS:
*/
void wimax_mac_gen_crc32_table(void)
{
guint32 i, bit;
guint32 crc;
/* little-endian (reflected) algorithm */
for ( i = 0; i < G_N_ELEMENTS(crc32_table); i++ )
{
crc = ( i << 24 );
for ( bit = 0; bit < 8; bit++ )
{
if ( crc & 0x80000000U )
crc = ( crc << 1 ) ^ WMAX_MAC_CRC32_POLYNOMIAL;
else
crc = ( crc << 1 );
}
crc32_table[i] = crc;
}
}
/*
void wimax_mac_gen_crc8_table(void)
REQUIRES: The functions must be called only once to initialze CRC table
DESCRIPTION: Generate the table of CRC remainders
for all possible bytes
ARGS:
RETURNS:
SIDE EFFECTS:
*/
void wimax_mac_gen_crc8_table(void)
{
guint i, bit;
guint8 crc;
for ( i = 0; i < G_N_ELEMENTS(crc8_table); i++ )
{
crc = i;
for ( bit = 0; bit < 8; bit++ )
{
if ( crc & 0x80 )
crc = ( crc << 1 ) ^ WMAX_MAC_CRC8_POLYNOMIAL;
else
crc = ( crc << 1 );
}
crc8_table[i] = crc;
}
}
#endif
/*
guint32 wimax_mac_calc_crc32(guint8 *data, guint data_len)
REQUIRES: wimax_mac_gen_crc32_table() must be called before
DESCRIPTION: Calculate the 32-bit CRC from a given data block
ARGS: data - pointer to data
data_len - length of data (in bytes)
RETURNS: calculated crc32
SIDE EFFECTS:
*/
guint32 wimax_mac_calc_crc32(const guint8 *data, guint data_len)
{
guint32 crc=CRC32_INITIAL_VALUE;
guint i, j;
for ( j = 0; j < data_len; j++ )
{
i = ( (guint8)(crc>>24) ^ data[j] ) & 0xff;
crc = ( crc<<8 ) ^ crc32_table[i];
}
return ~crc;
}
/*
guint16 wimax_mac_calc_crc16(guint8 *data, guint data_len)
REQUIRES: crc16_table[] in crc_data.c
DESCRIPTION: Calculate the 16-bit CRC from a given data block
ARGS: data - pointer to data
data_len - length of data (in bytes)
RETURNS: calculated crc16
SIDE EFFECTS:
*/
guint16 wimax_mac_calc_crc16(const guint8 *data, guint data_len)
{
guint32 crc=CRC16_INITIAL_VALUE;
guint j;
for ( j = 0; j < data_len; j++ )
{
crc ^= data[j] << 8;
crc = (crc << 8) ^ crc16_table[(crc & 0xff00) >> 8];
}
crc ^= 0xFFFF; /* Invert the output. */
crc &= 0xFFFF;
return crc;
}
/*
guint8 wimax_mac_calc_crc8(guint8 *data, guint data_len)
REQUIRES: wimax_mac_gen_crc8_table() must be called before
DESCRIPTION: Calculate the 8-bit CRC from a given data block
ARGS: data - pointer to data
data_len - length of data (in bytes)
RETURNS: calculated crc8
SIDE EFFECTS:
*/
guint8 wimax_mac_calc_crc8(const guint8 *data, guint data_len)
{
guint8 crc=0;
guint i;
for(i = 0; i < data_len; i++)
{
crc = crc8_table[data[i]^crc];
}
return crc;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/ |
C/C++ | wireshark/plugins/epan/wimax/crc.h | /* crc.h
* header file of crc.c
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Mike Harvey <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef CRC_H
#define CRC_H
#include <glib.h>
/* use lookup tables to compute CRC values */
#ifdef STATIC_DATA
extern guint8 crc8_table[];
extern guint32 crc32_table[];
#else
void wimax_mac_gen_crc32_table(void);
void wimax_mac_gen_crc8_table(void);
#endif
guint32 wimax_mac_calc_crc32(const guint8 *data, guint data_len);
guint16 wimax_mac_calc_crc16(const guint8 *data, guint data_len);
guint8 wimax_mac_calc_crc8(const guint8 *data, guint data_len);
#endif /* CRC_H */ |
C | wireshark/plugins/epan/wimax/crc_data.c | /* crc_data.c
* static crc tables for crc.c
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Mike Harvey <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "crc.h"
#ifdef STATIC_DATA
#include <glib.h>
guint32 crc32_table[256] = {
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011,
0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81,
0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49,
0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae,
0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066,
0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e,
0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686,
0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f,
0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47,
0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7,
0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f,
0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f,
0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30,
0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088,
0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0,
0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
};
guint8 hcs_table[256] = {
0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15,
0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d,
0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65,
0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d,
0xe0, 0xe7, 0xee, 0xe9, 0xfc, 0xfb, 0xf2, 0xf5,
0xd8, 0xdf, 0xd6, 0xd1, 0xc4, 0xc3, 0xca, 0xcd,
0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b, 0x82, 0x85,
0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba, 0xbd,
0xc7, 0xc0, 0xc9, 0xce, 0xdb, 0xdc, 0xd5, 0xd2,
0xff, 0xf8, 0xf1, 0xf6, 0xe3, 0xe4, 0xed, 0xea,
0xb7, 0xb0, 0xb9, 0xbe, 0xab, 0xac, 0xa5, 0xa2,
0x8f, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9d, 0x9a,
0x27, 0x20, 0x29, 0x2e, 0x3b, 0x3c, 0x35, 0x32,
0x1f, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0d, 0x0a,
0x57, 0x50, 0x59, 0x5e, 0x4b, 0x4c, 0x45, 0x42,
0x6f, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7d, 0x7a,
0x89, 0x8e, 0x87, 0x80, 0x95, 0x92, 0x9b, 0x9c,
0xb1, 0xb6, 0xbf, 0xb8, 0xad, 0xaa, 0xa3, 0xa4,
0xf9, 0xfe, 0xf7, 0xf0, 0xe5, 0xe2, 0xeb, 0xec,
0xc1, 0xc6, 0xcf, 0xc8, 0xdd, 0xda, 0xd3, 0xd4,
0x69, 0x6e, 0x67, 0x60, 0x75, 0x72, 0x7b, 0x7c,
0x51, 0x56, 0x5f, 0x58, 0x4d, 0x4a, 0x43, 0x44,
0x19, 0x1e, 0x17, 0x10, 0x05, 0x02, 0x0b, 0x0c,
0x21, 0x26, 0x2f, 0x28, 0x3d, 0x3a, 0x33, 0x34,
0x4e, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5c, 0x5b,
0x76, 0x71, 0x78, 0x7f, 0x6a, 0x6d, 0x64, 0x63,
0x3e, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2c, 0x2b,
0x06, 0x01, 0x08, 0x0f, 0x1a, 0x1d, 0x14, 0x13,
0xae, 0xa9, 0xa0, 0xa7, 0xb2, 0xb5, 0xbc, 0xbb,
0x96, 0x91, 0x98, 0x9f, 0x8a, 0x8d, 0x84, 0x83,
0xde, 0xd9, 0xd0, 0xd7, 0xc2, 0xc5, 0xcc, 0xcb,
0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3
};
#endif
guint16 crc16_table[256] = {
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0,
};
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/ |
C | wireshark/plugins/epan/wimax/mac_hd_generic_decoder.c | /* mac_hd_generic_decoder.c
* WiMax Generic MAC Header decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* TODO: Add FT_UINT24 and FT_INT24 cases to gtk_widget_get_toplevel()
* to prevent having to make all the changes from BASE_DEC to BASE_HEX
* made to this file today: 10/20/06.
*/
/* Include files */
#include "config.h"
/*
#define DEBUG
*/
#include <string.h>
#include <epan/packet.h>
#include <epan/expert.h>
#include <epan/reassemble.h>
#include "crc.h"
#include "wimax-int.h"
#include "wimax_utils.h"
void proto_reg_handoff_mac_header_generic(void);
extern gint proto_wimax;
extern gint seen_a_service_type;
extern gboolean first_gmh; /* defined in wimax_pdu_decoder.c */
extern gint8 arq_enabled; /* declared in packet-wmx.c */
extern gint scheduling_service_type; /* 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 */
static dissector_handle_t mac_mgmt_msg_decoder_handle = NULL;
static dissector_handle_t mac_ip_handle = NULL;
/* global variables */
gboolean include_cor2_changes = FALSE;
/* Well-known CIDs */
guint cid_initial_ranging = 0x0000;
guint global_cid_max_basic = 320;
guint cid_max_primary = 640;
guint cid_aas_ranging = 0xFeFF;
guint cid_normal_multicast = 0xFFFa;
guint cid_sleep_multicast = 0xFFFb;
guint cid_idle_multicast = 0xFFFc;
guint cid_frag_broadcast = 0xFFFd;
guint cid_padding = 0xFFFe;
guint cid_broadcast = 0xFFFF;
/* Maximum number of CID's */
#define MAX_CID 64
/* forward reference */
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);
/* Static variables */
static reassembly_table payload_reassembly_table;
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_mesh_subheader_decoder = -1;
static gint ett_mac_frag_subheader_decoder = -1;
static gint ett_mac_grant_mgmt_subheader_decoder = -1;
static gint ett_mac_pkt_subheader_decoder = -1;
static gint ett_mac_fast_fb_subheader_decoder = -1;
static gint ett_mac_ext_subheader_decoder = -1;
static gint ett_mac_ext_subheader_dl_decoder = -1;
static gint ett_mac_ext_subheader_ul_decoder = -1;
static gint ett_mac_arq_fb_payload_decoder = -1;
static gint ett_mac_data_pdu_decoder = -1;
static gint hf_mac_header_generic_value_bytes = -1;
static guint frag_type, frag_len;
static guint extended_type, arq_fb_payload, seq_number;
static guint cid_adjust[MAX_CID]; /* Must not start with 0 */
static guint cid_vernier[MAX_CID];
static guint cid_adj_array_size = 0;
static guint *cid_adj_array = NULL;
static guint8 *frag_num_array = NULL;
static address save_src;
static address save_dst;
#define WIMAX_MAC_HEADER_SIZE 6
#define IP_HEADER_BYTE 0x45
#define EXTENDED_SUB_HEADER_RSV_MASK 0x80
#define EXTENDED_SUB_HEADER_TYPE_MASK 0x7F
/* WIMAX GENERIC MAC HEADER FIELDS (figure 19) */
/* 1st to 3rd bytes */
#define WIMAX_MAC_HEADER_GENERIC_HT 0x800000
#define WIMAX_MAC_HEADER_GENERIC_EC 0x400000
#define WIMAX_MAC_HEADER_GENERIC_TYPE_5 0x200000
#define WIMAX_MAC_HEADER_GENERIC_TYPE_4 0x100000
#define WIMAX_MAC_HEADER_GENERIC_TYPE_3 0x080000
#define WIMAX_MAC_HEADER_GENERIC_TYPE_2 0x040000
#define WIMAX_MAC_HEADER_GENERIC_TYPE_1 0x020000
#define WIMAX_MAC_HEADER_GENERIC_TYPE_0 0x010000
#define WIMAX_MAC_HEADER_GENERIC_ESF 0x008000
#define WIMAX_MAC_HEADER_GENERIC_CI 0x004000
#define WIMAX_MAC_HEADER_GENERIC_EKS 0x003000
#define WIMAX_MAC_HEADER_GENERIC_RSV 0x000800
#define WIMAX_MAC_HEADER_GENERIC_LEN 0x0007FF
/* WIMAX GENERIC MAC HEADER 1st byte masks */
#define WIMAX_MAC_HEADER_GENERIC_HT_MASK 0x80
#define WIMAX_MAC_HEADER_GENERIC_EC_MASK 0x40
#define WIMAX_MAC_HEADER_GENERIC_TYPE_MASK 0x3F
/* WiMax Generic MAC Header Sub Type Masks */
#define GENERIC_SUB_TYPE_0 0x01
#define GENERIC_SUB_TYPE_1 0x02
#define GENERIC_SUB_TYPE_2 0x04
#define GENERIC_SUB_TYPE_3 0x08
#define GENERIC_SUB_TYPE_4 0x10
#define GENERIC_SUB_TYPE_5 0x20
/* WIMAX GENERIC MAC HEADER 2nd byte masks */
#define WIMAX_MAC_HEADER_GENERIC_ESF_MASK 0x80
#define WIMAX_MAC_HEADER_GENERIC_CI_MASK 0x40
#define WIMAX_MAC_HEADER_GENERIC_EKS_MASK 0x30
#define WIMAX_MAC_HEADER_GENERIC_LEN_MASK 0x07
static int hf_mac_header_generic_ht = -1;
static int hf_mac_header_generic_ec = -1;
static int hf_mac_header_generic_type_0 = -1;
static int hf_mac_header_generic_type_1 = -1;
static int hf_mac_header_generic_type_2 = -1;
static int hf_mac_header_generic_type_3 = -1;
static int hf_mac_header_generic_type_4 = -1;
static int hf_mac_header_generic_type_5 = -1;
static int hf_mac_header_generic_esf = -1;
static int hf_mac_header_generic_ci = -1;
static int hf_mac_header_generic_eks = -1;
static int hf_mac_header_generic_rsv = -1;
static int hf_mac_header_generic_len = -1;
static int hf_mac_header_generic_cid = -1;
static int hf_mac_header_generic_hcs = -1;
static int hf_mac_header_generic_crc = -1;
static int hf_mac_header_generic_crc_status = -1;
/* MAC Header types */
static const value_string ht_msgs[] =
{
{ 0, "Generic" },
{ 1, "Signaling" },
{ 0, NULL}
};
/* Encryption Controls */
static const value_string ec_msgs[] =
{
{ 0, "Not encrypted" },
{ 1, "Encrypted" },
{ 0, NULL}
};
/* ESF messages */
static const value_string esf_msgs[] =
{
{ 0, "Extended subheader is absent" },
{ 1, "Extended subheader is present" },
{ 0, NULL}
};
/* CRC Indicator messages */
static const value_string ci_msgs[] =
{
{ 0, "No CRC is included" },
{ 1, "CRC is included" },
{ 0, NULL}
};
/* Sub-Type message 0 */
static const value_string type_msg0[] =
{
{ 0, "Fast-feedback allocation subheader(DL)/Grant management subheader(UL) is absent" },
{ 1, "Fast-feedback allocation subheader(DL)/Grant management subheader(UL) is present" },
{ 0, NULL}
};
/* Sub-Type message 1 */
static const value_string type_msg1[] =
{
{ 0, "Packing subheader is absent" },
{ 1, "Packing Subheader is present" },
{ 0, NULL}
};
/* Sub-Type message 2 */
static const value_string type_msg2[] =
{
{ 0, "Fragmentation subheader is absent" },
{ 1, "Fragmentation subheader is present" },
{ 0, NULL}
};
/* Sub-Type message 3 */
static const value_string type_msg3[] =
{
{ 0, "The subheader is not extended" },
{ 1, "The subheader is extended" },
{ 0, NULL}
};
/* Sub-Type message 4 */
static const value_string type_msg4[] =
{
{ 0, "ARQ feedback payload is absent" },
{ 1, "ARQ feedback payload is present" },
{ 0, NULL}
};
/* Sub-Type message 5 */
static const value_string type_msg5[] =
{
{ 0, "Mesh subheader is absent" },
{ 1, "Mesh subheader is present" },
{ 0, NULL}
};
/* Fast-Feedback Feedback Types */
static const value_string fast_fb_types[] =
{
{ 0, "Fast DL measurement" },
{ 1, "Fast MIMO Feedback, Antenna #0" },
{ 2, "Fast MIMO Feedback, Antenna #1" },
{ 3, "MIMO Mode and Permutation Mode Feedback" },
{ 0, NULL}
};
/* Extended sub-headers */
/* DL sub-header types */
typedef enum
{
SDU_SN,
DL_SLEEP_CONTROL,
FEEDBACK_REQ,
SN_REQ,
PDU_SN_SHORT_DL,
PDU_SN_LONG_DL
} DL_EXT_SUBHEADER_e;
static const value_string dl_ext_sub_header_type[] =
{
{0, "SDU_SN"},
{1, "DL Sleep Control"},
{2, "Feedback Request"},
{3, "SN Request"},
{4, "PDU SN (short)"},
{5, "PDU SN (long)"},
{0, NULL}
};
/* DL Sleep Control Extended Subheader field masks (table 13e) */
#define DL_SLEEP_CONTROL_POWER_SAVING_CLASS_ID_MASK 0xFC0000 /*0x00003F*/
#define DL_SLEEP_CONTROL_OPERATION_MASK 0x020000 /*0x000040*/
#define DL_SLEEP_CONTROL_FINAL_SLEEP_WINDOW_EXPONENT_MASK 0x01C000 /*0x000380*/
#define DL_SLEEP_CONTROL_FINAL_SLEEP_WINDOW_BASE_MASK 0x003FF0 /*0x0FFC00*/
#define DL_SLEEP_CONTROL_RESERVED_MASK 0x00000F /*0xF00000*/
/* Feedback Request Extended Subheader field masks (table 13f) */
#define FEEDBACK_REQUEST_UIUC_MASK 0xF00000 /*0x00000F*/
#define FEEDBACK_REQUEST_FEEDBACK_TYPE_MASK 0x0F0000 /*0x0000F0*/
#define FEEDBACK_REQUEST_OFDMA_SYMBOL_OFFSET_MASK 0x00FC00 /*0x003F00*/
#define FEEDBACK_REQUEST_SUBCHANNEL_OFFSET_MASK 0x0003F0 /*0x0FC000*/
#define FEEDBACK_REQUEST_NUMBER_OF_SLOTS_MASK 0x00000E /*0x700000*/
#define FEEDBACK_REQUEST_FRAME_OFFSET_MASK 0x000001 /*0x800000*/
/* OFDMA UIUC Values ??? */
static const value_string uiuc_values[] =
{
{ 0, "Fast-Feedback Channel" },
{ 1, "Burst Profile 1" },
{ 2, "Burst Profile 2" },
{ 3, "Burst Profile 3" },
{ 4, "Burst Profile 4" },
{ 5, "Burst Profile 5" },
{ 6, "Burst Profile 6" },
{ 7, "Burst Profile 7" },
{ 8, "Burst Profile 8" },
{ 9, "Burst Profile 9" },
{ 10, "Burst Profile 10" },
{ 11, "Extended UIUC 2 IE" },
{ 12, "CDMA Bandwidth Request, CDMA Ranging" },
{ 13, "PAPR Reduction Allocation, Safety Zone" },
{ 14, "CDMA Allocation IE" },
{ 15, "Extended UIUC" },
{ 0, NULL}
};
/* UL sub-header types */
typedef enum
{
MIMO_MODE_FEEDBACK,
UL_TX_POWER_REPORT,
MINI_FEEDBACK,
PDU_SN_SHORT_UL,
PDU_SN_LONG_UL
} UL_EXT_SUBHEADER_e;
static const value_string ul_ext_sub_header_type[] =
{
{0, "MIMO Mode Feedback"},
{1, "UL TX Power Report"},
{2, "Mini-feedback"},
{3, "PDU SN (short)"},
{4, "PDU SN (long)"},
{0, NULL}
};
/* MIMO Mode Feedback Extended Subheader field masks (table 13g) */
#define MIMO_FEEDBACK_TYPE_MASK 0xC0 /*0x03*/
#define MIMO_FEEDBACK_CONTENT_MASK 0x3F /*0xFC*/
/* Mimo Feedback Types ??? */
static const value_string mimo_fb_types[] =
{
{ 0, "Fast DL measurement" },
{ 1, "Default Feedback with Antenna Grouping" },
{ 2, "Antenna Selection and Reduced Codebook" },
{ 3, "Quantized Precoding Weight Feedback" },
{ 0, NULL}
};
/* MNI-Feedback Extended Subheader field masks (table 13i) */
#define MINI_FEEDBACK_TYPE_MASK 0xF000 /*0x000F*/
#define MINI_FEEDBACK_CONTENT_MASK 0x0FFF /*0xFFF0*/
/* Feedback Types */
static const value_string fb_types[] =
{
{ 0, "CQI and MIMO Feedback" },
{ 1, "DL average CINR" },
{ 2, "MIMO Coefficients Feedback" },
{ 3, "Preferred DL Channel DIUC Feedback" },
{ 4, "UL Transmission Power" },
{ 5, "PHY Channel Feedback" },
{ 6, "AMC Band Indication Bitmap" },
{ 7, "Life Span of Short-term Precoding Feedback" },
{ 8, "Multiple Types of Feedback" },
{ 9, "Long-term Precoding Feedback" },
{ 10, "Combined DL Average CINR of Active BSs" },
{ 11, "MIMO Channel Feedback" },
{ 12, "CINR Feedback" },
{ 13, "Close-loop MIMO Feedback" },
{ 14, "Reserved" },
{ 15, "Reserved" },
{ 0, NULL}
};
/* common fields */
static gint hf_mac_header_generic_ext_subheader_rsv = -1;
/* DL sub-header */
static gint hf_mac_header_generic_ext_subheader_type_dl = -1;
static gint hf_mac_header_generic_ext_subheader_sdu_sn = -1;
static gint hf_mac_header_generic_ext_subheader_dl_sleep_control_pscid = -1;
static gint hf_mac_header_generic_ext_subheader_dl_sleep_control_op = -1;
static gint hf_mac_header_generic_ext_subheader_dl_sleep_control_fswe = -1;
static gint hf_mac_header_generic_ext_subheader_dl_sleep_control_fswb = -1;
static gint hf_mac_header_generic_ext_subheader_dl_sleep_control_rsv = -1;
static gint hf_mac_header_generic_ext_subheader_fb_req_uiuc = -1;
static gint hf_mac_header_generic_ext_subheader_fb_req_fb_type = -1;
static gint hf_mac_header_generic_ext_subheader_fb_req_ofdma_symbol_offset = -1;
static gint hf_mac_header_generic_ext_subheader_fb_req_subchannel_offset = -1;
static gint hf_mac_header_generic_ext_subheader_fb_req_slots = -1;
static gint hf_mac_header_generic_ext_subheader_fb_req_frame_offset = -1;
/* DL Sleep Control Operations */
static const value_string dl_sleep_control_ops[] =
{
{ 0, "De-activate Power Saving Class" },
{ 1, "Activate Power Saving Class" },
{ 0, NULL}
};
/* UL sub-header */
static gint hf_mac_header_generic_ext_subheader_type_ul = -1;
static gint hf_mac_header_generic_ext_subheader_mimo_mode_fb_type = -1;
static gint hf_mac_header_generic_ext_subheader_mimo_fb_content = -1;
static gint hf_mac_header_generic_ext_subheader_ul_tx_pwr_rep = -1;
static gint hf_mac_header_generic_ext_subheader_mini_fb_type = -1;
static gint hf_mac_header_generic_ext_subheader_mini_fb_content = -1;
/* common fields */
static gint hf_mac_header_generic_ext_subheader_pdu_sn_short = -1;
static gint hf_mac_header_generic_ext_subheader_pdu_sn_long = -1;
/* SN Request subheader */
#define SN_REQUEST_SUBHEADER_SN_REPORT_INDICATION_1_MASK 0x01
#define SN_REQUEST_SUBHEADER_SN_REPORT_INDICATION_2_MASK 0x02
#define SN_REQUEST_SUBHEADER_RESERVED_MASK 0xFC
static gint hf_mac_header_generic_ext_subheader_sn_req_rep_ind_1 = -1;
static gint hf_mac_header_generic_ext_subheader_sn_req_rep_ind_2 = -1;
static gint hf_mac_header_generic_ext_subheader_sn_req_rsv = -1;
/* SN Report Indication message */
static const value_string sn_rep_msg[] =
{
{ 0, "" },
{ 1, "request transmission" },
{ 0, NULL}
};
/* Mesh Subheader */
static gint hf_mac_header_generic_mesh_subheader = -1;
/* Fragmentation Subheader (table 8) */
#define FRAGMENTATION_SUBHEADER_FC_MASK 0xC000 /*0x0003*/
#define FRAGMENTATION_SUBHEADER_BSN_MASK 0x3FF8 /*0x1FFC*/
#define FRAGMENTATION_SUBHEADER_RSV_EXT_MASK 0x0007 /*0xE000*/
#define FRAGMENTATION_SUBHEADER_FSN_MASK 0x38 /*0x1C*/
#define FRAGMENTATION_SUBHEADER_RSV_MASK 0x07 /*0xE0*/
#define FRAGMENT_TYPE_MASK 0xC0
#define SEQ_NUMBER_MASK 0x38
#define SEQ_NUMBER_MASK_11 0x3FF8
#define NO_FRAG 0
#define LAST_FRAG 1
#define FIRST_FRAG 2
#define MIDDLE_FRAG 3
static gint hf_mac_header_generic_frag_subhd_fc = -1;
static gint hf_mac_header_generic_frag_subhd_fc_ext = -1;
static gint hf_mac_header_generic_frag_subhd_bsn = -1;
static gint hf_mac_header_generic_frag_subhd_fsn = -1;
static gint hf_mac_header_generic_frag_subhd_fsn_ext = -1;
static gint hf_mac_header_generic_frag_subhd_rsv = -1;
static gint hf_mac_header_generic_frag_subhd_rsv_ext = -1;
/* Fragment Types */
static const value_string frag_types[] =
{
{ 0, "No fragmentation" },
{ 1, "Last fragment" },
{ 2, "First fragment" },
{ 3, "Continuing (middle) fragment" },
{ 0, NULL}
};
/* Packing Subheader (table 11) */
#define PACKING_SUBHEADER_FC_MASK 0xC00000
#define PACKING_SUBHEADER_BSN_MASK 0x3FF800
#define PACKING_SUBHEADER_FSN_MASK 0x38
#define PACKING_SUBHEADER_LENGTH_MASK 0x07FF
#define PACKING_SUBHEADER_LENGTH_EXT_MASK 0x0007FF
#define FRAG_LENGTH_MASK 0x0007FF00
static gint hf_mac_header_generic_packing_subhd_fc = -1;
static gint hf_mac_header_generic_packing_subhd_fc_ext = -1;
static gint hf_mac_header_generic_packing_subhd_bsn = -1;
static gint hf_mac_header_generic_packing_subhd_fsn = -1;
static gint hf_mac_header_generic_packing_subhd_fsn_ext = -1;
static gint hf_mac_header_generic_packing_subhd_len = -1;
static gint hf_mac_header_generic_packing_subhd_len_ext = -1;
/* Fast-feedback Allocation Subheader (table 13) */
#define FAST_FEEDBACK_ALLOCATION_OFFSET_MASK 0xFC /*0x3F*/
#define FAST_FEEDBACK_FEEDBACK_TYPE_MASK 0x03 /*0xC0*/
static gint hf_mac_header_generic_fast_fb_subhd_alloc_offset = -1;
static gint hf_mac_header_generic_fast_fb_subhd_fb_type = -1;
/* Grant Management Subheader (table 9 & 10) */
#define GRANT_MGMT_SUBHEADER_UGS_SI_MASK 0x8000 /*0x0001*/
#define GRANT_MGMT_SUBHEADER_UGS_PM_MASK 0x4000 /*0x0002*/
#define GRANT_MGMT_SUBHEADER_UGS_FLI_MASK 0x2000 /*0x0004*/
#define GRANT_MGMT_SUBHEADER_UGS_FL_MASK 0x1E00 /*0x0078*/
#define GRANT_MGMT_SUBHEADER_UGS_RSV_MASK 0x01FF /*0xFF80*/
#define GRANT_MGMT_SUBHEADER_EXT_PBR_MASK 0xFFE0 /*0x07FF*/
#define GRANT_MGMT_SUBHEADER_EXT_FLI_MASK 0x0010 /*0x0800*/
#define GRANT_MGMT_SUBHEADER_EXT_FL_MASK 0x000F /*0xF000*/
typedef enum
{
SCHEDULE_SERVICE_TYPE_RSVD,
SCHEDULE_SERVICE_TYPE_UNDEFINED,
SCHEDULE_SERVICE_TYPE_BE,
SCHEDULE_SERVICE_TYPE_NRTPS,
SCHEDULE_SERVICE_TYPE_RTPS,
SCHEDULE_SERVICE_TYPE_EXT_RTPS,
SCHEDULE_SERVICE_TYPE_UGS
} SCHEDULE_SERVICE_TYPE_e;
static gint hf_mac_header_generic_grant_mgmt_ugs_tree = -1;
static gint hf_mac_header_generic_grant_mgmt_subhd_ugs_si = -1;
static gint hf_mac_header_generic_grant_mgmt_subhd_ugs_pm = -1;
static gint hf_mac_header_generic_grant_mgmt_subhd_ugs_fli = -1;
static gint hf_mac_header_generic_grant_mgmt_subhd_ugs_fl = -1;
static gint hf_mac_header_generic_grant_mgmt_subhd_ugs_rsv = -1;
static gint hf_mac_header_generic_grant_mgmt_ext_rtps_tree = -1;
static gint hf_mac_header_generic_grant_mgmt_subhd_ext_pbr = -1;
static gint hf_mac_header_generic_grant_mgmt_subhd_ext_fli = -1;
static gint hf_mac_header_generic_grant_mgmt_subhd_ext_fl = -1;
static gint hf_mac_header_generic_grant_mgmt_ext_pbr_tree = -1;
static gint hf_mac_header_generic_grant_mgmt_subhd_pbr = -1;
/* Slip Indicators */
static const value_string si_msgs[] =
{
{ 0, "No action" },
{ 1, "A slip of UL grants relative to the UL queue depth" },
{ 0, NULL}
};
/* Poll-Me Messages */
static const value_string pm_msgs[] =
{
{ 0, "No action" },
{ 1, "Request a bandwidth poll" },
{ 0, NULL}
};
/* Frame Latency Indications */
static const value_string fli_msgs[] =
{
{ 0, "Frame latency field disabled" },
{ 1, "Frame latency field enabled" },
{ 0, NULL}
};
/* ARQ Feedback Payload */
/* ARQ Feedback IE bit masks (table 111) */
#define ARQ_FB_IE_LAST_BIT_MASK 0x8000 /*0x0001*/
#define ARQ_FB_IE_ACK_TYPE_MASK 0x6000 /*0x0006*/
#define ARQ_FB_IE_BSN_MASK 0x1FFC /*0x3FF8*/
#define ARQ_FB_IE_NUM_MAPS_MASK 0x0003 /*0xC000*/
#define ARQ_FB_IE_SEQ_FORMAT_MASK 0x8000 /*0x0001*/
#define ARQ_FB_IE_SEQ_ACK_MAP_MASK 0x7000 /*0x000E*/
#define ARQ_FB_IE_SEQ1_LENGTH_MASK 0x0F00 /*0x00F0*/
#define ARQ_FB_IE_SEQ2_LENGTH_MASK 0x00F0 /*0x0F00*/
#define ARQ_FB_IE_SEQ3_LENGTH_MASK 0x000F /*0xF000*/
#define ARQ_FB_IE_SEQ_ACK_MAP_2_MASK 0x6000 /*0x0006*/
#define ARQ_FB_IE_SEQ1_LENGTH_6_MASK 0x1F80 /*0x01F8*/
#define ARQ_FB_IE_SEQ2_LENGTH_6_MASK 0x007E /*0x7E00*/
#define ARQ_FB_IE_RSV_MASK 0x0001 /*0x8000*/
static gint hf_mac_header_generic_arq_fb_ie_cid = -1;
static gint hf_mac_header_generic_arq_fb_ie_last = -1;
static gint hf_mac_header_generic_arq_fb_ie_ack_type = -1;
static gint hf_mac_header_generic_arq_fb_ie_bsn = -1;
static gint hf_mac_header_generic_arq_fb_ie_num_maps = -1;
static gint hf_ack_type_reserved = -1;
static gint hf_mac_header_generic_arq_fb_ie_sel_ack_map = -1;
static gint hf_mac_header_generic_arq_fb_ie_seq_format = -1;
static gint hf_mac_header_generic_arq_fb_ie_seq_ack_map = -1;
static gint hf_mac_header_generic_arq_fb_ie_seq1_length = -1;
static gint hf_mac_header_generic_arq_fb_ie_seq2_length = -1;
static gint hf_mac_header_generic_arq_fb_ie_seq3_length = -1;
static gint hf_mac_header_generic_arq_fb_ie_seq_ack_map_2 = -1;
static gint hf_mac_header_generic_arq_fb_ie_seq1_length_6 = -1;
static gint hf_mac_header_generic_arq_fb_ie_seq2_length_6 = -1;
static gint hf_mac_header_generic_arq_fb_ie_rsv = -1;
static gint hf_mac_header_payload_fragment = -1;
static expert_field ei_mac_crc_malformed = EI_INIT;
static expert_field ei_mac_crc_missing = EI_INIT;
static expert_field ei_mac_header_generic_crc = EI_INIT;
/* Last IE Indicators */
static const value_string last_ie_msgs[] =
{
{ 0, "No" },
{ 1, "Yes" },
{ 0, NULL}
};
/* Copied and renamed from proto.c because global value_strings don't work for plugins */
static const value_string plugin_proto_checksum_vals[] = {
{ PROTO_CHECKSUM_E_BAD, "Bad" },
{ PROTO_CHECKSUM_E_GOOD, "Good" },
{ PROTO_CHECKSUM_E_UNVERIFIED, "Unverified" },
{ PROTO_CHECKSUM_E_NOT_PRESENT, "Not present" },
{ 0, NULL }
};
/* Register Wimax defrag table init routine. */
static void wimax_defragment_init(void)
{
gint i;
/* Init fragmentation variables. */
for (i = 0; i < MAX_CID; i++)
{
cid_adjust[i] = 1; /* Must not start with 0 */
cid_vernier[i] = 0;
}
cid_adj_array_size = 0;
/* Initialize to make sure bs_address gets set in FCH decoder. */
bs_address.len = 0;
/* Initialize the Scheduling Service Type flag */
seen_a_service_type = 0;
max_logical_bands = 12;
/* Initialize UL_MAP globals. */
init_wimax_globals();
}
static void wimax_defragment_cleanup(void)
{
g_free(cid_adj_array);
cid_adj_array = NULL;
g_free(frag_num_array);
frag_num_array = NULL;
}
static guint decode_packing_subheader(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree *tree, guint payload_length _U_, guint payload_offset, proto_item *parent_item)
{
proto_item *generic_item = NULL;
proto_tree *generic_tree = NULL;
guint starting_offset = payload_offset;
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Packing subhdr");
/* add the Packing subheader info */
proto_item_append_text(parent_item, ", Packing Subheader");
/* display Packing subheader type */
generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, payload_tvb, payload_offset, ((arq_enabled|extended_type)?3:2), "Packing subheader (%u bytes)", ((arq_enabled|extended_type)?3:2));
/* add Packing subheader subtree */
generic_tree = proto_item_add_subtree(generic_item, ett_mac_pkt_subheader_decoder);
/* decode and display the Packing subheader */
/* Get the fragment type */
frag_type = (tvb_get_guint8(payload_tvb, payload_offset) & FRAGMENT_TYPE_MASK) >> 6;
/* if ARQ Feedback payload is present */
if (arq_fb_payload)
{ /* get the frag length */
frag_len = ((tvb_get_ntohl(payload_tvb, payload_offset) & FRAG_LENGTH_MASK) >> 8);
/* get the sequence number */
seq_number = (tvb_get_ntohs(payload_tvb, payload_offset) & SEQ_NUMBER_MASK_11) >> 3;
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_fc_ext, payload_tvb, payload_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_bsn, payload_tvb, payload_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_len_ext, payload_tvb, payload_offset, 3, ENC_BIG_ENDIAN);
/* update the length and offset */
payload_offset += 3;
frag_len -= 3;
}
else
{
if (extended_type)
{ /* get the frag length */
frag_len = ((tvb_get_ntohl(payload_tvb, payload_offset) & FRAG_LENGTH_MASK) >> 8);
/* get the sequence number */
seq_number = (tvb_get_ntohs(payload_tvb, payload_offset) & SEQ_NUMBER_MASK_11) >> 3;
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_fc_ext, payload_tvb, payload_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_fsn_ext, payload_tvb, payload_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_len_ext, payload_tvb, payload_offset, 3, ENC_BIG_ENDIAN);
/* update the length and offset */
payload_offset += 3;
frag_len -= 3;
}
else
{ /* get the frag length */
frag_len = (tvb_get_ntohs(payload_tvb, payload_offset) & PACKING_SUBHEADER_LENGTH_MASK);
/* get the sequence number */
seq_number = (tvb_get_guint8(payload_tvb, payload_offset) & SEQ_NUMBER_MASK) >> 3;
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_fc, payload_tvb, payload_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_fsn, payload_tvb, payload_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_packing_subhd_len, payload_tvb, payload_offset, 2, ENC_BIG_ENDIAN);
/* update the length and offset */
payload_offset += 2;
frag_len -= 2;
}
}
/* Prevent a crash! */
if ((gint)frag_len < 0)
frag_len = 0;
/* Return the number of bytes decoded. */
return payload_offset - starting_offset;
}
static int dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint payload_offset;
guint payload_length = 0;
static guint8 frag_number[MAX_CID];
static guint cid_list[MAX_CID];
static guint cid_base;
static const char reassem_str[] = "Reassembled Data transport PDU (%u bytes)";
static const char data_str[] = "Data transport PDU (%u bytes)";
const char *str_ptr;
gint length, i, cid_index;
guint tvb_len, ret_length, ubyte, new_tvb_len;
guint new_payload_len = 0;
guint /*mac_ht,*/ mac_ec, mac_esf, mac_ci, /*mac_eks,*/ mac_len, mac_cid, cid;
guint ffb_grant_mgmt_subheader, packing_subheader, fragment_subheader;
guint mesh_subheader;
guint packing_length;
guint32 mac_crc, calculated_crc;
proto_item *parent_item = NULL;
proto_item *generic_item = NULL;
proto_tree *generic_tree = NULL;
proto_item *child_item = NULL;
proto_tree *child_tree = NULL;
tvbuff_t *payload_tvb;
tvbuff_t *data_pdu_tvb;
fragment_head *payload_frag;
gboolean first_arq_fb_payload = TRUE;
proto_mac_header_generic_decoder = proto_wimax;
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "GMH");
#endif
/* Get the frame length */
tvb_len = tvb_reported_length(tvb);
if (tvb_len < WIMAX_MAC_HEADER_SIZE)
{
/* display the error message */
generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, tvb_len, "Error: the size of Generic MAC Header tvb is too small! (%u bytes)", tvb_len);
/* add subtree */
generic_tree = proto_item_add_subtree(generic_item, ett_mac_header_generic_decoder);
/* display the Generic MAC Header in Hex */
proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, tvb, offset, tvb_len, ENC_NA);
return tvb_captured_length(tvb);
}
/* get the parent */
parent_item = proto_tree_get_parent(tree);
/* add the MAC header info */
proto_item_append_text(parent_item, " - Generic MAC Header");
/* display MAC header message */
generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, WIMAX_MAC_HEADER_SIZE, "Generic MAC Header (%u bytes)", WIMAX_MAC_HEADER_SIZE);
/* add MAC header subtree */
generic_tree = proto_item_add_subtree(generic_item, ett_mac_header_generic_decoder);
/* Decode and display the MAC header */
/* Get the first byte */
ubyte = tvb_get_guint8(tvb, offset);
/* get the Header Type (HT) */
/*mac_ht = ((ubyte & WIMAX_MAC_HEADER_GENERIC_HT_MASK)?1:0); XX: not used ?? */
/* get the Encryption Control (EC) */
mac_ec = ((ubyte & WIMAX_MAC_HEADER_GENERIC_EC_MASK)?1:0);
/* get the sub types */
ffb_grant_mgmt_subheader = ((ubyte & GENERIC_SUB_TYPE_0)?1:0);
packing_subheader = ((ubyte & GENERIC_SUB_TYPE_1)?1:0);
fragment_subheader = ((ubyte & GENERIC_SUB_TYPE_2)?1:0);
extended_type = ((ubyte & GENERIC_SUB_TYPE_3)?1:0);
arq_fb_payload = ((ubyte & GENERIC_SUB_TYPE_4)?1:0);
mesh_subheader = ((ubyte & GENERIC_SUB_TYPE_5)?1:0);
/* Get the 2nd byte */
ubyte = tvb_get_guint8(tvb, (offset+1));
/* get the Extended subheader field (ESF) */
mac_esf = ((ubyte & WIMAX_MAC_HEADER_GENERIC_ESF_MASK)?1:0);
/* get the CRC indicator (CI) */
mac_ci = ((ubyte & WIMAX_MAC_HEADER_GENERIC_CI_MASK)?1:0);
/* get the Encryption key sequence (EKS) */
/*mac_eks = ((ubyte & WIMAX_MAC_HEADER_GENERIC_EKS_MASK)>>4); XX: not used ?? */
/* get the MAC length; this is used even if tree is null */
mac_len = (tvb_get_ntohs(tvb, (offset+1)) & WIMAX_MAC_HEADER_GENERIC_LEN);
/* get the CID */
mac_cid = tvb_get_ntohs(tvb, (offset+3));
/* display the Header Type (HT) */
proto_tree_add_item(generic_tree, hf_mac_header_generic_ht, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the Encryption Control (EC) */
proto_tree_add_item(generic_tree, hf_mac_header_generic_ec, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the sub-types (Type) */
proto_tree_add_item(generic_tree, hf_mac_header_generic_type_5, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_type_4, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_type_3, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_type_2, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_type_1, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_type_0, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the Extended sub-header Field (ESF) */
proto_tree_add_item(generic_tree, hf_mac_header_generic_esf, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the CRC Indicator (CI) */
proto_tree_add_item(generic_tree, hf_mac_header_generic_ci, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the Encryption Key Sequence (EKS) */
proto_tree_add_item(generic_tree, hf_mac_header_generic_eks, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the reserved field */
proto_tree_add_item(generic_tree, hf_mac_header_generic_rsv, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the length */
proto_tree_add_item(generic_tree, hf_mac_header_generic_len, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the CID */
proto_tree_add_item(generic_tree, hf_mac_header_generic_cid, tvb, (offset+3), 2, ENC_BIG_ENDIAN);
/* Decode and display the HCS */
proto_tree_add_item(generic_tree, hf_mac_header_generic_hcs, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
/* get the frame length without MAC header */
length = mac_len - WIMAX_MAC_HEADER_SIZE;
#ifdef DEBUG
proto_item_append_text(parent_item, "tvb length=%u, mac length=%u, frame length=%u,", tvb_len, mac_len, length);
#endif
/* set the offset for the frame */
offset += WIMAX_MAC_HEADER_SIZE;
/* the processing of the subheaders is order sensitive */
/* do not change the order */
if (mac_ec)
{
if (mac_ci)
{
if (length >= (gint)sizeof(mac_crc))
{
length -= (int)sizeof(mac_crc);
}
}
generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Encrypted PDU (%u bytes)", length);
/* add payload subtree */
generic_tree = proto_item_add_subtree(generic_item, ett_mac_data_pdu_decoder);
proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, tvb, offset, length, ENC_NA);
goto check_crc;
}
/* if Extended subheader is present */
if (mac_esf)
{ /* add the Extended subheader info */
proto_item_append_text(parent_item, ", Extended Subheader(s)");
ret_length = extended_subheader_decoder(tvb_new_subset_length(tvb, offset, length), pinfo, tree);
/* update the length and offset */
length -= ret_length;
offset += ret_length;
}
/* if Mesh subheader is present */
if (mesh_subheader)
{ /* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Mesh subhdr");
/* add the Mesh subheader info */
proto_item_append_text(parent_item, ", Mesh Subheader");
/* display Mesh subheader type */
generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Mesh subheader (2 bytes)");
/* add Mesh subheader subtree */
generic_tree = proto_item_add_subtree(generic_item, ett_mac_mesh_subheader_decoder);
/* decode and display the Mesh subheader */
proto_tree_add_item(generic_tree, hf_mac_header_generic_mesh_subheader, tvb, offset, 2, ENC_BIG_ENDIAN);
/* update the length and offset */
length -= 2;
offset += 2;
}
/* if Fast-feedback allocation (DL) subheader or Grant management (UL) subheader is present */
if (ffb_grant_mgmt_subheader)
{ /* check if it is downlink packet */
if (is_down_link(pinfo))
{ /* Fast-feedback allocation (DL) subheader is present */
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Fast-fb subhdr");
/* add the Fast-feedback subheader info */
proto_item_append_text(parent_item, ", Fast-feedback Subheader");
/* display Fast-feedback allocation subheader type */
generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Fast-feedback allocation (DL) subheader (%u bytes)", length);
/* add Fast-feedback allocation subheader subtree */
generic_tree = proto_item_add_subtree(generic_item, ett_mac_fast_fb_subheader_decoder);
proto_tree_add_item(generic_tree, hf_mac_header_generic_fast_fb_subhd_alloc_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_fast_fb_subhd_fb_type, tvb, offset, 1, ENC_BIG_ENDIAN);
/* update the length and offset */
length -= 1;
offset += 1;
}
else /* Grant management (UL) subheader is present */
{ /* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Grant mgmt subhdr");
/* add the Grant management subheader info */
proto_item_append_text(parent_item, ", Grant Management Subheader");
/* display Grant management subheader type */
generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, 2, "Grant management (UL) subheader (2 bytes)");
/* add Grant management subheader subtree */
generic_tree = proto_item_add_subtree(generic_item, ett_mac_grant_mgmt_subheader_decoder);
scheduling_service_type = get_service_type();
switch (scheduling_service_type)
{
case SCHEDULE_SERVICE_TYPE_UGS:
proto_item_append_text(generic_item, ": It looks like UGS is the correct Scheduling Service Type");
break;
case SCHEDULE_SERVICE_TYPE_EXT_RTPS:
proto_item_append_text(generic_item, ": It looks like Extended rtPS is the correct Scheduling Service Type");
break;
case -1:
proto_item_append_text(generic_item, ": Cannot determine the correct Scheduling Service Type");
break;
default:
proto_item_append_text(generic_item, ": It looks like Piggyback Request is the correct Scheduling Service Type");
break;
}
/* Create tree for Scheduling Service Type (UGS) */
child_item = proto_tree_add_item(generic_tree, hf_mac_header_generic_grant_mgmt_ugs_tree, tvb, offset, 2, ENC_BIG_ENDIAN);
child_tree = proto_item_add_subtree(child_item, ett_mac_grant_mgmt_subheader_decoder);
proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_si, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_pm, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_fli, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_fl, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ugs_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
/* Create tree for Scheduling Service Type (Extended RTPS) */
child_item = proto_tree_add_item(generic_tree, hf_mac_header_generic_grant_mgmt_ext_rtps_tree, tvb, offset, 2, ENC_BIG_ENDIAN);
child_tree = proto_item_add_subtree(child_item, ett_mac_grant_mgmt_subheader_decoder);
proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ext_pbr, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ext_fli, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_ext_fl, tvb, offset, 2, ENC_BIG_ENDIAN);
/* Create tree for Scheduling Service Type (Piggyback Request) */
child_item = proto_tree_add_item(generic_tree, hf_mac_header_generic_grant_mgmt_ext_pbr_tree, tvb, offset, 2, ENC_BIG_ENDIAN);
child_tree = proto_item_add_subtree(child_item, ett_mac_grant_mgmt_subheader_decoder);
proto_tree_add_item(child_tree, hf_mac_header_generic_grant_mgmt_subhd_pbr, tvb, offset, 2, ENC_BIG_ENDIAN);
/* update the length and offset */
length -= 2;
offset += 2;
}
}
/* if Fragmentation subheader is present */
if (fragment_subheader)
{ /* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Frag subhdr");
/* add the Fragmentation subheader info */
proto_item_append_text(parent_item, ", Frag Subheader");
/* display Fragmentation subheader type */
generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, ((arq_enabled|extended_type)?2:1), "Fragmentation subheader (%u bytes)", ((arq_enabled|extended_type)?2:1));
/* add Fragmentation subheader subtree */
generic_tree = proto_item_add_subtree(generic_item, ett_mac_frag_subheader_decoder);
/* Get the fragment type */
frag_type = (tvb_get_guint8(tvb, offset) & FRAGMENT_TYPE_MASK) >> 6;
if (arq_fb_payload)
{ /* get the sequence number */
seq_number = (tvb_get_ntohs(tvb, offset) & SEQ_NUMBER_MASK_11) >> 3;
/* decode and display the header */
proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fc_ext, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_bsn, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_rsv_ext, tvb, offset, 2, ENC_BIG_ENDIAN);
/* update the length and offset */
length -= 2;
offset += 2;
}
else
{
if (extended_type)
{ /* get the sequence number */
seq_number = (tvb_get_ntohs(tvb, offset) & SEQ_NUMBER_MASK_11) >> 3;
/* decode and display the header */
proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fc_ext, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fsn_ext, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_rsv_ext, tvb, offset, 2, ENC_BIG_ENDIAN);
/* update the length and offset */
length -= 2;
offset += 2;
}
else
{ /* get the sequence number */
seq_number = (tvb_get_guint8(tvb, offset) & SEQ_NUMBER_MASK) >> 3;
/* decode and display the header */
proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_fsn, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(generic_tree, hf_mac_header_generic_frag_subhd_rsv, tvb, offset, 1, ENC_BIG_ENDIAN);
/* update the length and offset */
length -= 1;
offset += 1;
}
}
frag_len = length;
}
else /* ??? default fragment type: no fragment */
{
frag_type = NO_FRAG;
}
/* Decode the MAC payload if there is any */
if (mac_ci)
{
if (length < (gint)sizeof(mac_crc))
{ /* display error message */
proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Error - the frame is too short (%u bytes)", length);
return tvb_captured_length(tvb);
}
length -= (int)sizeof(mac_crc);
}
while (length > 0)
{
frag_len = length; /* Can be changed by Packing subhdr */
if (packing_subheader)
{
packing_length = decode_packing_subheader(tvb, pinfo, tree, length, offset, parent_item);
length -= packing_length;
offset += packing_length;
generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, frag_len, "Data transport PDU (%u bytes)", frag_len);
/* add payload subtree */
generic_tree = proto_item_add_subtree(generic_item, ett_mac_data_pdu_decoder);
proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, tvb, offset, frag_len, ENC_NA);
}
/* defragment first if it is fragmented */
if (frag_type == NO_FRAG)
{ /* not fragmented payload */
payload_tvb = tvb_new_subset_length(tvb, offset, frag_len);
payload_length = frag_len;
new_payload_len = frag_len;
}
else /* fragmented payload */
{ /* add the fragment */
/* Make sure cid will not match a previous packet with different data */
for (i = 0; i < MAX_CID; i++)
{
if (cid_list[i] == mac_cid)
{
cid_base = i * (0xFFFFFFFF / MAX_CID);
break;
}
if (cid_list[i] == 0)
{
cid_list[i] = mac_cid;
cid_base = i * (0xFFFFFFFF / MAX_CID);
break;
}
}
cid_index = i;
while (pinfo->num > cid_adj_array_size)
{
cid_adj_array_size += 1024;
cid_adj_array = (guint *)g_realloc(cid_adj_array, (int)sizeof(guint) * cid_adj_array_size);
frag_num_array = (guint8 *)g_realloc(frag_num_array, (int)sizeof(guint8) * cid_adj_array_size);
/* Clear the added memory */
memset(&cid_adj_array[cid_adj_array_size - 1024], 0, (int)sizeof(guint) * 1024);
}
if (first_gmh)
{
/* New cid_adjust for each packet with fragment(s) */
cid_adjust[cid_index] += cid_vernier[cid_index];
/* cid_vernier must always be 0 at start of packet. */
cid_vernier[cid_index] = 0;
}
/* Create artificial sequence numbers. */
frag_number[cid_index]++;
if (frag_type == FIRST_FRAG)
{
frag_number[cid_index] = 0;
}
if (cid_adj_array[pinfo->num])
{
/* We apparently just clicked on the packet again. */
cid_adjust[cid_index] = cid_adj_array[pinfo->num];
/* Set the frag_number at start of packet. */
if (first_gmh)
{
frag_number[cid_index] = frag_num_array[pinfo->num];
}
} else {
/* Save for next time we click on this packet. */
cid_adj_array[pinfo->num] = cid_adjust[cid_index];
if (first_gmh)
{
frag_num_array[pinfo->num] = frag_number[cid_index];
}
}
/* Reset in case we stay in this while() loop to finish the packet. */
first_gmh = FALSE;
cid = cid_base + cid_adjust[cid_index] + cid_vernier[cid_index];
/* Save address pointers. */
copy_address_shallow(&save_src, &pinfo->src);
copy_address_shallow(&save_dst, &pinfo->dst);
/* Use dl_src and dl_dst in defragmentation. */
copy_address_shallow(&pinfo->src, &pinfo->dl_src);
copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
payload_frag = fragment_add_seq(&payload_reassembly_table, tvb, offset, pinfo, cid, NULL, frag_number[cid_index], frag_len, ((frag_type==LAST_FRAG)?0:1), 0);
/* Restore address pointers. */
copy_address_shallow(&pinfo->src, &save_src);
copy_address_shallow(&pinfo->dst, &save_dst);
if (frag_type == LAST_FRAG)
{
/* Make sure fragment_add_seq() sees next one as a new frame. */
cid_vernier[cid_index]++;
}
/* Don't show reassembled packet until last fragment. */
proto_tree_add_bytes_format(tree, hf_mac_header_payload_fragment, tvb, offset, frag_len, NULL, "Payload Fragment (%d bytes)", frag_len);
if (payload_frag && frag_type == LAST_FRAG)
{ /* defragmented completely */
payload_length = payload_frag->len;
/* create the new tvb for defragmented frame */
payload_tvb = tvb_new_chain(tvb, payload_frag->tvb_data);
/* add the defragmented data to the data source list */
add_new_data_source(pinfo, payload_tvb, "Reassembled WiMax MAC payload");
/* save the tvb langth */
new_payload_len = payload_length;
}
else /* error or defragment is not complete */
{
payload_tvb = NULL;
#ifdef DEBUG /* for debug only */
/* if (frag_type == LAST_FRAG)*/
{ /* error */
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Dropped the incomplete frame");
}
#endif
#if 0
if (frag_type == FIRST_FRAG)
{ /* Set up to decode the first fragment (even though next fragment not read yet) */
payload_tvb = tvb_new_subset_length(tvb, offset, length);
payload_length = length;
frag_len = length;
}
#endif
}
}
/* process the defragmented payload */
if (payload_tvb)
{ /* reset the payload_offset */
payload_offset = 0;
/* process the payload */
if (payload_length > 0)
{
if (!new_payload_len)
continue;
/* if ARQ Feedback payload is present, it should be the first SDU */
if (first_arq_fb_payload && arq_fb_payload)
{ /* decode and display the ARQ feedback payload */
first_arq_fb_payload = FALSE;
#ifndef DEBUG
arq_feedback_payload_decoder(tvb_new_subset_length(payload_tvb, payload_offset, new_payload_len), pinfo, generic_tree, parent_item);
#else
ret_length = arq_feedback_payload_decoder(tvb_new_subset_length(payload_tvb, payload_offset, new_payload_len), pinfo, generic_tree, parent_item);
if (ret_length != new_payload_len)
{ /* error */
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "incorrect ARQ fb payload size");
}
#endif
}
else /* decode SDUs */
{ /* check the payload type */
if (mac_cid == cid_padding)
{ /* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Padding CID");
/* get the parent */
generic_item = proto_tree_get_parent(tree);
/* add the MAC header info */
proto_item_append_text(generic_item, ", Padding CID");
/* display padding CID */
generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, payload_tvb, payload_offset, new_payload_len, "Padding CID (%u bytes)", new_payload_len);
/* add payload subtree */
generic_tree = proto_item_add_subtree(generic_item, ett_mac_header_generic_decoder);
/* display the Padding CID payload in Hex */
proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, payload_tvb, payload_offset, new_payload_len, ENC_NA);
}
else if ((mac_cid <= (2 * global_cid_max_basic)) || (mac_cid == cid_aas_ranging)
|| (mac_cid >= cid_normal_multicast))
{ /* MAC management message */
call_dissector(mac_mgmt_msg_decoder_handle, tvb_new_subset_length(payload_tvb, payload_offset, new_payload_len), pinfo, tree);
}
else /* data transport PDU */
{ /* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Data");
/* add the MAC payload info */
proto_item_append_text(parent_item, ", Data");
/* display payload info */
if ((new_payload_len + payload_offset) > payload_length)
{
new_tvb_len = new_payload_len - payload_offset;
}
else
{
new_tvb_len = new_payload_len;
}
if (frag_type == LAST_FRAG || frag_type == NO_FRAG)
{
if (frag_type == NO_FRAG)
{
str_ptr = data_str;
new_payload_len = frag_len;
}
else
{
str_ptr = reassem_str;
}
data_pdu_tvb = tvb_new_subset_length(payload_tvb, payload_offset, new_tvb_len);
generic_item = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, data_pdu_tvb, payload_offset, new_payload_len, str_ptr, new_payload_len);
/* add payload subtree */
generic_tree = proto_item_add_subtree(generic_item, ett_mac_data_pdu_decoder);
/* check the data type */
if (tvb_get_guint8(payload_tvb, payload_offset) == IP_HEADER_BYTE)
{
if (mac_ip_handle)
call_dissector(mac_ip_handle, tvb_new_subset_length(payload_tvb, payload_offset, new_tvb_len), pinfo, generic_tree);
else /* display the Generic MAC Header in Hex */
proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, payload_tvb, payload_offset, new_tvb_len, ENC_NA);
}
else /* display the Generic MAC Header in Hex */
proto_tree_add_item(generic_tree, hf_mac_header_generic_value_bytes, payload_tvb, payload_offset, new_tvb_len, ENC_NA);
}
}
}
payload_length -= new_payload_len;
} /* end of while loop */
} /* end of payload processing */
length -= frag_len;
offset += frag_len;
} /* end of payload decoding */
check_crc:
/* Decode and display the CRC if it is present */
if (mac_ci)
{
/* add the CRC info */
proto_item_append_text(parent_item, ", CRC");
/* check the length */
if (MIN(tvb_len, tvb_reported_length(tvb)) >= mac_len)
{
/* calculate the CRC */
calculated_crc = wimax_mac_calc_crc32(tvb_get_ptr(tvb, 0, mac_len - (int)sizeof(mac_crc)), mac_len - (int)sizeof(mac_crc));
/* display the CRC */
proto_tree_add_checksum(tree, tvb, mac_len - (int)sizeof(mac_crc), hf_mac_header_generic_crc, hf_mac_header_generic_crc_status, &ei_mac_header_generic_crc,
pinfo, calculated_crc, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
}
else
{ /* display error message */
expert_add_info_format(pinfo, tree, &ei_mac_crc_malformed, "CRC missing - the frame is too short (%u bytes)", tvb_len);
}
}
else /* CRC is not included */
{ /* add the CRC info */
proto_item_append_text(parent_item, ", No CRC");
/* display message */
expert_add_info(pinfo, tree, &ei_mac_crc_missing);
}
return tvb_captured_length(tvb);
}
static gint extended_subheader_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
gint offset = 0;
gint length, ext_length, ubyte, i;
proto_item *ti = NULL;
proto_tree *sub_tree = NULL;
proto_tree *ti_tree = NULL;
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Ext subhdrs");
/* Get the tvb reported length */
length = tvb_reported_length(tvb);
if (!length)
{ /* display the error message */
proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Error: extended subheader tvb is empty ! (%u bytes)", length);
return length;
}
/* Get the length of the extended subheader group */
ext_length = tvb_get_guint8(tvb, offset);
/* display subheader type */
ti = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Extended subheader group (%u bytes)", ext_length);
/* add extended subheader subtree */
sub_tree = proto_item_add_subtree(ti, ett_mac_ext_subheader_decoder);
/* decode and display the extended subheaders */
for (i=1; i<ext_length;)
{ /* Get the extended subheader type */
ubyte = (tvb_get_guint8(tvb, (offset+i)) & EXTENDED_SUB_HEADER_TYPE_MASK);
/* decode and display the extended subheader type (MSB) */
proto_tree_add_item(sub_tree, hf_mac_header_generic_ext_subheader_rsv, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
/* for downlink */
if (is_down_link(pinfo)) /* for downlink */
{ /* decode and display the extended subheader type */
ti = proto_tree_add_item(sub_tree, hf_mac_header_generic_ext_subheader_type_dl, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
/* add subtree */
ti_tree = proto_item_add_subtree(ti, ett_mac_ext_subheader_dl_decoder);
i++;
switch (ubyte)
{
case SDU_SN:
/* decode and display the extended sdu sn subheader */
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_sdu_sn, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
i++;
break;
case DL_SLEEP_CONTROL:
/* decode and display the extended dl sleep control subheader */
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_pscid, tvb, (offset+i), 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_op, tvb, (offset+i), 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_fswe, tvb, (offset+i), 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_fswb, tvb, (offset+i), 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_dl_sleep_control_rsv, tvb, (offset+i), 3, ENC_BIG_ENDIAN);
i += 3;
break;
case FEEDBACK_REQ:
/* decode and display the extended feedback request subheader */
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_uiuc, tvb, (offset+i), 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_fb_type, tvb, (offset+i), 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_ofdma_symbol_offset, tvb, (offset+i), 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_subchannel_offset, tvb, (offset+i), 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_slots, tvb, (offset+i), 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_fb_req_frame_offset, tvb, (offset+i), 3, ENC_BIG_ENDIAN);
i += 3;
break;
case SN_REQ:
/* decode and display the extended SN request subheader */
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_sn_req_rep_ind_1, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_sn_req_rep_ind_2, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_sn_req_rsv, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
i++;
break;
case PDU_SN_SHORT_DL:
/* decode and display the extended pdu sn (short) subheader */
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_pdu_sn_short, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
i++;
break;
case PDU_SN_LONG_DL:
/* decode and display the extended pdu sn (long) subheader */
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_pdu_sn_long, tvb, (offset+i), 2, ENC_BIG_ENDIAN);
i += 2;
break;
default: /* reserved */
break;
}
}
else /* for uplink */
{ /* decode and display the extended subheader type */
ti = proto_tree_add_item(sub_tree, hf_mac_header_generic_ext_subheader_type_ul, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
/* add subtree */
ti_tree = proto_item_add_subtree(ti, ett_mac_ext_subheader_ul_decoder);
i++;
switch (ubyte)
{
case MIMO_MODE_FEEDBACK:
/* decode and display the extended MIMO Mode Feedback subheader */
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_mimo_mode_fb_type, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_mimo_fb_content, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
i++;
break;
case UL_TX_POWER_REPORT:
/* decode and display the extended ul tx power report subheader */
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_ul_tx_pwr_rep, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
i++;
break;
case MINI_FEEDBACK:
/* decode and display the extended MINI Feedback subheader */
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_mini_fb_type, tvb, (offset+i), 2, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_mini_fb_content, tvb, (offset+i), 2, ENC_BIG_ENDIAN);
i += 2;
break;
case PDU_SN_SHORT_UL:
/* decode and display the extended pdu sn (short) subheader */
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_pdu_sn_short, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
i++;
break;
case PDU_SN_LONG_UL:
/* decode and display the extended pdu sn (long) subheader */
proto_tree_add_item(ti_tree, hf_mac_header_generic_ext_subheader_pdu_sn_long, tvb, (offset+i), 2, ENC_BIG_ENDIAN);
i += 2;
break;
default: /* reserved */
break;
}
}
}
/* return the extended subheader length */
return ext_length;
}
static gint arq_feedback_payload_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *parent_item)
{
gint length, i;
gint offset;
gint last_ie = 0;
gint ack_type, num_maps, seq_format;
gint word2, word3;
proto_item *ti = NULL;
proto_item *sub_ti = NULL;
proto_tree *sub_tree = NULL;
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "ARQ feedback payld");
/* add the MAC header info */
proto_item_append_text(parent_item, ", ARQ feedback payload");
/* reset the offset */
offset = 0;
/* Get the tvb reported length */
length = tvb_reported_length(tvb);
if (!length)
{ /* display the error message */
proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "Error: ARQ feedback payload tvb is empty ! (%u bytes)", length);
return length;
}
/* display subheader type */
ti = proto_tree_add_protocol_format(tree, proto_mac_header_generic_decoder, tvb, offset, length, "ARQ feedback payload ");
/* add extended subheader subtree */
sub_tree = proto_item_add_subtree(ti, ett_mac_arq_fb_payload_decoder);
/* decode and display the ARQ Feedback IEs */
while (!last_ie)
{ /* decode and display CID */
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_cid, tvb, offset, 2, ENC_BIG_ENDIAN);
/* move to next 16-bit word */
offset += 2;
/* Get the 2nd 16-bit */
word2 = tvb_get_ntohs(tvb, offset);
/* get the last bit */
last_ie = (word2 & ARQ_FB_IE_LAST_BIT_MASK);
/* get the ACK type */
ack_type = ((word2 & ARQ_FB_IE_ACK_TYPE_MASK) >> 13);
/* get the number of ACK maps */
num_maps = (word2 & ARQ_FB_IE_NUM_MAPS_MASK) + 1;
/* decode and display the 2nd word */
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_last, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_ack_type, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_bsn, tvb, offset, 2, ENC_BIG_ENDIAN);
/* decode and display the 3rd word */
if (ack_type != 1)
{
sub_ti = proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_num_maps, tvb, offset, 2, ENC_BIG_ENDIAN);
/* move to next 16-bit word */
offset += 2;
proto_item_append_text(sub_ti, " (%d map(s))", num_maps);
for (i = 0; i < num_maps; i++)
{
if (ack_type != 3)
{
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_sel_ack_map, tvb, offset, 2, ENC_BIG_ENDIAN);
}
else
{ /* Get the next 16-bit */
word3 = tvb_get_ntohs(tvb, offset);
/* get the sequence format */
seq_format = (word3 & ARQ_FB_IE_SEQ_FORMAT_MASK);
/* decode and display the sequence format */
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq_format, tvb, offset, 2, ENC_BIG_ENDIAN);
if (!seq_format)
{
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq_ack_map_2, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq1_length_6, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq2_length_6, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq_ack_map, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq1_length, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq2_length, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_mac_header_generic_arq_fb_ie_seq3_length, tvb, offset, 2, ENC_BIG_ENDIAN);
}
}
/* move to next 16-bit word */
offset += 2;
}
}
else
{
/* Number of ACK Maps bits are reserved when ACK TYPE == 1 */
proto_tree_add_item(sub_tree, hf_ack_type_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
/* move to next 16-bit word */
offset += 2;
}
}
/* append text */
proto_item_append_text(ti,"(%u bytes)", offset);
/* return the offset */
return offset;
}
/* Register Wimax Generic Mac Header Protocol and Dissector */
void wimax_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
}
},
{
&hf_mac_header_generic_crc_status,
{
"CRC Status", "wmx.genericCrc.status",
FT_UINT8, BASE_NONE, VALS(plugin_proto_checksum_vals), 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)",
"wmx.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)",
"wmx.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
}
},
{
&hf_mac_header_payload_fragment,
{
"Payload Fragment", "wmx.payload_fragment",
FT_BYTES, BASE_NONE, NULL, 0x0,
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,
};
static ei_register_info ei[] = {
{ &ei_mac_crc_malformed, { "wmx.genericCrc.missing", PI_MALFORMED, PI_ERROR, "CRC missing - the frame is too short", EXPFILL }},
{ &ei_mac_crc_missing, { "wmx.genericCrc.missing", PI_PROTOCOL, PI_NOTE, "CRC is not included in this frame!", EXPFILL }},
{ &ei_mac_header_generic_crc, { "wmx.genericCrc.bad_checksum", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }},
};
expert_module_t* expert_mac_header_generic;
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));
expert_mac_header_generic = expert_register_protocol(proto_mac_header_generic_decoder);
expert_register_field_array(expert_mac_header_generic, ei, array_length(ei));
/* register the generic mac header dissector */
register_dissector("mac_header_generic_handler", dissect_mac_header_generic_decoder, proto_mac_header_generic_decoder);
/* Register the payload fragment table init routine */
register_init_routine(wimax_defragment_init);
register_cleanup_routine(wimax_defragment_cleanup);
reassembly_table_register(&payload_reassembly_table,
&addresses_reassembly_table_functions);
}
void
wimax_proto_reg_handoff_mac_header_generic(void)
{
mac_mgmt_msg_decoder_handle = find_dissector("wmx_mac_mgmt_msg_decoder");
mac_ip_handle = find_dissector("ip");
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/mac_hd_type1_decoder.c | /* mac_hd_type1_decoder.c
* WiMax MAC Type I Signaling Header decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* TODO: Add FT_UINT24 and FT_INT24 cases to gtk_widget_get_toplevel()
* to prevent having to make all the changes from BASE_DEC to BASE_HEX
* made to this file today: 10/20/06.
*/
/* Include files */
#include "config.h"
/*
#define DEBUG
*/
#include <epan/packet.h>
#include "wimax-int.h"
extern gint proto_mac_header_generic_decoder;
static gint proto_mac_header_type_1_decoder = -1;
static gint ett_mac_header_type_1_decoder = -1;
static gint hf_mac_header_type_1_value_bytes = -1;
#define WIMAX_MAC_HEADER_SIZE 6
/* WiMax MAC Header Type I Sub Types */
typedef enum
{
BR_INCREMENTAL, /* 0 */
BR_AGGREGATE, /* 1 */
PHY_CHANNEL_REPORT, /* 2 */
BR_WITH_UL_TX_POWER_REPORT,/* 3 */
BR_AND_CINR_REPORT, /* 4 */
BR_WITH_UL_SLEEP_CONTROL, /* 5 */
SN_REPORT, /* 6 */
CQICH_ALLOCATION_REQUEST, /* 7 */
TYPE_I_SUBTYPE_MAX
} TYPE_I_SUBTYPE_e;
static const char *type1_subtype_abbrv[TYPE_I_SUBTYPE_MAX] =
{
"BR INCREMENTAL", /* 0 */
"BR AGGREGATE", /* 1 */
"PHY CHANNEL_REPORT", /* 2 */
"BR WITH UL TX POWER_REPORT",/* 3 */
"BR AND CINR REPORT", /* 4 */
"BR WITH UL SLEEP CONTROL", /* 5 */
"SN REPORT", /* 6 */
"CQICH ALLOCATION REQUEST" /* 7 */
};
#define WIMAX_MAC_HEADER_TYPE_1_SUB_TYPE_MASK 0x38
/* WIMAX MAC HEADER TYPE I FILEDS */
/* 1st to 3rd bytes */
/* Common Fields */
#define WIMAX_MAC_HEADER_TYPE_1_HT 0x800000
#define WIMAX_MAC_HEADER_TYPE_1_EC 0x400000
#define WIMAX_MAC_HEADER_TYPE_1_TYPE 0x380000
/* Bandwidth Request Incremental Header (type 0) &
Bandwidth Request Aggregate Header (type 1) only */
#define WIMAX_MAC_HEADER_TYPE_1_BR 0x07FFFF
/* PHY Channel Report Header (type 2) only */
#define WIMAX_MAC_HEADER_TYPE_1_DIUC 0x078000
#define WIMAX_MAC_HEADER_TYPE_1_UL_TX_PWR 0x007F80
#define WIMAX_MAC_HEADER_TYPE_1_UL_HDRM 0x00007E
#define WIMAX_MAC_HEADER_TYPE_1_RSV_2 0x000001
/* Bandwidth Request and UL TX Power Report Header (type 3),
Bandwidth Request and CINR Report Header (type 4), &
Bandwidth Request and Uplink Sleep Control Header (type 5) only */
#define WIMAX_MAC_HEADER_TYPE_1_BR_3 0x07FF00
/* Bandwidth Request and UL TX Power Report Header (type 3) only */
#define WIMAX_MAC_HEADER_TYPE_1_UL_TX_PWR_3 0x0000FF
/* Bandwidth Request and CINR Report Header (type 4) only */
#define WIMAX_MAC_HEADER_TYPE_1_CINR 0x0000FE
#define WIMAX_MAC_HEADER_TYPE_1_DCI 0x000001
/* Bandwidth Request and Uplink Sleep Control Header (type 5) only */
#define WIMAX_MAC_HEADER_TYPE_1_PSCID 0x0000FC
#define WIMAX_MAC_HEADER_TYPE_1_OP 0x000002
#define WIMAX_MAC_HEADER_TYPE_1_RSV_5 0x000001
/* SN Report Header (type 6) only */
#define WIMAX_MAC_HEADER_TYPE_1_LAST 0x040000
#define WIMAX_MAC_HEADER_TYPE_1_SDU_SN1 0x03F000
#define WIMAX_MAC_HEADER_TYPE_1_SDU_SN2 0x000FC0
#define WIMAX_MAC_HEADER_TYPE_1_SDU_SN3 0x00003F
/* CQICH Allocation Request (type 7) only */
#define WIMAX_MAC_HEADER_TYPE_1_FB_TYPE 0x070000
#define WIMAX_MAC_HEADER_TYPE_1_FBSSI 0x008000
#define WIMAX_MAC_HEADER_TYPE_1_PERIOD 0x007000
#define WIMAX_MAC_HEADER_TYPE_1_RSV_7 0x000FFF
/* 4th to 6th bytes */
/*#define WIMAX_MAC_HEADER_TYPE_1_CID 0xFFFF
*#define WIMAX_MAC_HEADER_TYPE_1_HCS 0xFF
*/
/* Common Fields */
static int hf_mac_header_type_1_ht = -1;
static int hf_mac_header_type_1_ec = -1;
static int hf_mac_header_type_1_type = -1;
/* type 0 & type 1 only */
static int hf_mac_header_type_1_br = -1;
/* type 3, type 4, & type 5 only */
static int hf_mac_header_type_1_br_3 = -1;
/* type 2 only */
static int hf_mac_header_type_1_diuc = -1;
static int hf_mac_header_type_1_ultxpwr = -1;
static int hf_mac_header_type_1_ulhdrm = -1;
static int hf_mac_header_type_1_rsv_2 = -1;
/* type 3 only */
static int hf_mac_header_type_1_ultxpwr_3 = -1;
/* type 4 only */
static int hf_mac_header_type_1_cinr = -1;
static int hf_mac_header_type_1_dci = -1;
/* type 5 only */
static int hf_mac_header_type_1_pscid = -1;
static int hf_mac_header_type_1_op = -1;
static int hf_mac_header_type_1_rsv_5 = -1;
/* type 6 only */
static int hf_mac_header_type_1_last = -1;
static int hf_mac_header_type_1_sdu_sn1 = -1;
static int hf_mac_header_type_1_sdu_sn2 = -1;
static int hf_mac_header_type_1_sdu_sn3 = -1;
/* type 7 only */
static int hf_mac_header_type_1_fb_type = -1;
static int hf_mac_header_type_1_fbssi = -1;
static int hf_mac_header_type_1_period = -1;
static int hf_mac_header_type_1_rsv_7 = -1;
/* Common Fields */
static int hf_mac_header_type_1_cid = -1;
static int hf_mac_header_type_1_hcs = -1;
/* MAC Header Type I Sub-Types */
static const value_string sub_types[] =
{
{ BR_INCREMENTAL, "Bandwidth Request Incremental" },
{ BR_AGGREGATE, "Bandwidth Request Aggregate" },
{ PHY_CHANNEL_REPORT, "PHY Channel Report" },
{ BR_WITH_UL_TX_POWER_REPORT, "Bandwidth Request with UL TX Power Report" },
{ BR_AND_CINR_REPORT, "Bandwidth Request and CINR Report" },
{ BR_WITH_UL_SLEEP_CONTROL, "Bandwidth Request with Sleep Control" },
{ SN_REPORT, "SN Report" },
{ CQICH_ALLOCATION_REQUEST, "CQICH Allocation Request" },
{ 0, NULL}
};
/* Feedback Types (need to be changed for type I) */
static const value_string fb_types[] =
{
{ 0, "CQI and MIMO Feedback" },
{ 1, "DL average CINR" },
{ 2, "MIMO Coefficients Feedback" },
{ 3, "Preferred DL Channel DIUC Feedback" },
{ 4, "UL Transmission Power" },
{ 5, "PHY Channel Feedback" },
{ 6, "AMC Band Indication Bitmap" },
{ 7, "Life Span of Short-term Precoding Feedback" },
{ 0, NULL}
};
/* DCD Change Indication messages */
static const value_string dci_msgs[] =
{
{ 0, "Match DCD Change Count" },
{ 1, "Mismatch DCD Change Count" },
{ 0, NULL}
};
/* Operation messages */
static const value_string op_msgs[] =
{
{ 0, "Deactivate Power Saving Class" },
{ 1, "Activate Power Saving Class" },
{ 0, NULL}
};
/* Last ARQ BSN or SDU SN Indication messages */
static const value_string last_msgs[] =
{
{ 0, "First three connections" },
{ 1, "Last three connections" },
{ 0, NULL}
};
static int dissect_mac_header_type_1_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
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, ENC_NA);
return tvb_captured_length(tvb);
}
#ifdef DEBUG
/* update the info column */
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, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_type_1_ec, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_type_1_type, tvb, offset, 3, ENC_BIG_ENDIAN);
/* 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, type1_subtype_abbrv[sub_type]);
}
else
{
/* update the info column */
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, ENC_NA);
return tvb_captured_length(tvb);
}
/* 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, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
/* Decode and display the UL TX Power */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_ultxpwr, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the UL Headroom */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_ulhdrm, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the reserved filed */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_rsv_2, tvb, offset, 3, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
/* Decode and display the UL TX Power */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_ultxpwr_3, tvb, offset, 3, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
/* Decode and display the CINR */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_cinr, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the DCD Change Indication */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_dci, tvb, offset, 3, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
/* Decode and display the Power Saving Class ID */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_pscid, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the Operation */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_op, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the reserved filed */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_rsv_5, tvb, offset, 3, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
/* Decode and display the SDU SN1 */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_sdu_sn1, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the SDU SN2 */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_sdu_sn2, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the SDU SN3 */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_sdu_sn3, tvb, offset, 3, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
/* Decode and display the FBSSI */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_fbssi, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the Prreferred-period */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_period, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the reserved filed */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_rsv_7, tvb, offset, 3, ENC_BIG_ENDIAN);
break;
}
/* Decode and display the CID */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_cid, tvb, (offset+3), 2, ENC_BIG_ENDIAN);
/* Decode and display the HCS */
proto_tree_add_item(ti_tree, hf_mac_header_type_1_hcs, tvb, (offset+5), 1, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Header Type II Protocol and Dissector */
void wimax_proto_register_mac_header_type_1(void)
{
/* TLV display */
static hf_register_info hf[] =
{
{
&hf_mac_header_type_1_value_bytes,
{
"Values", "wmx.type1ValueBytes",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_ht,
{
"MAC Header Type", "wmx.type1Ht",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_HT,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_ec,
{
"MAC Encryption Control", "wmx.type1Ec",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_EC,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_type,
{
"MAC Sub-Type", "wmx.type1Type",
FT_UINT24, BASE_HEX, VALS(sub_types), WIMAX_MAC_HEADER_TYPE_1_TYPE,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_br,
{
"Bandwidth Request", "wmx.type1Br",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_BR,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_br_3,
{
"Bandwidth Request", "wmx.type1Br3",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_BR_3,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_fb_type,
{
"Feedback Type", "wmx.type1FbType",
FT_UINT24, BASE_HEX, VALS(fb_types), WIMAX_MAC_HEADER_TYPE_1_FB_TYPE,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_diuc,
{
"Preferred DIUC Index", "wmx.type1Diuc",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_DIUC,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_ultxpwr,
{
"UL TX Power", "wmx.type1UlTxPwr",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_UL_TX_PWR,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_ultxpwr_3,
{
"UL TX Power", "wmx.type1UlTxPwr3",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_UL_TX_PWR_3,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_ulhdrm,
{
"Headroom to UL Max Power Level", "wmx.type1HdRm",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_UL_HDRM,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_cinr,
{
"CINR Value", "wmx.type1Cinr",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_CINR,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_dci,
{
"DCD Change Indication", "wmx.type1Dci",
FT_UINT24, BASE_HEX, VALS(dci_msgs), WIMAX_MAC_HEADER_TYPE_1_DCI,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_pscid,
{
"Power Saving Class ID", "wmx.type1PsCid",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_PSCID,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_op,
{
"Operation", "wmx.type1Op",
FT_UINT24, BASE_HEX, VALS(op_msgs), WIMAX_MAC_HEADER_TYPE_1_OP,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_last,
{
"Last ARQ BSN or SDU SN", "wmx.type1Last",
FT_UINT24, BASE_HEX, VALS(last_msgs), WIMAX_MAC_HEADER_TYPE_1_LAST,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_sdu_sn1,
{
"ARQ BSN or MAC SDU SN (1)", "wmx.type1SduSn1",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_SDU_SN1,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_sdu_sn2,
{
"ARQ BSN or MAC SDU SN (2)", "wmx.type1SduSn2",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_SDU_SN2,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_sdu_sn3,
{
"ARQ BSN or MAC SDU SN (3)", "wmx.type1SduSn3",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_SDU_SN3,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_fbssi,
{
"FBSS Indicator", "wmx.type1Fbssi",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_FBSSI,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_period,
{
"Preferred CQICH Allocation Period", "wmx.type1Period",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_PERIOD,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_rsv_2,
{
"Reserved", "wmx.type1Rsv2",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_RSV_2,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_rsv_5,
{
"Reserved", "wmx.type1Rsv5",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_RSV_5,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_rsv_7,
{
"Reserved", "wmx.type1Rsv7",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_1_RSV_7,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_cid,
{
"Connection ID", "wmx.type1Cid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_mac_header_type_1_hcs,
{
"Header Check Sequence", "wmx.type1Hcs",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL
}
}
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_header_type_1_decoder,
};
proto_mac_header_type_1_decoder = proto_mac_header_generic_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, proto_mac_header_type_1_decoder);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/mac_hd_type2_decoder.c | /* mac_hd_type2_decoder.c
* WiMax MAC Type II Signaling Header decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* TODO: Add FT_UINT24 and FT_INT24 cases to gtk_widget_get_toplevel()
* to prevent having to make all the changes from BASE_DEC to BASE_HEX
* made to this file today: 10/20/06.
*/
/*
#define DEBUG
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax-int.h"
extern gint proto_mac_header_generic_decoder;
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;
#define WIMAX_MAC_HEADER_SIZE 6
/* WiMax MAC Header Type II Feedback Types */
typedef enum
{
CQI_MIMO_FB, /* 0 */
DL_AVG_CINR, /* 1 */
MIMO_COEF_FB, /* 2 */
PREF_DL_CHAN_DIUC_FB,/* 3 */
UL_TX_PWR, /* 4 */
PHY_CHAN_FB, /* 5 */
AMC_BAND_BITMAP, /* 6 */
SHORT_PRECODE_FB, /* 7 */
MULTI_TYPES_FB, /* 8 */
LONG_PRECODE_FB, /* 9 */
COMB_DL_AVG_CINR, /* 10 */
MIMO_CHAN_FB, /* 11 */
CINR_FB, /* 12 */
CL_MIMO_FB, /* 13 */
TYPE_II_FB_TYPE_MAX
} TYPE_II_FB_TYPE_e;
static const char *type2_fb_type_abbrv[TYPE_II_FB_TYPE_MAX] =
{
"CQI and MIMO Feedback",
"DL average CINR",
"MIMO Coefficients Feedback",
"Preferred DL Channel DIUC Feedback",
"UL Transmission Power",
"PHY Channel Feedback",
"AMC Band Indication Bitmap",
"Life Span of Short-term Precoding Feedback",
"Multiple Types of Feedback",
"Long-term Precoding Feedback",
"Combined DL Average CINR of Active BSs",
"MIMO Channel Feedback",
"CINR Feedback",
"Close-loop MIMO Feedback"
};
/* WIMAX MAC HEADER TYPE II FILEDS */
/* first byte */
#define WIMAX_MAC_HEADER_TYPE_2_HT 0x80
#define WIMAX_MAC_HEADER_TYPE_2_EC 0x40
#define WIMAX_MAC_HEADER_TYPE_2_TYPE 0x20
#define WIMAX_MAC_HEADER_TYPE_2_CII 0x10
#define WIMAX_MAC_HEADER_TYPE_2_FB_TYPE 0x0F
static int hf_mac_header_type_2_ht = -1;
static int hf_mac_header_type_2_ec = -1;
static int hf_mac_header_type_2_type = -1;
static int hf_mac_header_type_2_cii = -1;
static int hf_mac_header_type_2_fb_type = -1;
/* 2nd to 5th bytes (varies by different fb types) */
static int hf_mac_header_type_2_cid = -1;
static int hf_mac_header_type_2_no_cid = -1;
/* CQI and MIMO Feedback */
/* 2nd & 3rd bytes */
#define WIMAX_MAC_HEADER_TYPE_2_CQI_FB_TYPE 0xE000
#define WIMAX_MAC_HEADER_TYPE_2_CQI_PAYLOAD 0x1F80
#define WIMAX_MAC_HEADER_TYPE_2_CQI_RSV 0x007F
static int hf_mac_header_type_2_cqi_fb_type = -1;
static int hf_mac_header_type_2_cqi_payload = -1;
static int hf_mac_header_type_2_cqi_rsv = -1;
/* 4th & 5th without CID */
/*#define WIMAX_MAC_HEADER_TYPE_2_NO_CID 0xFFFF*/
/* DL average CINR */
/* 2nd byte */
#define WIMAX_MAC_HEADER_TYPE_2_DL_AVE_CINR 0xF800
#define WIMAX_MAC_HEADER_TYPE_2_DL_AVE_RSV 0x07FF
static int hf_mac_header_type_2_dl_ave_cinr = -1;
static int hf_mac_header_type_2_dl_ave_rsv = -1;
/* MIMO Coefficients Feedback */
/* 2nd & 3rd bytes */
#define WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_NI 0xC000
#define WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_AI 0x3000
#define WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF 0x0F80
#define WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_RSV 0x007F
static int hf_mac_header_type_2_mimo_coef_ni = -1;
static int hf_mac_header_type_2_mimo_coef_ai = -1;
static int hf_mac_header_type_2_mimo_coef = -1;
static int hf_mac_header_type_2_mimo_coef_rsv = -1;
/* Preferred DL Channel DIUC Feedback */
/* 2nd byte */
#define WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_DIUC 0xF000
#define WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_DCD 0x0F00
#define WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_RSV 0x00FF
static int hf_mac_header_type_2_dl_chan_diuc = -1;
static int hf_mac_header_type_2_dl_chan_dcd = -1;
static int hf_mac_header_type_2_dl_chan_rsv = -1;
/* UL Transmission Power */
/* 2nd byte */
#define WIMAX_MAC_HEADER_TYPE_2_UL_TX_PWR 0xFF00
#define WIMAX_MAC_HEADER_TYPE_2_UL_TX_PWR_RSV 0x00FF
static int hf_mac_header_type_2_ul_tx_pwr = -1;
static int hf_mac_header_type_2_ul_tx_pwr_rsv = -1;
/* PHY Channel Feedback */
/* 2nd to 4th bytes */
#define WIMAX_MAC_HEADER_TYPE_2_PHY_DIUC 0xF00000
#define WIMAX_MAC_HEADER_TYPE_2_PHY_UL_TX_PWR 0x0FF000
#define WIMAX_MAC_HEADER_TYPE_2_PHY_UL_HDRM 0x000FC0
#define WIMAX_MAC_HEADER_TYPE_2_PHY_RSV 0x00003F
static int hf_mac_header_type_2_phy_diuc = -1;
static int hf_mac_header_type_2_phy_ul_tx_pwr = -1;
static int hf_mac_header_type_2_phy_ul_hdrm = -1;
static int hf_mac_header_type_2_phy_rsv = -1;
/* AMC Band Indication Bitmap */
/* 2nd to 5th bytes */
#define WIMAX_MAC_HEADER_TYPE_2_AMC_BITMAP 0xFFF00000
#define WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_1 0x000F8000
#define WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_2 0x00007C00
#define WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_3 0x000003E0
#define WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_4 0x0000001F
static int hf_mac_header_type_2_amc_bitmap = -1;
static int hf_mac_header_type_2_amc_cqi_1 = -1;
static int hf_mac_header_type_2_amc_cqi_2 = -1;
static int hf_mac_header_type_2_amc_cqi_3 = -1;
static int hf_mac_header_type_2_amc_cqi_4 = -1;
/* Life Span of Short-term Precoding Feedback */
/* 2nd byte */
#define WIMAX_MAC_HEADER_TYPE_2_LIFE_SPAN 0xF000
#define WIMAX_MAC_HEADER_TYPE_2_LIFE_SPAN_RSV 0x0FFF
static int hf_mac_header_type_2_life_span = -1;
static int hf_mac_header_type_2_life_span_rsv = -1;
/* Multiple Types of Feedback */
/* 2nd to 5th bytes ??? */
#define WIMAX_MAC_HEADER_TYPE_2_MT_NUM_FB_TYPES 0xC0000000
#define WIMAX_MAC_HEADER_TYPE_2_MT_OCCU_FB_TYPE 0x3C000000
#define WIMAX_MAC_HEADER_TYPE_2_MT_FB_CONTENTS 0x03FFFFFF
static int hf_mac_header_type_2_mt_num_fb_types = -1;
static int hf_mac_header_type_2_mt_occu_fb_type = -1;
static int hf_mac_header_type_2_mt_fb_contents = -1;
/* Long-term Precoding Feedback */
/* 2nd & 3rd bytes */
#define WIMAX_MAC_HEADER_TYPE_2_LT_ID_FB 0xFC00
#define WIMAX_MAC_HEADER_TYPE_2_LT_RANK 0x0300
#define WIMAX_MAC_HEADER_TYPE_2_LT_FEC_QAM 0x00FC
#define WIMAX_MAC_HEADER_TYPE_2_LT_RSV 0x0003
static int hf_mac_header_type_2_lt_id_fb = -1;
static int hf_mac_header_type_2_lt_rank = -1;
static int hf_mac_header_type_2_lt_fec_qam = -1;
static int hf_mac_header_type_2_lt_rsv = -1;
/* Combined DL Average CINR of Active BSs */
/* 2nd & 3rd bytes */
#define WIMAX_MAC_HEADER_TYPE_2_COMB_DL_AVE 0xF800
#define WIMAX_MAC_HEADER_TYPE_2_COMB_DL_RSV 0x0EFF
static int hf_mac_header_type_2_comb_dl_ave = -1;
static int hf_mac_header_type_2_comb_dl_rsv = -1;
/* MIMO Channel Feedback */
/* 2nd byte */
#define WIMAX_MAC_HEADER_TYPE_2_DIUC 0xF0
#define WIMAX_MAC_HEADER_TYPE_2_PBWI 0x0F
/* 3rd to 5th bytes with CID */
#define WIMAX_MAC_HEADER_TYPE_2_SLPB 0xFE0000
#define WIMAX_MAC_HEADER_TYPE_2_PBRI_CID 0x010000
#define WIMAX_MAC_HEADER_TYPE_2_CID 0x00FFFF
/* 3rd to 5th bytes without CID */
#define WIMAX_MAC_HEADER_TYPE_2_PBRI 0x018000
#define WIMAX_MAC_HEADER_TYPE_2_CTI 0x007000
#define WIMAX_MAC_HEADER_TYPE_2_AI_0 0x000800
#define WIMAX_MAC_HEADER_TYPE_2_AI_1 0x000400
#define WIMAX_MAC_HEADER_TYPE_2_AI_2 0x000200
#define WIMAX_MAC_HEADER_TYPE_2_AI_3 0x000100
#define WIMAX_MAC_HEADER_TYPE_2_MI 0x0000C0
#define WIMAX_MAC_HEADER_TYPE_2_CT 0x000020
#define WIMAX_MAC_HEADER_TYPE_2_CQI 0x00001F
static int hf_mac_header_type_2_mimo_diuc = -1;
static int hf_mac_header_type_2_mimo_pbwi = -1;
static int hf_mac_header_type_2_mimo_slpb = -1;
static int hf_mac_header_type_2_mimo_bpri = -1;
static int hf_mac_header_type_2_mimo_bpri_cid = -1;
static int hf_mac_header_type_2_mimo_cid = -1;
static int hf_mac_header_type_2_mimo_cti = -1;
static int hf_mac_header_type_2_mimo_ai_0 = -1;
static int hf_mac_header_type_2_mimo_ai_1 = -1;
static int hf_mac_header_type_2_mimo_ai_2 = -1;
static int hf_mac_header_type_2_mimo_ai_3 = -1;
static int hf_mac_header_type_2_mimo_mi = -1;
static int hf_mac_header_type_2_mimo_ct = -1;
static int hf_mac_header_type_2_mimo_cqi = -1;
/* CINR Feedback */
/* 2nd byte */
/*#define WIMAX_MAC_HEADER_TYPE_2_CINR_MEAN 0xFF*/
/* 3rd byte */
/*#define WIMAX_MAC_HEADER_TYPE_2_CINR_DEVI 0xFF*/
static int hf_mac_header_type_2_cinr_mean = -1;
static int hf_mac_header_type_2_cinr_devi = -1;
/* Close-loop MIMO Feedback */
/* 2nd & 3rd bytes */
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_TYPE 0xC000
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_ANT_ID 0x3C00
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI 0x03E0
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV 0x008F
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_STREAMS 0x3000
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_ANT_SEL 0x0E00
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI_1 0x01F0
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV_1 0x000F
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CODEBOOK_ID 0x3F00
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI_2 0x00F8
#define WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV_2 0x000E
static int hf_mac_header_type_2_cl_mimo_type = -1;
static int hf_mac_header_type_2_cl_mimo_ant_id = -1;
static int hf_mac_header_type_2_cl_mimo_cqi = -1;
static int hf_mac_header_type_2_cl_mimo_cqi_1 = -1;
static int hf_mac_header_type_2_cl_mimo_cqi_2 = -1;
static int hf_mac_header_type_2_cl_mimo_rsv = -1;
static int hf_mac_header_type_2_cl_mimo_rsv_1 = -1;
static int hf_mac_header_type_2_cl_mimo_rsv_2 = -1;
static int hf_mac_header_type_2_cl_mimo_streams = -1;
static int hf_mac_header_type_2_cl_mimo_ant_sel = -1;
static int hf_mac_header_type_2_cl_mimo_codebook_id = -1;
/* last byte */
/*#define WIMAX_MAC_HEADER_TYPE_2_HCS 0xFF*/
static int hf_mac_header_type_2_hcs = -1;
/* CID Inclusion Indication messages */
static const value_string cii_msgs[] =
{
{ 0, "without CID" },
{ 1, "with CID" },
{ 0, NULL}
};
/* Feedback Types */
static const value_string fb_types[] =
{
{ 0, "CQI and MIMO Feedback" },
{ 1, "DL average CINR" },
{ 2, "MIMO Coefficients Feedback" },
{ 3, "Preferred DL Channel DIUC Feedback" },
{ 4, "UL Transmission Power" },
{ 5, "PHY Channel Feedback" },
{ 6, "AMC Band Indication Bitmap" },
{ 7, "Life Span of Short-term Precoding Feedback" },
{ 8, "Multiple Types of Feedback" },
{ 9, "Long-term Precoding Feedback" },
{ 10, "Combined DL Average CINR of Active BSs" },
{ 11, "MIMO Channel Feedback" },
{ 12, "CINR Feedback" },
{ 13, "Close-loop MIMO Feedback" },
{ 14, "Reserved" },
{ 15, "Reserved" },
{ 0, NULL}
};
/* Table of the Preferred Bandwidth Ratio of bandwidth over used channel bandwidth */
static const value_string pbwi_table[] =
{
{ 0, "1" },
{ 1, "3/4" },
{ 2, "2/3" },
{ 3, "1/2" },
{ 4, "1/3" },
{ 5, "1/4" },
{ 6, "1/5" },
{ 7, "1/6" },
{ 8, "1/8" },
{ 9, "1/10" },
{ 10, "1/12" },
{ 11, "1/16" },
{ 12, "1/24" },
{ 13, "1/32" },
{ 14, "1/48" },
{ 15, "1/64" },
{ 0, NULL}
};
/* Burst Profile Ranking Indicator table */
static const value_string bpri_table[] =
{
{ 0, "1st preferred burst profile" },
{ 1, "2nd preferred burst profile" },
{ 2, "3rd preferred burst profile" },
{ 3, "4th preferred burst profile" },
{ 0, NULL}
};
/* Coherent Time Index Table */
static const value_string cti_table[] =
{
{ 0, "Infinite" },
{ 1, "1 frame" },
{ 2, "2 frames" },
{ 3, "3 frames" },
{ 4, "4 frames" },
{ 5, "8 frames" },
{ 6, "14 frames" },
{ 7, "24 frames" },
{ 0, NULL}
};
/* The MS Matrix Index Table */
static const value_string mi_table[] =
{
{ 0, "No STC" },
{ 1, "Matrix A" },
{ 2, "Matrix B" },
{ 3, "Matrix C" },
{ 0, NULL}
};
/* CQI Feedback Types */
static const value_string ct_msgs[] =
{
{ 0, "DL average feedback" },
{ 1, "CQI feedback" },
{ 0, NULL}
};
/* Antenna Indication messages */
static const value_string ai_msgs[] =
{
{ 0, "Not applicable" },
{ 1, "Applicable" },
{ 0, NULL}
};
static int dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
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;
{ /* 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, ENC_NA);
return tvb_captured_length(tvb);
}
#ifdef DEBUG
/* update the info column */
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, ENC_BIG_ENDIAN);
/* encryption control */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_ec, tvb, offset, 1, ENC_BIG_ENDIAN);
/* sub-type */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_type, tvb, offset, 1, ENC_BIG_ENDIAN);
/* CID inclusion indication */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_cii, tvb, offset, 1, ENC_BIG_ENDIAN);
/* feedback type */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_fb_type, tvb, offset, 1, ENC_BIG_ENDIAN);
/* 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, type2_fb_type_abbrv[fb_type]);
}
else
{
/* update the info column */
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, ENC_NA);
return tvb_captured_length(tvb);
}
/* 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, ENC_BIG_ENDIAN);
/* CQI payload */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_cqi_payload, tvb, offset, 2, ENC_BIG_ENDIAN);
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_cqi_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_ave_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
/* occurrences of antenna index */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_coef_ai, tvb, offset, 2, ENC_BIG_ENDIAN);
/* MIMO coefficients */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_coef, tvb, offset, 2, ENC_BIG_ENDIAN);
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_coef_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
/* DCD Change Count */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_chan_dcd, tvb, offset, 2, ENC_BIG_ENDIAN);
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_dl_chan_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_ul_tx_pwr_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
/* UL TX Power */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_phy_ul_tx_pwr, tvb, offset, 2, ENC_BIG_ENDIAN);
/* UL Headroom */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_phy_ul_hdrm, tvb, offset, 2, ENC_BIG_ENDIAN);
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_phy_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
/* AMC CQI 1 */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_cqi_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* AMC CQI 2 */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_cqi_2, tvb, offset, 2, ENC_BIG_ENDIAN);
/* AMC CQI 3 */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_cqi_3, tvb, offset, 2, ENC_BIG_ENDIAN);
/* AMC CQI 4 */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_amc_cqi_4, tvb, offset, 2, ENC_BIG_ENDIAN);
#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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
#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, ENC_BIG_ENDIAN);
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_life_span_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
/* Occurrences of feedback type */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mt_occu_fb_type, tvb, offset, 4, ENC_BIG_ENDIAN);
/* feedback contents */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mt_fb_contents, tvb, offset, 4, ENC_BIG_ENDIAN);
#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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
#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, ENC_BIG_ENDIAN);
/* rank of prrecoding codebook */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_lt_rank, tvb, offset, 2, ENC_BIG_ENDIAN);
/* EFC and QAM feedback */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_lt_fec_qam, tvb, offset, 2, ENC_BIG_ENDIAN);
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_lt_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_comb_dl_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_pbwi, tvb, (offset+1), 1, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
/* Decode and display the CID */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_cid, tvb, offset, 3, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* Decode and display the BPRI */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_bpri, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the CTI */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_cti, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the AI */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ai_0, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ai_1, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ai_2, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ai_3, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the MI */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_mi, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the CT */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_ct, tvb, offset, 3, ENC_BIG_ENDIAN);
/* Decode and display the CQI */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_mimo_cqi, tvb, offset, 3, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
/* CINR Standard Deviation */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_cinr_devi, tvb, offset, 2, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
/* Decode and display the average CQI */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_cqi_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_rsv_1, tvb, offset, 2, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
/* Decode and display the average CQI */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_cqi_2, tvb, offset, 2, ENC_BIG_ENDIAN);
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_rsv_2, tvb, offset, 2, ENC_BIG_ENDIAN);
}
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, ENC_BIG_ENDIAN);
/* Decode and display the average CQI */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_cqi, tvb, offset, 2, ENC_BIG_ENDIAN);
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_cl_mimo_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
}
/* 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, ENC_BIG_ENDIAN);
}
else
{ /* without CID */
/* reserved */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_no_cid, tvb, (offset+2), 2, ENC_BIG_ENDIAN);
}
break;
default:
break;
}
/* Decode and display the HCS */
proto_tree_add_item(ti_tree, hf_mac_header_type_2_hcs, tvb, (offset+4), 1, ENC_BIG_ENDIAN);
}
else
{
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Error - Undefined Type");
}
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Header Type II Protocol and Dissector */
void wimax_proto_register_mac_header_type_2(void)
{
/* MAC HEADER TYPE II display */
static hf_register_info hf[] =
{
{
&hf_mac_header_type_2_value_bytes,
{
"Values", "wmx.type2ValueBytes",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_ht,
{
"MAC Header Type", "wmx.type2Ht",
FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_HT,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_ec,
{
"MAC Encryption Control", "wmx.type2Ec",
FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_EC,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_type,
{
"MAC Sub-Type", "wmx.type2Type",
FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_TYPE,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cii,
{
"CID Inclusion Indication", "wmx.type2Cii",
FT_UINT8, BASE_DEC, VALS(cii_msgs), WIMAX_MAC_HEADER_TYPE_2_CII,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_fb_type,
{
"Feedback Type", "wmx.type2FbType",
FT_UINT8, BASE_DEC, VALS(fb_types), WIMAX_MAC_HEADER_TYPE_2_FB_TYPE,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cqi_fb_type,
{
"Mimo Feedback Type", "wmx.type2MimoFbType",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CQI_FB_TYPE,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cqi_payload,
{
"CQI and Mimo Feedback Payload", "wmx.type2MimoFbPayload",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CQI_PAYLOAD,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cqi_rsv,
{
"Reserved", "wmx.type2MimoFbRsv",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CQI_RSV,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_dl_ave_cinr,
{
"DL Average CINR", "wmx.type2DlAveCinr",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_AVE_CINR,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_dl_ave_rsv,
{
"Reserved", "wmx.type2DlAveRsv",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_AVE_RSV,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_coef_ni,
{
"Number of Index", "wmx.type2MimoCoefNi",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_NI,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_coef_ai,
{
"Occurrences of Antenna Index", "wmx.type2MimoCoefAi",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_AI,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_coef,
{
"MIMO Coefficients", "wmx.type2MimoCoef",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_coef_rsv,
{
"Reserved", "wmx.type2MimoCoefRsv",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MIMO_COEF_RSV,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_dl_chan_diuc,
{
"Preferred DIUC", "wmx.type2DlChanDiuc",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_DIUC,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_dl_chan_dcd,
{
"DCD Change Count", "wmx.type2DlChanDcd",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_DCD,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_dl_chan_rsv,
{
"Reserved", "wmx.type2DlChanRsv",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DL_CHAN_RSV,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_ul_tx_pwr,
{
"UL TX Power", "wmx.type2UlTxPwr",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_UL_TX_PWR,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_ul_tx_pwr_rsv,
{
"Reserved", "wmx.type2UlTxPwrRsv",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_UL_TX_PWR_RSV,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_phy_diuc,
{
"Preferred DIUC Index", "wmx.type2PhyDiuc",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_PHY_DIUC,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_phy_ul_tx_pwr,
{
"UL TX Power", "wmx.type2PhyUlTxPwr",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_PHY_UL_TX_PWR,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_phy_ul_hdrm,
{
"UL Headroom", "wmx.type2PhyHdRm",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_PHY_UL_HDRM,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_phy_rsv,
{
"Reserved", "wmx.type2PhyRsv",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_PHY_RSV,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_amc_bitmap,
{
"AMC Band Indication Bitmap", "wmx.type2AmcBitmap",
FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_BITMAP,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_amc_cqi_1,
{
"CQI 1", "wmx.type2AmcCqi1",
FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_1,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_amc_cqi_2,
{
"CQI 2", "wmx.type2AmcCqi2",
FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_2,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_amc_cqi_3,
{
"CQI 3", "wmx.type2AmcCqi3",
FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_3,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_amc_cqi_4,
{
"CQI 4", "wmx.type2AmcCqi4",
FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_AMC_CQI_4,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_life_span,
{
"Life Span of Short-term", "wmx.type2LifeSpan",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LIFE_SPAN,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_life_span_rsv,
{
"Reserved", "wmx.type2LifeSpanRsv",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LIFE_SPAN_RSV,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mt_num_fb_types,
{
"Number of Feedback Types", "wmx.type2MtNumFbTypes",
FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MT_NUM_FB_TYPES,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mt_occu_fb_type,
{
"Occurrences of Feedback Type", "wmx.type2MtOccuFbType",
FT_UINT32, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_MT_OCCU_FB_TYPE,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mt_fb_contents,
{
"Number of Feedback Types", "wmx.type2MtNumFbTypes",
FT_UINT32, BASE_HEX, NULL, WIMAX_MAC_HEADER_TYPE_2_MT_FB_CONTENTS,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_lt_id_fb,
{
"Long-term Feedback Index", "wmx.type2LtFbId",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LT_ID_FB,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_lt_rank,
{
"Rank of Precoding Codebook", "wmx.type2LtRank",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LT_RANK,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_lt_fec_qam,
{
"FEC and QAM", "wmx.type2LtFecQam",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LT_FEC_QAM,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_lt_rsv,
{
"Reserved", "wmx.type2LtFbId",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_LT_RSV,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_comb_dl_ave,
{
"Combined DL Average CINR of Active BSs", "wmx.type2CombDlAve",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_COMB_DL_AVE,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_comb_dl_rsv,
{
"Reserved", "wmx.type2CombDlRsv",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_COMB_DL_RSV,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_diuc,
{
"Preferred DIUC Index", "wmx.type2MimoDiuc",
FT_UINT8, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_DIUC,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_pbwi,
{
"Preferred Bandwidth Index", "wmx.type2MimoPbwi",
FT_UINT8, BASE_DEC, VALS(pbwi_table), WIMAX_MAC_HEADER_TYPE_2_PBWI,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_slpb,
{
"Starting Location of Preferred Bandwidth", "wmx.type2MimoSlpb",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_SLPB,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_bpri_cid,
{
"Burst Profile Ranking Indicator with CID", "wmx.type2MimoBpriCid",
FT_UINT24, BASE_HEX, VALS(bpri_table), WIMAX_MAC_HEADER_TYPE_2_PBRI_CID,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_cid,
{
"Connection ID", "wmx.type2MimoCid",
FT_UINT24, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CID,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_bpri,
{
"Burst Profile Ranking Indicator without CID", "wmx.type2MimoBpri",
FT_UINT24, BASE_HEX, VALS(bpri_table), WIMAX_MAC_HEADER_TYPE_2_PBRI,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_cti,
{
"Coherent Time Index", "wmx.type2MimoCti",
FT_UINT24, BASE_HEX, VALS(cti_table), WIMAX_MAC_HEADER_TYPE_2_CTI,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_ai_0,
{
"Antenna 0 Indication", "wmx.type2MimoAi",
FT_UINT24, BASE_HEX, VALS(ai_msgs), WIMAX_MAC_HEADER_TYPE_2_AI_0,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_ai_1,
{
"Antenna 1 Indication", "wmx.type2MimoAi",
FT_UINT24, BASE_HEX, VALS(ai_msgs), WIMAX_MAC_HEADER_TYPE_2_AI_1,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_ai_2,
{
"Antenna 2 Indication", "wmx.type2MimoAi",
FT_UINT24, BASE_HEX, VALS(ai_msgs), WIMAX_MAC_HEADER_TYPE_2_AI_2,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_ai_3,
{
"Antenna 3 Indication", "wmx.type2MimoAi",
FT_UINT24, BASE_HEX, VALS(ai_msgs), WIMAX_MAC_HEADER_TYPE_2_AI_3,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_mi,
{
"MS Matrix Indicator", "wmx.type2MimoMi",
FT_UINT24, BASE_HEX, VALS(mi_table), WIMAX_MAC_HEADER_TYPE_2_MI,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_ct,
{
"CQI Type", "wmx.type2MimoCt",
FT_UINT24, BASE_HEX, VALS(ct_msgs), WIMAX_MAC_HEADER_TYPE_2_CT,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_mimo_cqi,
{
"CQI Feedback", "wmx.type2MimoCqi",
FT_UINT24, BASE_HEX, NULL, WIMAX_MAC_HEADER_TYPE_2_CQI,
NULL, HFILL
}
},
{ &hf_mac_header_type_2_cinr_mean,
{
"CINR Mean", "wmx.type2CinrMean",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cinr_devi,
{
"CINR Standard Deviation", "wmx.type2CinrDevi",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cl_mimo_type,
{
"Closed-Loop MIMO Type", "wmx.type2ClMimoType",
FT_UINT16, BASE_HEX, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_TYPE,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cl_mimo_ant_id,
{
"Antenna Grouping Index", "wmx.type2ClMimoAntId",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_ANT_ID,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cl_mimo_cqi,
{
"Average CQI", "wmx.type2ClMimoCqi",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cl_mimo_cqi_1,
{
"Average CQI", "wmx.type2ClMimoCqi",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI_1,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cl_mimo_cqi_2,
{
"Average CQI", "wmx.type2ClMimoCqi",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CQI_2,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cl_mimo_rsv,
{
"Reserved", "wmx.type2ClMimoRsv",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cl_mimo_rsv_1,
{
"Reserved", "wmx.type2ClMimoRsv",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV_1,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cl_mimo_rsv_2,
{
"Reserved", "wmx.type2ClMimoRsv",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_RSV_2,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cl_mimo_streams,
{
"Number of Streams", "wmx.type2ClMimoStreams",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_STREAMS,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cl_mimo_ant_sel,
{
"Antenna Selection Option Index", "wmx.type2ClMimoAntSel",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_ANT_SEL,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cl_mimo_codebook_id,
{
"Codebook Index", "wmx.type2ClMimoCodeBkId",
FT_UINT16, BASE_DEC, NULL, WIMAX_MAC_HEADER_TYPE_2_CL_MIMO_CODEBOOK_ID,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_cid,
{
"Connection ID", "wmx.type2Cid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_no_cid,
{
"Reserved", "wmx.type2NoCid",
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_mac_header_type_2_hcs,
{
"Header Check Sequence", "wmx.type2Hcs",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL
}
}
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_header_type_2_decoder,
};
proto_mac_header_type_2_decoder = proto_mac_header_generic_decoder;
proto_register_field_array(proto_mac_header_type_2_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_dissector("mac_header_type_2_handler", dissect_mac_header_type_2_decoder, proto_mac_header_type_2_decoder);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/mac_mgmt_msg_decoder.c | /* mac_mgmt_msg_decoder.c
* WiMax MAC Management Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#include "wimax_mac.h"
void proto_register_mac_mgmt_msg(void);
void proto_reg_handoff_mac_mgmt_msg(void);
static gint proto_mac_mgmt_msg_decoder = -1;
static gint ett_mac_mgmt_msg_decoder = -1;
static gint hf_mac_mgmt_msg_type = -1;
static gint hf_mac_mgmt_msg_values = -1;
static expert_field ei_empty_payload = EI_INIT;
static dissector_table_t subdissector_message_table;
/* WIMAX MAC Management message type info */
static const value_string mgt_msg_abbrv_vals[] = {
{ MAC_MGMT_MSG_UCD, "UCD" },
{ MAC_MGMT_MSG_DCD, "DCD" },
{ MAC_MGMT_MSG_DL_MAP, "DL-MAP" },
{ MAC_MGMT_MSG_UL_MAP, "UL-MAP" },
{ MAC_MGMT_MSG_RNG_REQ, "RNG-REQ" },
{ MAC_MGMT_MSG_RNG_RSP, "RNG-RSP" },
{ MAC_MGMT_MSG_REG_REQ, "REG-REQ" },
{ MAC_MGMT_MSG_REG_RSP, "REG-RSP" },
{ 8, "Reserved8" },
{ MAC_MGMT_MSG_PKM_REQ, "PKM-REQ" },
{ MAC_MGMT_MSG_PKM_RSP, "PKM-RSP" },
{ MAC_MGMT_MSG_DSA_REQ, "DSA-REQ" },
{ MAC_MGMT_MSG_DSA_RSP, "DSA-RSP" },
{ MAC_MGMT_MSG_DSA_ACK, "DSA-ACK" },
{ MAC_MGMT_MSG_DSC_REQ, "DSC-REQ" },
{ MAC_MGMT_MSG_DSC_RSP, "DSC-RSP" },
{ MAC_MGMT_MSG_DSC_ACK, "DSC-ACK" },
{ MAC_MGMT_MSG_DSD_REQ, "DSD-REQ" },
{ MAC_MGMT_MSG_DSD_RSP, "DSD-RSP" },
{ 19, "Reserved19" },
{ 20, "Reserved20" },
{ MAC_MGMT_MSG_MCA_REQ, "MCA-REQ" },
{ MAC_MGMT_MSG_MCA_RSP, "MCA-RSP" },
{ MAC_MGMT_MSG_DBPC_REQ, "DBPC-REQ" },
{ MAC_MGMT_MSG_DBPC_RSP, "DBPC-RSP" },
{ MAC_MGMT_MSG_RES_CMD, "RES-CMD" },
{ MAC_MGMT_MSG_SBC_REQ, "SBC-REQ" },
{ MAC_MGMT_MSG_SBC_RSP, "SBC-RSP" },
{ MAC_MGMT_MSG_CLK_CMP, "CLK-CMP" },
{ MAC_MGMT_MSG_DREG_CMD, "DREG-CMD" },
{ MAC_MGMT_MSG_DSX_RVD, "DSX-RVD" },
{ MAC_MGMT_MSG_TFTP_CPLT, "TFTP-CPLT" },
{ MAC_MGMT_MSG_TFTP_RSP, "TFTP-RSP" },
{ MAC_MGMT_MSG_ARQ_FEEDBACK, "ARQ-FEEDBACK" },
{ MAC_MGMT_MSG_ARQ_DISCARD, "ARQ-DISCARD" },
{ MAC_MGMT_MSG_ARQ_RESET, "ARQ-RESET" },
{ MAC_MGMT_MSG_REP_REQ, "REP-REQ" },
{ MAC_MGMT_MSG_REP_RSP, "REP-RSP" },
{ MAC_MGMT_MSG_FPC, "FPC" },
{ MAC_MGMT_MSG_MSH_NCFG, "MSH-NCFG" },
{ MAC_MGMT_MSG_MSH_NENT, "MSH-NENT" },
{ MAC_MGMT_MSG_MSH_DSCH, "MSH-DSCH" },
{ MAC_MGMT_MSG_MSH_CSCH, "MSH-CSCH" },
{ MAC_MGMT_MSG_MSH_CSCF, "MSH-CSCF" },
{ MAC_MGMT_MSG_AAS_FBCK_REQ, "AAS-FBCK_REQ" },
{ MAC_MGMT_MSG_AAS_FBCK_RSP, "AAS-FBCK_RSP" },
{ MAC_MGMT_MSG_AAS_BEAM_SELECT, "AAS-BEAM_SELECT" },
{ MAC_MGMT_MSG_AAS_BEAM_REQ, "AAS-BEAM_REQ" },
{ MAC_MGMT_MSG_AAS_BEAM_RSP, "AAS-BEAM_RSP" },
{ MAC_MGMT_MSG_DREG_REQ, "DREG-REQ" },
{ MAC_MGMT_MSG_MOB_SLP_REQ, "MOB-SLP-REQ" },
{ MAC_MGMT_MSG_MOB_SLP_RSP, "MOB-SLP-RSP" },
{ MAC_MGMT_MSG_MOB_TRF_IND, "MOB-TRF-IND" },
{ MAC_MGMT_MSG_MOB_NBR_ADV, "MOB-NBR-ADV" },
{ MAC_MGMT_MSG_MOB_SCN_REQ, "MOB-SCN-REQ" },
{ MAC_MGMT_MSG_MOB_SCN_RSP, "MOB-SCN-RSP" },
{ MAC_MGMT_MSG_MOB_BSHO_REQ, "MOB-BSHO-REQ" },
{ MAC_MGMT_MSG_MOB_MSHO_REQ, "MOB-MSHO-REQ" },
{ MAC_MGMT_MSG_MOB_BSHO_RSP, "MOB-BSHO-RSP" },
{ MAC_MGMT_MSG_MOB_HO_IND, "MOB-HO-IND" },
{ MAC_MGMT_MSG_MOB_SCN_REP, "MOB-SCN-REP" },
{ MAC_MGMT_MSG_MOB_PAG_ADV, "MOB-PAG-ADV" },
{ MAC_MGMT_MSG_MBS_MAP, "MBS-MAP" },
{ MAC_MGMT_MSG_PMC_REQ, "PMC-REQ" },
{ MAC_MGMT_MSG_PMC_RSP, "PMC-RSP" },
{ MAC_MGMT_MSG_PRC_LT_CTRL, "PRC-LT-CTRL" },
{ MAC_MGMT_MSG_MOB_ASC_REP, "MOB-ASC-REP" },
{ 0, NULL }
};
static value_string_ext mgt_msg_abbrv_vals_ext = VALUE_STRING_EXT_INIT(mgt_msg_abbrv_vals);
static int dissect_mac_mgmt_msg_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint message_type;
proto_item *message_item;
proto_tree *message_tree;
const char* mgt_msg_str;
message_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_decoder, tvb, offset, -1,
"MAC Management Message Type (%u bytes)", tvb_reported_length(tvb));
message_tree = proto_item_add_subtree(message_item, ett_mac_mgmt_msg_decoder);
if (tvb_reported_length(tvb) == 0)
{
expert_add_info(pinfo, message_item, &ei_empty_payload);
return tvb_captured_length(tvb);
}
/* Get the payload type */
message_type = tvb_get_guint8(tvb, offset);
proto_tree_add_item(message_tree, hf_mac_mgmt_msg_type, tvb, offset, 1, ENC_NA);
mgt_msg_str = val_to_str_ext_const(message_type, &mgt_msg_abbrv_vals_ext, "Unknown");
/* Display message type in Info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", mgt_msg_str);
/* add the payload type into the info column */
if (try_val_to_str_ext(message_type, &mgt_msg_abbrv_vals_ext) == NULL)
{
/* display the MAC payload in Hex */
proto_tree_add_item(message_tree, hf_mac_mgmt_msg_values, tvb, offset, -1, ENC_NA);
return 1;
}
/* add the MAC header info to parent*/
proto_item_append_text(proto_tree_get_parent(tree), ", %s", mgt_msg_str);
/* Decode and display the MAC payload */
if (!dissector_try_uint(subdissector_message_table, message_type,
tvb_new_subset_remaining(tvb, 1), pinfo, tree))
{
proto_tree_add_item(message_tree, hf_mac_mgmt_msg_values, tvb, offset, -1, ENC_NA);
}
return tvb_captured_length(tvb);
}
/* 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_type,
{
"MAC Management Message Type", "wmx.macmgtmsgtype",
FT_UINT8, BASE_DEC | BASE_EXT_STRING, &mgt_msg_abbrv_vals_ext, 0x0,
NULL, HFILL
}
},
{
&hf_mac_mgmt_msg_values,
{
"Values", "wmx.values",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL
}
},
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_mgmt_msg_decoder,
};
static ei_register_info ei[] = {
{ &ei_empty_payload, { "wmx.empty_payload", PI_PROTOCOL, PI_ERROR, "Error: Mac payload tvb is empty !", EXPFILL }},
};
expert_module_t* expert_mac_mgmt;
proto_mac_mgmt_msg_decoder = proto_register_protocol (
"WiMax MAC Management Message", /* name */
"MGMT MSG", /* short name */
"wmx.mgmt" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_mac_mgmt = expert_register_protocol(proto_mac_mgmt_msg_decoder);
expert_register_field_array(expert_mac_mgmt, ei, array_length(ei));
subdissector_message_table = register_dissector_table("wmx.mgmtmsg",
"WiMax MAC Management Message", proto_mac_mgmt_msg_decoder, FT_UINT8, BASE_DEC);
/* Register dissector by name */
register_dissector("wmx_mac_mgmt_msg_decoder", dissect_mac_mgmt_msg_decoder,
proto_mac_mgmt_msg_decoder);
}
void proto_reg_handoff_mac_mgmt_msg(void)
{
dissector_handle_t mgt_msg_handle;
/* Find the dissectors that appear to be supported through a third-party plugin
Keep here until third-party plugin can register through the new "wmx.mgmtmsg"
subdissector */
/* find the Multicast Assignment request message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mca_req_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MCA_REQ, mgt_msg_handle );
/* find the Multicast Assignment response message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mca_rsp_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MCA_RSP, mgt_msg_handle );
/* find the DL Burst Profile Change request message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_dbpc_req_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_DBPC_REQ, mgt_msg_handle );
/* find the DL Burst Profile Change response message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_dbpc_rsp_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_DBPC_RSP, mgt_msg_handle );
/* find the Config File TFTP Complete message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_tftp_cplt_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_TFTP_CPLT, mgt_msg_handle );
/* find the Config File TFTP Complete response message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_tftp_rsp_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_TFTP_RSP, mgt_msg_handle );
/* find the Mesh Network Configuration message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_ncfg_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MSH_NCFG, mgt_msg_handle );
/* find the Mesh Network Entry message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_nent_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MSH_NENT, mgt_msg_handle );
/* find the Mesh Distributed Schedule message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_dsch_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MSH_DSCH, mgt_msg_handle );
/* find the Mesh Centralized Schedule message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_csch_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MSH_CSCH, mgt_msg_handle );
/* find the Mesh Centralized Schedule Configuration message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_cscf_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MSH_CSCF, mgt_msg_handle );
/* find the AAS Beam request message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_aas_beam_req_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_AAS_BEAM_REQ, mgt_msg_handle );
/* find the AAS Beam response message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_aas_beam_rsp_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_AAS_BEAM_RSP, mgt_msg_handle );
/* find the Sleep Request message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_slp_req_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_SLP_REQ, mgt_msg_handle );
/* find the Sleep Response message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_slp_rsp_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_SLP_RSP, mgt_msg_handle );
/* find the Traffic Indication message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_trf_ind_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_TRF_IND, mgt_msg_handle );
/* find the Neighbor Advertisement message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_nbr_adv_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_NBR_ADV, mgt_msg_handle );
/* find the Scanning Interval Allocation Request message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_scn_req_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_SCN_REQ, mgt_msg_handle );
/* find the Scanning Interval Allocation Response message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_scn_rsp_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_SCN_RSP, mgt_msg_handle );
/* find the BS HO Request message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_bsho_req_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_BSHO_REQ, mgt_msg_handle );
/* find the MS HO Request message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_msho_req_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_MSHO_REQ, mgt_msg_handle );
/* find the BS HO Response message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_bsho_rsp_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_BSHO_RSP, mgt_msg_handle );
/* find the HO Indication message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_ho_ind_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_HO_IND, mgt_msg_handle );
/* find the Scanning Result Report message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_scn_rep_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_SCN_REP, mgt_msg_handle );
/* find the BS Broadcast Paging message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_pag_adv_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_PAG_ADV, mgt_msg_handle );
/* find the MBS MAP message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mbs_map_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MBS_MAP, mgt_msg_handle );
/* find the Association Result Report message handler */
mgt_msg_handle = find_dissector("mac_mgmt_msg_mob_asc_rep_handler");
if (mgt_msg_handle)
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_MOB_ASC_REP, mgt_msg_handle );
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_aas_beam.c | /* msg_aas_beam.c
* WiMax MAC Management AAS-BEAM-SELECT/REQ/RSP Messages decoders
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#define OFDM /* disable it if not supporting OFDM */
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_mac.h"
extern gint proto_mac_mgmt_msg_aas_fbck_decoder;
#define AAS_BEAM_SELECT_AAS_BEAM_INDEX_MASK 0xFC
#define AAS_BEAM_SELECT_RESERVED_MASK 0x03
#define AAS_BEAM_FEEDBACK_REQUEST_NUMBER_MASK 0xE0
#define AAS_BEAM_MEASUREMENT_REPORT_TYPE_MASK 0x18
#define AAS_BEAM_RESOLUTION_PARAMETER_MASK 0x07
#define AAS_BEAM_BEAM_BIT_MASK_MASK 0xF0
#define AAS_BEAM_RESERVED_MASK 0x0F
void proto_register_mac_mgmt_msg_aas_beam(void);
void proto_reg_handoff_mac_mgmt_msg_aas_beam(void);
static dissector_handle_t aas_handle;
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;
#ifdef OFDM
static const value_string vals_report_types[] =
{
{0, "BEAM_REP_IE"},
{0, NULL}
};
static const value_string vals_resolution_parameter[] =
{
{0, "report every 4th subcarrier"},
{1, "report every 8th subcarrier"},
{2, "report every 16th subcarrier"},
{3, "report every 32nd subcarrier"},
{4, "report every 64th subcarrier"},
{0, NULL}
};
#endif
/* fix fields */
/* static gint hf_aas_beam_unknown_type = -1; */
static gint hf_aas_beam_select_index = -1;
static gint hf_aas_beam_select_reserved = -1;
#ifdef OFDM
static gint hf_aas_beam_frame_number = -1;
static gint hf_aas_beam_feedback_request_number = -1;
static gint hf_aas_beam_measurement_report_type = -1;
static gint hf_aas_beam_resolution_parameter = -1;
static gint hf_aas_beam_beam_bit_mask = -1;
static int hf_aas_beam_freq_value_re = -1;
static int hf_aas_beam_freq_value_im = -1;
static int hf_aas_beam_rssi_value = -1;
static int hf_aas_beam_cinr_value = -1;
#endif
static int dissect_mac_mgmt_msg_aas_beam_select_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *aas_beam_item;
proto_tree *aas_beam_tree;
{ /* we are being asked for details */
/* display MAC message type */
aas_beam_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_aas_beam_decoder, tvb, offset, -1, "AAS Beam Select (AAS-BEAM-SELECT)");
/* add subtree */
aas_beam_tree = proto_item_add_subtree(aas_beam_item, ett_mac_mgmt_msg_aas_beam_select_decoder);
/* Decode and display the AAS-BEAM-SELECT message body */
/* display the AAS Beam Index */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_select_index, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the reserved fields */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_select_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
#ifdef OFDM
static int dissect_mac_mgmt_msg_aas_beam_req_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *aas_beam_item;
proto_tree *aas_beam_tree;
{ /* we are being asked for details */
/* display MAC message type */
aas_beam_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_aas_beam_decoder, tvb, offset, -1, "AAS Beam Request (AAS-BEAM-REQ)");
/* add subtree */
aas_beam_tree = proto_item_add_subtree(aas_beam_item, ett_mac_mgmt_msg_aas_beam_req_decoder);
/* Decode and display the AAS-BEAM-REQ message body */
/* display the Frame Number */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_frame_number, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
/* display the Feedback Request Number */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_feedback_request_number, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the Measurement Report Type */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_measurement_report_type, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the Resolution Parameter */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_resolution_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
/* display the Beam Bit mask */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_beam_bit_mask, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the reserved fields */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_select_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
static int dissect_mac_mgmt_msg_aas_beam_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tvb_len, report_type;
guint number_of_frequencies, indx;
proto_item *aas_beam_item;
proto_tree *aas_beam_tree;
{ /* we are being asked for details */
/* Get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* display MAC message type */
aas_beam_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_aas_beam_decoder, tvb, offset, -1, "AAS Beam Response (AAS-BEAM-RSP)");
/* add subtree */
aas_beam_tree = proto_item_add_subtree(aas_beam_item, ett_mac_mgmt_msg_aas_beam_rsp_decoder);
/* Decode and display the AAS-BEAM-RSP message body */
/* display the Frame Number */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_frame_number, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
/* get the Measurement Report Type */
report_type = tvb_get_guint8(tvb, offset);
/* display the Feedback Request Number */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_feedback_request_number, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the Measurement Report Type */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_measurement_report_type, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the Resolution Parameter */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_resolution_parameter, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
/* display the Beam Bit mask */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_beam_bit_mask, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the reserved fields */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_select_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
/* check the Measurement Report Type */
if((report_type & AAS_BEAM_MEASUREMENT_REPORT_TYPE_MASK) == 0)
{
/* calculate the total number of frequencies */
number_of_frequencies = (tvb_len - offset) / 2 - 1;
/* display the frequency */
for(indx = 0; indx < number_of_frequencies; indx++)
{ /* display the Frequency Value (real part) */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_freq_value_re, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
/* display the Frequency Value (imaginary part) */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_freq_value_im, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
}
}
/* display the RSSI Mean Value */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_rssi_value, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
/* display the CINR Mean Value */
proto_tree_add_item(aas_beam_tree, hf_aas_beam_cinr_value, tvb, offset, 1, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
#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_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
#if 0
{
&hf_aas_beam_unknown_type,
{
"Unknown TLV type", "wmx.aas_beam.unknown_type",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
}
#endif
};
/* 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_register_protocol (
"WiMax AAS-BEAM Messages", /* name */
"WiMax AAS-BEAM", /* short name */
"wmx.aas_beam" /* abbrev */
);
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));
aas_handle = register_dissector("mac_mgmt_msg_aas_beam_select_handler", dissect_mac_mgmt_msg_aas_beam_select_decoder, proto_mac_mgmt_msg_aas_beam_decoder);
#ifdef OFDM
register_dissector("mac_mgmt_msg_aas_beam_req_handler", dissect_mac_mgmt_msg_aas_beam_req_decoder, proto_mac_mgmt_msg_aas_beam_decoder);
register_dissector("mac_mgmt_msg_aas_beam_rsp_handler", dissect_mac_mgmt_msg_aas_beam_rsp_decoder, proto_mac_mgmt_msg_aas_beam_decoder);
#endif
}
void
proto_reg_handoff_mac_mgmt_msg_aas_beam(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_AAS_BEAM_SELECT, aas_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_aas_fbck.c | /* msg_aas_beam.c
* WiMax MAC Management AAS-BEAM-SELECT/REQ/RSP Messages decoders
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_mac.h"
#define OFDMA_AAS_FBCK_REQ_NUMBER_OF_FRAME_MASK 0xFE
#define OFDMA_AAS_FBCK_REQ_DATA_TYPE_MASK 0x01
#define OFDMA_AAS_FBCK_REQ_FB_REQ_COUNTER_MASK 0xE0
#define OFDMA_AAS_FBCK_REQ_FB_REQ_RESOLUTION_MASK 0x18
#define OFDMA_AAS_FBCK_REQ_FB_REQ_RESERVED_MASK 0x07
#define OFDMA_AAS_FBCK_REQ_FB_RSP_RESERVED_MASK 0xC0
#define OFDMA_AAS_FBCK_RSP_DATA_TYPE_MASK 0x20
#define OFDMA_AAS_FBCK_REQ_FB_RSP_COUNTER_MASK 0x1C
#define OFDMA_AAS_FBCK_REQ_FB_RSP_RESOLUTION_MASK 0x03
void proto_register_mac_mgmt_msg_aas_fbck(void);
void proto_reg_handoff_mac_mgmt_msg_aas(void);
static dissector_handle_t aas_req_handle;
static dissector_handle_t aas_rsp_handle;
static 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;
static const value_string vals_data_types[] =
{
{0, "measure on downlink preamble only"},
{1, "measure on downlink data (for this SS) only"},
{0, NULL}
};
static const value_string vals_resolutions_0[] =
{
{0, "32 subcarriers"},
{1, "64 subcarriers"},
{2, "128 subcarriers"},
{3, "256 subcarriers"},
{0, NULL}
};
static const value_string vals_resolutions_1[] =
{
{0, "1 subcarrier"},
{1, "4 subcarriers"},
{2, "8 subcarriers"},
{3, "16 subcarriers"},
{0, NULL}
};
/* fix fields */
/* static int hf_aas_fbck_unknown_type = -1; */
static int hf_aas_fbck_frame_number = -1;
static int hf_aas_fbck_number_of_frames = -1;
static int hf_aas_fbck_req_data_type = -1;
static int hf_aas_fbck_rsp_data_type = -1;
static int hf_aas_fbck_req_counter = -1;
static int hf_aas_fbck_rsp_counter = -1;
static int hf_aas_fbck_req_resolution_0 = -1;
static int hf_aas_fbck_rsp_resolution_0 = -1;
static int hf_aas_fbck_req_resolution_1 = -1;
static int hf_aas_fbck_rsp_resolution_1 = -1;
static int hf_aas_fbck_req_reserved = -1;
static int hf_aas_fbck_rsp_reserved = -1;
static int hf_aas_fbck_freq_value_re = -1;
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;
static int dissect_mac_mgmt_msg_aas_fbck_req_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint data_type;
proto_item *aas_fbck_item;
proto_tree *aas_fbck_tree;
{ /* we are being asked for details */
/* display MAC message type */
aas_fbck_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_aas_fbck_decoder, tvb, offset, -1, "AAS Channel Feedback Request (AAS-FBCK-REQ)");
/* 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 */
/* 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, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
/* display the Data Type */
proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_data_type, tvb, offset, 1, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
else
proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_resolution_0, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the reserved fields */
proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_req_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
static int dissect_mac_mgmt_msg_aas_fbck_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tvb_len, data_type;
proto_item *aas_fbck_item;
proto_tree *aas_fbck_tree;
{ /* we are being asked for details */
/* 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, -1, "AAS Channel Feedback Response (AAS-FBCK-RSP)");
/* add subtree */
aas_fbck_tree = proto_item_add_subtree(aas_fbck_item, ett_mac_mgmt_msg_aas_fbck_rsp_decoder);
/* Display the AAS-FBCK-RSP message type */
/* 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, ENC_BIG_ENDIAN);
/* display the Data Type */
proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_data_type, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the Feedback Request Counter */
proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_counter, tvb, offset, 1, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
else
proto_tree_add_item(aas_fbck_tree, hf_aas_fbck_rsp_resolution_0, tvb, offset, 1, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_aas_fbck(void)
{
/* AAS-FBCK display */
static hf_register_info hf_aas_fbck[] =
{
{
&hf_aas_fbck_cinr_value,
{
"CINR Mean Value", "wmx.aas_fbck.cinr_mean_value",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_aas_fbck_req_counter,
{
"Feedback Request Counter", "wmx.aas_fbck.counter",
FT_UINT8, BASE_DEC, NULL, OFDMA_AAS_FBCK_REQ_FB_REQ_COUNTER_MASK, NULL, HFILL
}
},
{
&hf_aas_fbck_frame_number,
{
"Frame Number", "wmx.aas_fbck.frame_number",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_aas_fbck_freq_value_re,
{
"Frequency Value (real part)", "wmx.aas_fbck.freq_value_re",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_aas_fbck_freq_value_im,
{
"Frequency Value (imaginary part)", "wmx.aas_fbck.freq_value_im",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_aas_fbck_number_of_frames,
{
"Number Of Frames", "wmx.aas_fbck.number_of_frames",
FT_UINT8, BASE_DEC, NULL, OFDMA_AAS_FBCK_REQ_NUMBER_OF_FRAME_MASK, NULL, HFILL
}
},
{
&hf_aas_fbck_req_resolution_0,
{
"Frequency Measurement Resolution", "wmx.aas_fbck.resolution",
FT_UINT8, BASE_DEC, VALS(vals_resolutions_0), OFDMA_AAS_FBCK_REQ_FB_REQ_RESOLUTION_MASK, NULL, HFILL
}
},
{
&hf_aas_fbck_req_resolution_1,
{
"Frequency Measurement Resolution", "wmx.aas_fbck.resolution",
FT_UINT8, BASE_DEC, VALS(vals_resolutions_1), OFDMA_AAS_FBCK_REQ_FB_REQ_RESOLUTION_MASK, NULL, HFILL
}
},
{
&hf_aas_fbck_rssi_value,
{
"RSSI Mean Value", "wmx.aas_fbck.rssi_mean_value",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
#if 0
{
&hf_aas_fbck_unknown_type,
{
"Unknown TLV type", "wmx.aas_fbck.unknown_type",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
#endif
{
&hf_aas_fbck_req_data_type,
{
"Measurement Data Type", "wmx.aas_fbck_req.data_type",
FT_UINT8, BASE_DEC, VALS(vals_data_types), OFDMA_AAS_FBCK_REQ_DATA_TYPE_MASK, NULL, HFILL
}
},
{
&hf_aas_fbck_req_reserved,
{
"Reserved", "wmx.aas_fbck_req.reserved",
FT_UINT8, BASE_HEX, NULL, OFDMA_AAS_FBCK_REQ_FB_REQ_RESERVED_MASK, NULL, HFILL
}
},
{
&hf_aas_fbck_rsp_counter,
{
"Feedback Request Counter", "wmx.aas_fbck_rsp.counter",
FT_UINT8, BASE_DEC, NULL, OFDMA_AAS_FBCK_REQ_FB_RSP_COUNTER_MASK, NULL, HFILL
}
},
{
&hf_aas_fbck_rsp_data_type,
{
"Measurement Data Type", "wmx.aas_fbck_rsp.data_type",
FT_UINT8, BASE_DEC, VALS(vals_data_types), OFDMA_AAS_FBCK_RSP_DATA_TYPE_MASK, NULL, HFILL
}
},
{
&hf_aas_fbck_rsp_reserved,
{
"Reserved", "wmx.aas_fbck_rsp.reserved",
FT_UINT8, BASE_HEX, NULL, OFDMA_AAS_FBCK_REQ_FB_RSP_RESERVED_MASK, NULL, HFILL
}
},
{
&hf_aas_fbck_rsp_resolution_0,
{
"Frequency Measurement Resolution", "wmx.aas_fbck_rsp.resolution",
FT_UINT8, BASE_DEC, VALS(vals_resolutions_0), OFDMA_AAS_FBCK_REQ_FB_RSP_RESOLUTION_MASK, NULL, HFILL
}
},
{
&hf_aas_fbck_rsp_resolution_1,
{
"Frequency Measurement Resolution", "wmx.aas_fbck_rsp.resolution",
FT_UINT8, BASE_DEC, VALS(vals_resolutions_1), OFDMA_AAS_FBCK_REQ_FB_RSP_RESOLUTION_MASK, NULL, HFILL
}
}
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_mgmt_msg_aas_fbck_req_decoder,
&ett_mac_mgmt_msg_aas_fbck_rsp_decoder,
};
proto_mac_mgmt_msg_aas_fbck_decoder = proto_register_protocol (
"WiMax AAS-FEEDBACK Messages", /* name */
"WiMax AAS-FEEDBACK (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));
aas_req_handle = register_dissector("mac_mgmt_msg_aas_feedback_req_handler", dissect_mac_mgmt_msg_aas_fbck_req_decoder, proto_mac_mgmt_msg_aas_fbck_decoder);
aas_rsp_handle = register_dissector("mac_mgmt_msg_aas_feedback_rsp_handler", dissect_mac_mgmt_msg_aas_fbck_rsp_decoder, proto_mac_mgmt_msg_aas_fbck_decoder);
}
void
proto_reg_handoff_mac_mgmt_msg_aas(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_AAS_FBCK_REQ, aas_req_handle);
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_AAS_FBCK_RSP, aas_rsp_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_arq.c | /* msg_arq.c
* WiMax MAC Management ARQ Feedback, Discard, Reset Message decoders
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: John R. Underwood <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_mac.h"
void proto_register_mac_mgmt_msg_arq_feedback(void);
void proto_reg_handoff_mac_mgmt_msg_arq(void);
static int dissect_mac_mgmt_msg_arq_feedback_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
static int dissect_mac_mgmt_msg_arq_discard_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
static int dissect_mac_mgmt_msg_arq_reset_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
static dissector_handle_t arq_feedback_handle;
static dissector_handle_t arq_discard_handle;
static dissector_handle_t arq_reset_handle;
static gint proto_mac_mgmt_msg_arq_decoder = -1;
static gint ett_mac_mgmt_msg_arq_decoder = -1;
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_mgmt_msg_arq_decoder,
};
/* ARQ fields */
static gint hf_arq_cid = -1;
static gint hf_arq_last = -1;
static gint hf_arq_ack_type = -1;
static gint hf_ack_type_reserved = -1;
static gint hf_arq_bsn = -1;
static gint hf_arq_num_ack_maps = -1;
static gint hf_arq_selective_map = -1;
static gint hf_arq_seq_format = -1;
static gint hf_arq_0seq_ack_map = -1;
static gint hf_arq_0seq1_len = -1;
static gint hf_arq_0seq2_len = -1;
static gint hf_arq_1seq_ack_map = -1;
static gint hf_arq_1seq1_len = -1;
static gint hf_arq_1seq2_len = -1;
static gint hf_arq_1seq3_len = -1;
static gint hf_arq_reserved = -1;
static gint hf_arq_discard_cid = -1;
static gint hf_arq_discard_reserved = -1;
static gint hf_arq_discard_bsn = -1;
static gint hf_arq_reset_cid = -1;
static gint hf_arq_reset_type = -1;
static gint hf_arq_reset_direction = -1;
static gint hf_arq_reset_reserved = -1;
/* STRING RESOURCES */
#if 0
static const true_false_string tfs_present = {
"present",
"absent"
};
#endif
#if 0
static const true_false_string tfs_rng_req_aas_broadcast = {
"SS cannot receive broadcast messages",
"SS can receive broadcast messages"
};
#endif
static const true_false_string tfs_arq_last = {
"Last ARQ feedback IE in the list",
"More ARQ feedback IE in the list"
};
static const value_string vals_arq_ack_type[] = {
{0, "Selective ACK entry"},
{1, "Cumulative ACK entry"},
{2, "Cumulative with Selective ACK entry"},
{3, "Cumulative ACK with Block Sequence Ack entry"},
{0, NULL}
};
static const value_string vals_arq_reset_type[] = {
{0, "Original message from Initiator"},
{1, "Acknowledgment from Responder"},
{2, "Confirmation from Initiator"},
{3, "Reserved"},
{0, NULL}
};
static const value_string vals_arq_reset_direction[] = {
{0, "Uplink or downlink"},
{1, "Uplink"},
{2, "Downlink"},
{3, "Reserved"},
{0, NULL}
};
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_arq_feedback(void)
{
/* ARQ fields display */
static hf_register_info hf[] =
{
{
&hf_arq_ack_type,
{
"ACK Type", "wmx.arq.ack_type",
FT_UINT8, BASE_DEC, VALS(vals_arq_ack_type), 0x60, NULL, HFILL
}
},
{
&hf_arq_bsn,
{
"BSN", "wmx.arq.bsn",
FT_UINT16, BASE_DEC, NULL, 0x1FFC, NULL, HFILL
}
},
{
&hf_arq_cid,
{
"Connection ID", "wmx.arq.cid",
FT_UINT16, BASE_DEC, NULL, 0x00, "The ID of the connection being referenced", HFILL
}
},
{
&hf_arq_discard_bsn,
{
"BSN", "wmx.arq.discard_bsn",
FT_UINT16, BASE_DEC, NULL, 0x07FF, NULL, HFILL
}
},
{
&hf_arq_discard_cid,
{
"Connection ID", "wmx.arq.discard_cid",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_arq_discard_reserved,
{
"Reserved", "wmx.arq.discard_reserved",
FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL
}
},
{
&hf_arq_last,
{
"LAST", "wmx.arq.last",
FT_BOOLEAN, 8, TFS(&tfs_arq_last), 0x80, NULL, HFILL
}
},
{
&hf_arq_num_ack_maps,
{
"Number of ACK Maps", "wmx.arq.num_maps",
FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL
}
},
{
&hf_arq_reserved,
{
"Reserved", "wmx.arq.reserved",
FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL
}
},
{
&hf_arq_reset_cid,
{
"Connection ID", "wmx.arq.reset_cid",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_arq_reset_direction,
{
"Direction", "wmx.arq.reset_direction",
FT_UINT8, BASE_DEC, VALS(vals_arq_reset_direction), 0x30, NULL, HFILL
}
},
{
&hf_arq_reset_reserved,
{
"Reserved", "wmx.arq.reset_reserved",
FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL
}
},
{
&hf_arq_reset_type,
{
"Type", "wmx.arq.reset_type",
FT_UINT8, BASE_DEC, VALS(vals_arq_reset_type), 0xC0, NULL, HFILL
}
},
{
&hf_arq_selective_map,
{
"Selective ACK Map", "wmx.arq.selective_map",
FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_arq_0seq_ack_map,
{
"Sequence ACK Map", "wmx.arq.seq_ack_map",
FT_UINT8, BASE_HEX, NULL, 0x60, NULL, HFILL
}
},
{
&hf_arq_1seq_ack_map,
{
"Sequence ACK Map", "wmx.arq.seq_ack_map",
FT_UINT8, BASE_HEX, NULL, 0x70, NULL, HFILL
}
},
{
&hf_arq_seq_format,
{
"Sequence Format", "wmx.arq.seq_format",
FT_UINT8, BASE_DEC, NULL, 0x80, NULL, HFILL
}
},
{
&hf_arq_0seq1_len,
{
"Sequence 1 Length", "wmx.arq.seq1_len",
FT_UINT16, BASE_DEC, NULL, 0x1F80, NULL, HFILL
}
},
{
&hf_arq_0seq2_len,
{
"Sequence 2 Length", "wmx.arq.seq2_len",
FT_UINT16, BASE_DEC, NULL, 0x007E, NULL, HFILL
}
},
{
&hf_arq_1seq1_len,
{
"Sequence 1 Length", "wmx.arq.seq1_len",
FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL
}
},
{
&hf_arq_1seq2_len,
{
"Sequence 2 Length", "wmx.arq.seq2_len",
FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL
}
},
{
&hf_arq_1seq3_len,
{
"Sequence 3 Length", "wmx.arq.seq3_len",
FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL
}
},
{
&hf_ack_type_reserved,
{
"Reserved", "wmx.ack_type.reserved",
FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL
}
}
};
proto_mac_mgmt_msg_arq_decoder = proto_register_protocol (
"WiMax ARQ Feedback/Discard/Reset Messages", /* name */
"WiMax ARQ Feedback/Discard/Reset (arq)", /* short name */
"wmx.arq" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_arq_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
arq_feedback_handle = register_dissector("mac_mgmt_msg_arq_feedback_handler", dissect_mac_mgmt_msg_arq_feedback_decoder, proto_mac_mgmt_msg_arq_decoder);
arq_discard_handle = register_dissector("mac_mgmt_msg_arq_discard_handler", dissect_mac_mgmt_msg_arq_discard_decoder, proto_mac_mgmt_msg_arq_decoder);
arq_reset_handle = register_dissector("mac_mgmt_msg_arq_reset_handler", dissect_mac_mgmt_msg_arq_reset_decoder, proto_mac_mgmt_msg_arq_decoder);
}
/* Decode ARQ-Feedback messages. */
static int dissect_mac_mgmt_msg_arq_feedback_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint arq_feedback_ie_count = 0;
guint arq_cid;
gboolean arq_last = FALSE;
guint arq_ack_type;
guint arq_bsn;
guint arq_num_ack_maps;
guint tvb_len;
proto_item *arq_feedback_item;
proto_tree *arq_feedback_tree;
proto_item *arq_fb_item = NULL;
proto_tree *arq_fb_tree = NULL;
proto_item *ti = NULL;
guint i, seq_format;
{ /* we are being asked for details */
/* Get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* display MAC payload type ARQ-Feedback */
arq_feedback_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_arq_decoder, tvb, offset, -1, "MAC Management Message, ARQ-Feedback");
/* add MAC ARQ Feedback subtree */
arq_feedback_tree = proto_item_add_subtree(arq_feedback_item, ett_mac_mgmt_msg_arq_decoder);
while(offset < tvb_len && !arq_last)
{
arq_feedback_ie_count++;
arq_cid = tvb_get_ntohs(tvb, offset);
arq_last = ((tvb_get_guint8(tvb, offset + 2) & 0x80) != 0);
arq_ack_type = (tvb_get_guint8(tvb, offset + 2) & 0x60) >> 5;
arq_bsn = (tvb_get_ntohs(tvb, offset + 2) & 0x1FFC) >> 2;
arq_num_ack_maps = 1 + (tvb_get_guint8(tvb, offset + 3) & 0x03);
arq_fb_item = proto_tree_add_protocol_format(arq_feedback_tree, proto_mac_mgmt_msg_arq_decoder, tvb, offset, tvb_len, "ARQ_Feedback_IE");
proto_item_append_text(arq_fb_item, ", CID: %u, %s ARQ feedback IE, %s, BSN: %u",
arq_cid, arq_last ? "Last" : "More", val_to_str_const(arq_ack_type, vals_arq_ack_type, ""), arq_bsn);
if (arq_ack_type != ARQ_CUMULATIVE_ACK_ENTRY) {
proto_item_append_text(arq_fb_item, ", %u ACK Map(s)", arq_num_ack_maps);
}
/* add ARQ Feedback IE subtree */
arq_fb_tree = proto_item_add_subtree(arq_fb_item, ett_mac_mgmt_msg_arq_decoder);
proto_tree_add_item(arq_fb_tree, hf_arq_cid, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_fb_tree, hf_arq_last, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_fb_tree, hf_arq_ack_type, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_fb_tree, hf_arq_bsn, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
if (arq_ack_type != ARQ_CUMULATIVE_ACK_ENTRY) {
ti = proto_tree_add_item(arq_fb_tree, hf_arq_num_ack_maps, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
proto_item_append_text(ti, " (%d map(s))", arq_num_ack_maps);
offset += 2;
for (i = 0; i < arq_num_ack_maps; i++) {
/* Each ACK Map is 16 bits. */
offset += 2;
if (arq_ack_type != 3) {
proto_tree_add_item(arq_fb_tree, hf_arq_selective_map, tvb, offset, 2, ENC_BIG_ENDIAN);
} else {
proto_tree_add_item(arq_fb_tree, hf_arq_seq_format, tvb, offset, 1, ENC_BIG_ENDIAN);
seq_format = (tvb_get_guint8(tvb, offset) & 0x80) >> 7;
if (seq_format == 0) {
proto_tree_add_item(arq_fb_tree, hf_arq_0seq_ack_map, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_fb_tree, hf_arq_0seq1_len, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_fb_tree, hf_arq_0seq2_len, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_fb_tree, hf_arq_reserved, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
} else {
proto_tree_add_item(arq_fb_tree, hf_arq_1seq_ack_map, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_fb_tree, hf_arq_1seq1_len, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_fb_tree, hf_arq_1seq2_len, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_fb_tree, hf_arq_1seq3_len, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
}
}
}
} else {
/* Number of ACK Maps bits are reserved when ACK TYPE == 1 */
proto_tree_add_item(arq_fb_tree, hf_ack_type_reserved, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
/* update the offset */
offset += 2;
}
/* update the offset */
offset += 2;
}
proto_item_append_text(arq_feedback_item, ", %u ARQ_feedback_IE(s)", arq_feedback_ie_count);
}
return tvb_captured_length(tvb);
}
/* Decode ARQ-Discard messages. */
static int dissect_mac_mgmt_msg_arq_discard_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
proto_item *arq_discard_item;
proto_tree *arq_discard_tree;
{ /* we are being asked for details */
/* display MAC payload type ARQ-Discard */
arq_discard_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_arq_decoder, tvb, 0, -1, "MAC Management Message, ARQ-Discard");
/* add MAC ARQ Discard subtree */
arq_discard_tree = proto_item_add_subtree(arq_discard_item, ett_mac_mgmt_msg_arq_decoder);
proto_tree_add_item(arq_discard_tree, hf_arq_discard_cid, tvb, 1, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_discard_tree, hf_arq_discard_reserved, tvb, 3, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_discard_tree, hf_arq_discard_bsn, tvb, 3, 2, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
/* Decode ARQ-Reset messages. */
static int dissect_mac_mgmt_msg_arq_reset_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
proto_item *arq_reset_item;
proto_tree *arq_reset_tree;
{ /* we are being asked for details */
/* display MAC payload type ARQ-Reset */
arq_reset_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_arq_decoder, tvb, 0, -1, "MAC Management Message, ARQ-Reset");
/* add MAC ARQ Reset subtree */
arq_reset_tree = proto_item_add_subtree(arq_reset_item, ett_mac_mgmt_msg_arq_decoder);
proto_tree_add_item(arq_reset_tree, hf_arq_reset_cid, tvb, 1, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_reset_tree, hf_arq_reset_type, tvb, 3, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_reset_tree, hf_arq_reset_direction, tvb, 3, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(arq_reset_tree, hf_arq_reset_reserved, tvb, 3, 1, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
void
proto_reg_handoff_mac_mgmt_msg_arq(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_ARQ_FEEDBACK, arq_feedback_handle);
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_ARQ_DISCARD, arq_discard_handle);
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_ARQ_RESET, arq_reset_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_clk_cmp.c | /* msg_clk_cmp.c
* WiMax MAC Management CLK_CMP Message decoders
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_mac.h"
void proto_register_mac_mgmt_msg_clk_cmp(void);
void proto_reg_handoff_mac_mgmt_msg_clk_cmp(void);
static dissector_handle_t clk_cmp_handle;
static gint proto_mac_mgmt_msg_clk_cmp_decoder = -1;
static gint ett_mac_mgmt_msg_clk_cmp_decoder = -1;
/* CLK_CMP fields */
static gint hf_clk_cmp_clock_count = -1;
static gint hf_clk_cmp_clock_id = -1;
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. */
static int dissect_mac_mgmt_msg_clk_cmp_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint i;
guint clock_count;
proto_item *clk_cmp_item;
proto_tree *clk_cmp_tree;
{ /* we are being asked for details */
/* display MAC payload type CLK_CMP */
clk_cmp_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_clk_cmp_decoder, tvb, offset, -1, "Clock Comparison (CLK-CMP)");
/* add MAC CLK_CMP subtree */
clk_cmp_tree = proto_item_add_subtree(clk_cmp_item, ett_mac_mgmt_msg_clk_cmp_decoder);
/* 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, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
/* display the sequence number */
proto_tree_add_item(clk_cmp_tree, hf_clk_cmp_seq_number, tvb, offset++, 1, ENC_BIG_ENDIAN);
/* display the comparison value */
proto_tree_add_item(clk_cmp_tree, hf_clk_cmp_comparison_value, tvb, offset++, 1, ENC_BIG_ENDIAN);
}
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_clk_cmp(void)
{
/* CLK_CMP fields display */
static hf_register_info hf_clk_cmp[] =
{
{
&hf_clk_cmp_clock_count,
{
"Clock Count", "wmx.clk_cmp.clock_count",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_clk_cmp_clock_id,
{
"Clock ID", "wmx.clk_cmp.clock_id",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_clk_cmp_comparison_value,
{
"Comparison Value", "wmx.clk_cmp.comparison_value",
FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
#if 0
{
&hf_clk_cmp_invalid_tlv,
{
"Invalid TLV", "wmx.clk_cmp.invalid_tlv",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
}
},
#endif
{
&hf_clk_cmp_seq_number,
{
"Sequence Number", "wmx.clk_cmp.seq_number",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
}
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_mgmt_msg_clk_cmp_decoder,
};
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));
clk_cmp_handle = register_dissector("mac_mgmt_msg_clk_cmp_handler", dissect_mac_mgmt_msg_clk_cmp_decoder, proto_mac_mgmt_msg_clk_cmp_decoder);
}
void
proto_reg_handoff_mac_mgmt_msg_clk_cmp(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_CLK_CMP, clk_cmp_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_dcd.c | /* msg_dcd.c
* WiMax MAC Management DCD Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
/*
#define DEBUG
*/
#include <epan/packet.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
/* Delete the following variable as soon as possible */
extern gboolean include_cor2_changes;
void proto_register_mac_mgmt_msg_dcd(void);
void proto_reg_handoff_mac_mgmt_msg_dcd(void);
static dissector_handle_t dcd_handle;
static gint proto_mac_mgmt_msg_dcd_decoder = -1;
static gint ett_mac_mgmt_msg_dcd_decoder = -1;
/* fix fields */
static gint hf_dcd_downlink_channel_id = -1;
static gint hf_dcd_config_change_count = -1;
static gint hf_dcd_dl_burst_profile_rsv = -1;
static gint hf_dcd_dl_burst_profile_diuc = -1;
static gint hf_dcd_bs_eirp = -1;
static gint hf_dcd_frame_duration = -1;
static gint hf_dcd_phy_type = -1;
static gint hf_dcd_power_adjustment = -1;
static gint hf_dcd_channel_nr = -1;
static gint hf_dcd_ttg = -1;
static gint hf_dcd_rtg = -1;
#ifdef WIMAX_16D_2004
static gint hf_dcd_rss = -1;
#endif
static gint hf_dcd_channel_switch_frame_nr = -1;
static gint hf_dcd_frequency = -1;
static gint hf_dcd_bs_id = -1;
static gint hf_dcd_frame_duration_code = -1;
static gint hf_dcd_frame_nr = -1;
#ifdef WIMAX_16D_2004
static gint hf_dcd_size_cqich_id = -1;
static gint hf_dcd_h_arq_ack_delay_dl = -1;
#else
static gint hf_dcd_h_arq_ack_delay_ul = -1;
#endif
static gint hf_dcd_mac_version = -1;
static gint hf_dcd_restart_count = -1;
/* static gint hf_dl_burst_reserved = -1; */
/* static gint hf_dl_burst_diuc = -1; */
static gint hf_dcd_burst_freq = -1;
static gint hf_dcd_burst_fec = -1;
static gint hf_dcd_burst_diuc_exit_threshold = -1;
static gint hf_dcd_burst_diuc_entry_threshold = -1;
static gint hf_dcd_burst_tcs = -1;
static gint hf_dcd_tlv_t_19_permutation_type_for_broadcast_regions_in_harq_zone = -1;
static gint hf_dcd_tlv_t_20_maximum_retransmission = -1;
static gint hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter = -1;
static gint hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_physical_cinr_measurements = -1;
static gint hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_rssi_measurements = -1;
static gint hf_dcd_tlv_t_22_dl_amc_allocated_physical_bands_bitmap = -1;
static gint hf_dcd_tlv_t_34_dl_region_definition = -1;
static gint hf_dcd_tlv_t_34_dl_region_definition_num_region = -1;
static gint hf_dcd_tlv_t_34_dl_region_definition_reserved = -1;
static gint hf_dcd_tlv_t_34_dl_region_definition_symbol_offset = -1;
static gint hf_dcd_eirxp = -1;
static gint hf_dcd_tlv_t_34_dl_region_definition_subchannel_offset = -1;
static gint hf_dcd_tlv_t_34_dl_region_definition_num_symbols = -1;
static gint hf_dcd_tlv_t_34_dl_region_definition_num_subchannels = -1;
static gint hf_dcd_tlv_t_50_ho_type_support = -1;
static gint hf_dcd_tlv_t_50_ho_type_support_ho = -1;
static gint hf_dcd_tlv_t_50_ho_type_support_mdho = -1;
static gint hf_dcd_tlv_t_50_ho_type_support_fbss_ho = -1;
static gint hf_dcd_tlv_t_50_ho_type_support_reserved = -1;
static gint hf_dcd_tlv_t_31_h_add_threshold = -1;
static gint hf_dcd_tlv_t_45_paging_interval_length = -1;
static gint hf_dcd_tlv_t_45_paging_interval_reserved = -1;
static gint hf_dcd_tlv_t_32_h_delete_threshold = -1;
static gint hf_dcd_tlv_t_33_asr = -1;
static gint hf_dcd_tlv_t_33_asr_m = -1;
static gint hf_dcd_tlv_t_33_asr_l = -1;
static gint hf_dcd_tlv_t_35_paging_group_id = -1;
static gint hf_dcd_tlv_t_36_tusc1_permutation_active_subchannels_bitmap = -1;
static gint hf_dcd_tlv_t_37_tusc2_permutation_active_subchannels_bitmap = -1;
static gint hf_dcd_tlv_t_51_hysteresis_margin = -1;
static gint hf_dcd_tlv_t_52_time_to_trigger_duration = -1;
static gint hf_dcd_tlv_t_60_noise_interference = -1;
static gint hf_dcd_tlv_t_153_downlink_burst_profile_for_mutiple_fec_types = -1;
static gint hf_dcd_tlv_t_541_type_function_action = -1;
static gint hf_dcd_tlv_t_541_type = -1;
static gint hf_dcd_tlv_t_541_function = -1;
static gint hf_dcd_tlv_t_541_action = -1;
static gint hf_dcd_tlv_t_542_trigger_value = -1;
static gint hf_dcd_tlv_t_543_trigger_averaging_duration = -1;
static gint hf_dcd_unknown_type = -1;
static gint hf_dcd_invalid_tlv = -1;
/* DCD DIUC messages (table 143) */
static const value_string diuc_msgs[] =
{
{ 0, "Downlink Burst Profile 1"},
{ 1, "Downlink Burst Profile 2"},
{ 2, "Downlink Burst Profile 3"},
{ 3, "Downlink Burst Profile 4"},
{ 4, "Downlink Burst Profile 5"},
{ 5, "Downlink Burst Profile 6"},
{ 6, "Downlink Burst Profile 7"},
{ 7, "Downlink Burst Profile 8"},
{ 8, "Downlink Burst Profile 9"},
{ 9, "Downlink Burst Profile 10"},
{10, "Downlink Burst Profile 11"},
{11, "Downlink Burst Profile 12"},
{12, "Downlink Burst Profile 13"},
{13, "Reserved"},
{14, "Gap"},
{15, "End of DL-MAP"},
{0, NULL}
};
static const value_string vals_dcd_type[] =
{
{0, "CINR metric"},
{1, "RSSI metric"},
{2, "RTD metric"},
{3, "Reserved"},
{0, NULL}
};
static const value_string vals_dcd_function[] =
{
{0, "Reserved"},
{1, "Metric of neighbor BS is greater than absolute value"},
{2, "Metric of neighbor BS is less than absolute value"},
{3, "Metric of neighbor BS is greater than serving BS metric by relative value"},
{4, "Metric of neighbor BS is less than serving BS metric by relative value"},
{5, "Metric of serving BS greater than absolute value"},
{6, "Metric of serving BS less than absolute value"},
{7, "Reserved"},
{0, NULL}
};
static const value_string vals_dcd_action[] =
{
{0, "Reserved"},
{1, "Respond on trigger with MOB_SCN-REP after the end of each scanning interval"},
{2, "Respond on trigger with MOB_MSH-REQ"},
{3, "On trigger, MS starts neighbor BS scanning process by sending MOB_SCN-REQ"},
{4, "Reserved"},
{0, NULL}
};
static const value_string vals_dcd_power_adjustmnt[] =
{
{0, "Preserve Peak Power"},
{1, "Preserve Mean Power"},
{0, NULL}
};
#if 0
static const true_false_string tfs_dcd_power_adjustment =
{
"Preserve Mean Power",
"Preserve Peak Power"
};
#endif
#if 0
static const value_string vals_reg_rsp_status[] =
{
{0, "OK"},
{1, "Message authentication failure"},
{0, NULL}
};
#endif
static const value_string vals_dcd_burst_tcs[] =
{
{0, "TCS disabled"},
{1, "TCS enabled"},
{0, NULL}
};
#if 0
static const true_false_string tfs_dcd_burst_tcs =
{
"TCS enabled",
"TCS disabled"
};
#endif
static const value_string vals_dcd_frame_duration[] =
{
{0, "2.5"},
{1, "4"},
{2, "5"},
{3, "8"},
{4, "10"},
{5, "12.5"},
{6, "20"},
{0, NULL}
};
#ifdef WIMAX_16D_2004
static const value_string vals_dcd_size_of_cqich_id[] =
{
{0, "Reserved"},
{1, "3 bits"},
{2, "4 bits"},
{3, "5 bits"},
{4, "6 bits"},
{5, "7 bits"},
{6, "8 bits"},
{7, "9 bits"},
{0, NULL}
};
#endif
static const value_string vals_dcd_mac_version[] =
{
{ 1, "Conformance with IEEE Std 802.16-2001"},
{ 2, "Conformance with IEEE Std 802.16c-2002 and its predecessors"},
{ 3, "Conformance with IEEE Std 802.16a-2003 and its predecessors"},
{ 4, "Conformance with IEEE Std 802.16-2004"},
{ 5, "Conformance with IEEE Std 802.16-2004 and IEEE Std 802.16e-2005"},
{ 6, "Conformance with IEEE Std 802.16-2004, IEEE Std 802.16e-2005 and IEEE Std 802.16f-2005"},
{ 7, "Conformance with IEEE Std 802.16-2004, IEEE Std 802.16e-2005, IEEE Std 802.16f-2005 and IEEE Std 802.16g-2007"},
{ 8, "Conformance with IEEE Std 802.16-2009"},
{ 9, "Conformance with IEEE Std 802.16-2009 and IEEE Std 802.16j-2009"},
{10, "Reserved"},
{0, NULL}
};
/* table 363 */
static const value_string vals_dcd_burst_fec_ofdma[] =
{
{ 0, "QPSK (CC) 1/2"},
{ 1, "QPSK (CC) 3/4"},
{ 2, "16-QAM (CC) 1/2"},
{ 3, "16-QAM (CC) 3/4"},
{ 4, "64-QAM (CC) 1/2"},
{ 5, "64-QAM (CC) 2/3"},
{ 6, "64-QAM (CC) 3/4"},
{ 7, "QPSK (BTC) 1/2"},
{ 8, "QPSK (BTC) 3/4 or 2/3"},
{ 9, "16-QAM (BTC) 3/5"},
{10, "16-QAM (BTC) 4/5"},
{11, "64-QAM (BTC) 2/3 or 5/8"},
{12, "64-QAM (BTC) 5/6 or 4/5"},
{13, "QPSK (CTC) 1/2"},
{14, "Reserved"},
{15, "QPSK (CTC) 3/4"},
{16, "16-QAM (CTC) 1/2"},
{17, "16-QAM (CTC) 3/4"},
{18, "64-QAM (CTC) 1/2"},
{19, "64-QAM (CTC) 2/3"},
{20, "64-QAM (CTC) 3/4"},
{21, "64-QAM (CTC) 5/6"},
{22, "QPSK (ZT CC) 1/2"},
{23, "QPSK (ZT CC) 3/4"},
{24, "16-QAM (ZT CC) 1/2"},
{25, "16-QAM (ZT CC) 3/4"},
{26, "64-QAM (ZT CC) 1/2"},
{27, "64-QAM (ZT CC) 2/3"},
{28, "64-QAM (ZT CC) 3/4"},
{29, "QPSK (LDPC) 1/2"},
{30, "QPSK (LDPC) 2/3 A code"},
{31, "16-QAM (LDPC) 3/4 A code"},
{32, "16-QAM (LDPC) 1/2"},
{33, "16-QAM (LDPC) 2/3 A code"},
{34, "16-QAM (LDPC) 3/4 A code"},
{35, "64-QAM (LDPC) 1/2"},
{36, "64-QAM (LDPC) 2/3 A code"},
{37, "64-QAM (LDPC) 3/4 A code"},
{38, "QPSK (LDPC) 2/3 B code"},
{39, "QPSK (LDPC) 3/4 B code"},
{40, "16-QAM (LDPC) 2/3 B code"},
{41, "16-QAM (LDPC) 3/4 B code"},
{42, "64-QAM (LDPC) 2/3 B code"},
{43, "64-QAM (LDPC) 3/4 B code"},
{44, "QPSK (CC with optional interleaver) 1/2"},
{45, "QPSK (CC with optional interleaver) 3/4"},
{46, "16-QAM (CC with optional interleaver) 1/2"},
{47, "16-QAM (CC optional interleaver) 3/4"},
{48, "64-QAM (CC with optional interleaver) 2/3"},
{49, "64-QAM (CC with optional interleaver) 3/4"},
{50, "QPSK (LDPC) 5/6"},
{51, "16-QAM (LDPC) 5/6"},
{52, "64-QAM (LDPC) 5/6"},
{0, NULL}
};
static const value_string vals_dcd_permutation_type[] =
{
{0, "PUSC"},
{1, "FUSC"},
{2, "optional FUSC"},
{3, "AMC"},
{0, NULL}
};
static const value_string tfs_support[] =
{
{0, "not supported"},
{1, "supported"},
{0, NULL}
};
/* WiMax MAC Management DCD message (table 15) dissector */
static int dissect_mac_mgmt_msg_dcd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tvb_len, length;
gint tlv_type, tlv_len, tlv_offset, tlv_value_offset;
guint dl_burst_diuc, dl_num_regions;
proto_item *dcd_item, *tlv_item, *sub_item;
proto_tree *dcd_tree, *tlv_tree, *sub_tree;
tlv_info_t tlv_info;
gchar* proto_str;
{ /* 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)");
/* 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 Downlink Channel ID */
proto_tree_add_item(dcd_tree, hf_dcd_downlink_channel_id, tvb, offset, 1, ENC_BIG_ENDIAN);
/* set the offset for the Configuration Change Count */
offset++;
/* display the Configuration Change Count */
proto_tree_add_item(dcd_tree, hf_dcd_config_change_count, tvb, offset, 1, ENC_BIG_ENDIAN);
/* 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 */
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), ENC_NA);
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(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 */
proto_str = wmem_strdup_printf(pinfo->pool, "Downlink_Burst_Profile (DIUC=%u)", dl_burst_diuc);
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dcd_decoder, dcd_tree, proto_mac_mgmt_msg_dcd_decoder, tvb, offset-tlv_value_offset, tlv_len, proto_str);
/* detail display */
proto_tree_add_item(tlv_tree, hf_dcd_dl_burst_profile_rsv, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_dcd_dl_burst_profile_diuc, tvb, offset, 1, ENC_BIG_ENDIAN);
/* 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 */
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), ENC_NA);
break;
}
switch (tlv_type)
{
case DCD_BURST_FREQUENCY:
{
add_tlv_subtree(&tlv_info, tlv_tree, hf_dcd_burst_freq, tvb, (offset+tlv_offset), ENC_BIG_ENDIAN);
break;
}
case DCD_BURST_FEC_CODE_TYPE:
{
add_tlv_subtree(&tlv_info, tlv_tree, hf_dcd_burst_fec, tvb, (offset+tlv_offset), ENC_BIG_ENDIAN);
break;
}
case DCD_BURST_DIUC_EXIT_THRESHOLD:
{
add_tlv_subtree(&tlv_info, tlv_tree, hf_dcd_burst_diuc_exit_threshold, tvb, (offset+tlv_offset), ENC_BIG_ENDIAN);
break;
}
case DCD_BURST_DIUC_ENTRY_THRESHOLD:
{
add_tlv_subtree(&tlv_info, tlv_tree, hf_dcd_burst_diuc_entry_threshold, tvb, (offset+tlv_offset), ENC_BIG_ENDIAN);
break;
}
case DCD_BURST_TCS_ENABLE:
{
add_tlv_subtree(&tlv_info, tlv_tree, hf_dcd_burst_tcs, tvb, (offset+tlv_offset), ENC_BIG_ENDIAN);
break;
}
default:
/* ??? */
break;
}
tlv_offset += (length+get_tlv_value_offset(&tlv_info));
}
break;
}
case DCD_BS_EIRP:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_bs_eirp, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_FRAME_DURATION:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_frame_duration, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_PHY_TYPE:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_phy_type, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_POWER_ADJUSTMENT:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_power_adjustment, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_CHANNEL_NR:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_channel_nr, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_TTG:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_ttg, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_RTG:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_rtg, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
#ifdef WIMAX_16D_2004
case DCD_RSS:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_rss, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
#else
case DCD_EIRXP:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_eirxp, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
#endif
case DCD_CHANNEL_SWITCH_FRAME_NR:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_channel_switch_frame_nr, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_FREQUENCY:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_frequency, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_BS_ID:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_bs_id, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_FRAME_DURATION_CODE:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_frame_duration_code, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_FRAME_NR:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_frame_nr, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
#ifdef WIMAX_16D_2004
case DCD_SIZE_CQICH_ID:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_size_cqich_id, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
#endif
case DCD_H_ARQ_ACK_DELAY:
{
#ifdef WIMAX_16D_2004
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_h_arq_ack_delay_dl, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
#else
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_h_arq_ack_delay_ul, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
#endif
break;
}
case DCD_MAC_VERSION:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_mac_version, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_19_PERMUTATION_TYPE_FOR_BROADCAST_REGION_IN_HARQ_ZONE:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_19_permutation_type_for_broadcast_regions_in_harq_zone, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_20_MAXIMUM_RETRANSMISSION:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_20_maximum_retransmission, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_21_DEFAULT_RSSI_AND_CINR_AVERAGING_PARAMETER:
{
tlv_item = add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_dcd_decoder);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_physical_cinr_measurements, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_rssi_measurements, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_22_DL_AMC_ALLOCATED_PHYSICAL_BANDS_BITMAP:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_22_dl_amc_allocated_physical_bands_bitmap, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
case DCD_TLV_T_34_DL_REGION_DEFINITION:
{
tlv_item = add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_34_dl_region_definition, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_dcd_decoder);
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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_subchannel_offset, tvb, (tlv_offset+1), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_num_symbols, tvb, (tlv_offset+2), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_num_subchannels, tvb, (tlv_offset+3), 1, ENC_BIG_ENDIAN);
tlv_offset += 4;
}
break;
}
case DCD_TLV_T_50_HO_TYPE_SUPPORT:
{
tlv_item = add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_50_ho_type_support, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_dcd_decoder);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support_ho, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support_mdho, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support_fbss_ho, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_50_ho_type_support_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_31_H_ADD_THRESHOLD:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_31_h_add_threshold, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_32_H_DELETE_THRESHOLD:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_32_h_delete_threshold, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_33_ASR:
{
tlv_item = add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_33_asr, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_dcd_decoder);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_33_asr_m, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_33_asr_l, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_35_PAGING_GROUP_ID:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_35_paging_group_id, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_36_TUSC1_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_36_tusc1_permutation_active_subchannels_bitmap, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_37_TUSC2_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_37_tusc2_permutation_active_subchannels_bitmap, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_51_HYSTERSIS_MARGIN:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_51_hysteresis_margin, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_52_TIME_TO_TRIGGER_DURATION:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_52_time_to_trigger_duration, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
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_value_offset, tlv_len, "DCD Trigger");
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 */
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), ENC_NA);
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_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_dcd_tlv_t_541_type_function_action, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
sub_tree = proto_item_add_subtree(sub_item, ett_mac_mgmt_msg_dcd_decoder);
proto_tree_add_item(sub_tree, hf_dcd_tlv_t_541_type, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_dcd_tlv_t_541_function, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_dcd_tlv_t_541_action, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
}
break;
case DCD_TLV_T542_TRIGGER_VALUE:
add_tlv_subtree(&tlv_info, tlv_tree, hf_dcd_tlv_t_542_trigger_value, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case DCD_TLV_T_543_TRIGGER_AVERAGING_DURATION:
add_tlv_subtree(&tlv_info, tlv_tree, hf_dcd_tlv_t_543_trigger_averaging_duration, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
}
tlv_offset += length;
}
break;
}
case DCD_TLV_T_60_NOISE_AND_INTERFERENCE:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_60_noise_interference, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_153_DOWNLINK_BURST_PROFILE_FOR_MULTIPLE_FEC_TYPES:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_153_downlink_burst_profile_for_mutiple_fec_types, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_RESTART_COUNT:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_restart_count, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case DCD_TLV_T_45_PAGING_INTERVAL_LENGTH:
{
if (include_cor2_changes) {
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_45_paging_interval_reserved, tvb, offset-tlv_value_offset, ENC_NA);
} else {
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_45_paging_interval_length, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
}
break;
}
default:
{
add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_unknown_type, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
}
offset += tlv_len;
} /* end of TLV process while loop */
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_dcd(void)
{
/* DCD display */
static hf_register_info hf[] =
{
{
&hf_dcd_tlv_t_33_asr,
{
"ASR (Anchor Switch Report) Slot Length (M) and Switching Period (L)", "wmx.dcd.asr",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_33_asr_l,
{
"ASR Switching Period (L)", "wmx.dcd.asr.l",
FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_frame_frames, 0x0f, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_33_asr_m,
{
"ASR Slot Length (M)", "wmx.dcd.asr.m",
FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_frame_frames, 0xf0, NULL, HFILL
}
},
{
&hf_dcd_bs_eirp,
{
"BS EIRP", "wmx.dcd.bs_eirp",
FT_INT16, BASE_DEC|BASE_UNIT_STRING, &wimax_units_dbm, 0x00, NULL, HFILL
}
},
{
&hf_dcd_bs_id,
{
"Base Station ID", "wmx.dcd.bs_id",
FT_ETHER, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_restart_count,
{
"BS Restart Count", "wmx.dcd.bs_restart_count",
FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
#if 0
{
&hf_dl_burst_diuc,
{
"DIUC", "wmx.dcd.burst.diuc",
FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL
}
},
#endif
{
&hf_dcd_burst_diuc_entry_threshold,
{
"DIUC Minimum Entry Threshold (in 0.25 dB units)", "wmx.dcd.burst.diuc_entry_threshold",
FT_FLOAT, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_burst_diuc_exit_threshold,
{
"DIUC Mandatory Exit Threshold (in 0.25 dB units)", "wmx.dcd.burst.diuc_exit_threshold",
FT_FLOAT, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_burst_fec,
{
"FEC Code Type", "wmx.dcd.burst.fec",
FT_UINT8, BASE_DEC, VALS(vals_dcd_burst_fec_ofdma), 0x00, NULL, HFILL
}
},
{
&hf_dcd_burst_freq,
{
"Frequency", "wmx.dcd.burst.freq",
FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_khz, 0x00, NULL, HFILL
}
},
#if 0
{
&hf_dl_burst_reserved,
{
"Reserved", "wmx.dcd.burst.reserved",
FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL
}
},
#endif
{
&hf_dcd_burst_tcs,
{
"TCS", "wmx.dcd.burst.tcs",
FT_UINT8, BASE_DEC, VALS(vals_dcd_burst_tcs), 0x00, NULL, HFILL
}
},
{
&hf_dcd_channel_nr,
{
"Channel Nr", "wmx.dcd.channel_nr",
FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_config_change_count,
{
"Configuration Change Count", "wmx.dcd.config_change_count",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_physical_cinr_measurements,
{
"Default Averaging Parameter for Physical CINR Measurements (in multiples of 1/16)", "wmx.dcd.default_physical_cinr_meas_averaging_parameter",
FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter,
{
"Default RSSI and CINR Averaging Parameter", "wmx.dcd.default_rssi_and_cinr_averaging_parameter",
FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_rssi_measurements,
{
"Default Averaging Parameter for RSSI Measurements (in multiples of 1/16)", "wmx.dcd.default_rssi_meas_averaging_parameter",
FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_22_dl_amc_allocated_physical_bands_bitmap,
{
"DL AMC Allocated Physical Bands Bitmap", "wmx.dcd.dl_amc_allocated_phy_bands_bitmap",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dcd_dl_burst_profile_diuc,
{
"DIUC", "wmx.dcd.dl_burst_profile_diuc",
FT_UINT8, BASE_DEC, VALS(diuc_msgs), 0x0F, NULL, HFILL
}
},
{
&hf_dcd_dl_burst_profile_rsv,
{
"Reserved", "wmx.dcd.dl_burst_profile_rsv",
FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL
}
},
{
&hf_dcd_downlink_channel_id,
{
"Reserved", "wmx.dcd.dl_channel_id",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_153_downlink_burst_profile_for_mutiple_fec_types,
{
"Downlink Burst Profile for Multiple FEC Types","wmx.dcd.dl_burst_profile_multiple_fec_types",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_34_dl_region_definition,
{
"DL Region Definition", "wmx.dcd.dl_region_definition",
FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_34_dl_region_definition_num_region,
{
"Number of Regions", "wmx.dcd.dl_region_definition.num_region",
FT_UINT8, BASE_DEC, NULL, 0xFC, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_34_dl_region_definition_num_subchannels,
{
"Number of Subchannels", "wmx.dcd.dl_region_definition.num_subchannels",
FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_34_dl_region_definition_num_symbols,
{
"Number of OFDMA Symbols", "wmx.dcd.dl_region_definition.num_symbols",
FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_34_dl_region_definition_reserved,
{
"Reserved", "wmx.dcd.dl_region_definition.reserved",
FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_34_dl_region_definition_subchannel_offset,
{
"Subchannel Offset", "wmx.dcd.dl_region_definition.subchannel_offset",
FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_34_dl_region_definition_symbol_offset,
{
"OFDMA Symbol Offset", "wmx.dcd.dl_region_definition.symbol_offset",
FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
#ifndef WIMAX_16D_2004
{
&hf_dcd_eirxp,
{
"EIRXP (IR, max)", "wmx.dcd.eirxp",
FT_INT16, BASE_DEC|BASE_UNIT_STRING, &wimax_units_dbm, 0x00, NULL, HFILL
}
},
#endif
{
&hf_dcd_frame_duration,
{
"Frame Duration", "wmx.dcd.frame_duration",
FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_frame_duration_code,
{
"Frame Duration Code", "wmx.dcd.frame_duration_code",
FT_UINT8, BASE_HEX, VALS(vals_dcd_frame_duration), 0x00, NULL, HFILL
}
},
{
&hf_dcd_frame_nr,
{
"Frame Number", "wmx.dcd.frame_nr",
FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_frequency,
{
"Downlink Center Frequency", "wmx.dcd.frequency",
FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &wimax_units_khz, 0x00, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_31_h_add_threshold,
{
"H_add Threshold", "wmx.dcd.h_add_threshold",
FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_db, 0x0, NULL, HFILL
}
},
#ifdef WIMAX_16D_2004
{
&hf_dcd_h_arq_ack_delay_dl,
{
"H-ARQ ACK Delay for DL Burst", "wmx.dcd.h_arq_ack_delay_dl_burst",
FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_frame_offset, 0x00, "", HFILL
}
},
#else
{
&hf_dcd_h_arq_ack_delay_ul,
{
"H-ARQ ACK Delay for UL Burst", "wmx.dcd.h_arq_ack_delay_ul_burst",
FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_frame_offset, 0x00, NULL, HFILL
}
},
#endif
{
&hf_dcd_tlv_t_32_h_delete_threshold,
{
"H_delete Threshold", "wmx.dcd.h_delete_threshold",
FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_db, 0x0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_50_ho_type_support,
{
"HO Type Support", "wmx.dcd.ho_type_support",
FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_50_ho_type_support_fbss_ho,
{
"FBSS HO", "wmx.dcd.ho_type_support.fbss_ho",
FT_UINT8, BASE_HEX, VALS(tfs_support), 0x20, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_50_ho_type_support_ho,
{
"HO", "wmx.dcd.ho_type_support.ho",
FT_UINT8, BASE_HEX, VALS(tfs_support), 0x80, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_50_ho_type_support_mdho,
{
"MDHO", "wmx.dcd.ho_type_support.mdho",
FT_UINT8, BASE_HEX, VALS(tfs_support), 0x40, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_50_ho_type_support_reserved,
{
"Reserved", "wmx.dcd.ho_type_support.reserved",
FT_UINT8, BASE_HEX, NULL, 0x1f, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_51_hysteresis_margin,
{
"Hysteresis Margin", "wmx.dcd.hysteresis_margin",
FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_db, 0x0, NULL, HFILL
}
},
{
&hf_dcd_invalid_tlv,
{
"Invalid TLV", "wmx.dcd.invalid_tlv",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
}
},
{
&hf_dcd_mac_version,
{
"MAC Version", "wmx.dcd.mac_version",
FT_UINT8, BASE_DEC, VALS(vals_dcd_mac_version), 0x00, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_20_maximum_retransmission,
{
"Maximum Retransmission", "wmx.dcd.maximum_retransmission",
FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_60_noise_interference,
{
"Noise and Interference", "wmx.dcd.noise_interference",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_35_paging_group_id,
{
"Paging Group ID", "wmx.dcd.paging_group_id",
FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_36_tusc1_permutation_active_subchannels_bitmap,
{
"TUSC1 permutation active subchannels bitmap", "wmx.dcd.tusc1",
FT_UINT16, BASE_HEX, NULL, 0xFF80, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_37_tusc2_permutation_active_subchannels_bitmap,
{
"TUSC2 permutation active subchannels bitmap", "wmx.dcd.tusc2",
FT_UINT16, BASE_HEX, NULL, 0xFFF8, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_45_paging_interval_length,
{
"Paging Interval Length", "wmx.dcd.paging_interval_length",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_45_paging_interval_reserved,
{
"Reserved", "wmx.dcd.paging_interval_reserved",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_19_permutation_type_for_broadcast_regions_in_harq_zone,
{
"Permutation Type for Broadcast Region in HARQ Zone", "wmx.dcd.permutation_type_broadcast_region_in_harq_zone",
FT_UINT8, BASE_DEC, VALS(vals_dcd_permutation_type), 0x00, NULL, HFILL
}
},
{
&hf_dcd_phy_type,
{
"PHY Type", "wmx.dcd.phy_type",
FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_power_adjustment,
{
"Power Adjustment Rule", "wmx.dcd.power_adjustment",
FT_UINT8, BASE_HEX, VALS(vals_dcd_power_adjustmnt), 0x00, NULL, HFILL
}
},
#ifdef WIMAX_16D_2004
{
&hf_dcd_rss,
{
"RSS (IR, max)", "wmx.dcd.rss",
FT_INT16, BASE_DEC|BASE_UNIT_STRING, &wimax_units_dbm, 0x00, "", HFILL
}
},
#endif
{
&hf_dcd_rtg,
{
"RTG", "wmx.dcd.rtg",
FT_UINT8, BASE_HEX|BASE_UNIT_STRING, &wimax_units_ps, 0x00, NULL, HFILL
}
},
#ifdef WIMAX_16D_2004
{
&hf_dcd_size_cqich_id,
{
"Size of CQICH-ID Field", "wmx.dcd.size_cqich_id",
FT_UINT8, BASE_DEC, VALS(vals_dcd_size_of_cqich_id), 0x00, "", HFILL
}
},
#endif
{
&hf_dcd_channel_switch_frame_nr,
{
"Channel Switch Frame Number", "wmx.dcd.switch_frame",
FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_52_time_to_trigger_duration,
{
"Time to Trigger Duration", "wmx.dcd.time_trigger_duration",
FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_ms, 0x0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_543_trigger_averaging_duration,
{
"Trigger Averaging Duration", "wmx.dcd.trigger_averaging_duration",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_542_trigger_value,
{
"Trigger Value", "wmx.dcd.trigger_value",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dcd_ttg,
{
"TTG", "wmx.dcd.ttg",
FT_UINT16, BASE_HEX|BASE_UNIT_STRING, &wimax_units_ps, 0x00, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_541_type_function_action,
{
"Type/Function/Action", "wmx.dcd.type_function_action",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_541_action,
{
"Action", "wmx.dcd.type_function_action.action",
FT_UINT8, BASE_HEX, VALS(vals_dcd_action), 0x7, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_541_function,
{
"Function", "wmx.dcd.type_function_action.function",
FT_UINT8, BASE_HEX, VALS(vals_dcd_function), 0x38, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_541_type,
{
"Type", "wmx.dcd.type_function_action.type",
FT_UINT8, BASE_HEX, VALS(vals_dcd_type), 0xC0, NULL, HFILL
}
},
{
&hf_dcd_unknown_type,
{
"Unknown DCD Type", "wmx.dcd.unknown_tlv_value",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
}
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_mgmt_msg_dcd_decoder,
};
proto_mac_mgmt_msg_dcd_decoder = proto_register_protocol (
"WiMax DCD Messages", /* name */
"WiMax DCD", /* short name */
"wmx.dcd" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_dcd_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
dcd_handle = register_dissector("mac_mgmt_msg_dcd_handler", dissect_mac_mgmt_msg_dcd_decoder, proto_mac_mgmt_msg_dcd_decoder);
}
void proto_reg_handoff_mac_mgmt_msg_dcd(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DCD, dcd_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_dlmap.c | /* msg_dlmap.c
* WiMax MAC Management DL-MAP Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Mike Harvey <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#include "wimax_mac.h"
#include "crc.h"
#include "wimax_bits.h"
#include "wimax_utils.h"
extern gboolean include_cor2_changes;
void proto_register_mac_mgmt_msg_dlmap(void);
void proto_reg_handoff_mac_mgmt_msg_dlmap(void);
static dissector_handle_t dlmap_handle;
#define MAC_MGMT_MSG_DLMAP 2
#define XBIT_HF(bits, hf) \
proto_tree_add_bits_item(tree, hf, tvb, bit, bits, ENC_BIG_ENDIAN); bit += bits;
#define XBIT_HF_VALUE(var, bits, hf) \
do { \
var = TVB_BIT_BITS(bit, tvb, bits); \
proto_tree_add_bits_item(tree, hf, tvb, bit, bits, ENC_BIG_ENDIAN); \
bit += bits; \
} while(0)
#define VBIT(var, bits, hf) \
do { \
var = TVB_BIT_BITS(bit, tvb, bits); \
proto_tree_add_uint(tree, hf, tvb, BITHI(bit,bits), var); \
bit += bits; \
} while(0)
#define VNIB(var, nibs, hf) \
do { \
var = TVB_NIB_NIBS(nib, tvb, nibs); \
proto_tree_add_uint(tree, hf, tvb, NIBHI(nib, nibs), var); \
nib += nibs; \
} while(0)
gint harq = 0; /* 1 if HARQ enabled (TODO) */
gint fusc = 0; /* 1 if current zone permutation is FUSC or optional FUSC (TODO) */
gint tusc = 0; /* 1 if current zone permutation is AMC, TUSC1 or TUSC2 (TODO) */
gint ir_type = 0; /* reduced AAS map (TODO) */
gint RCID_Type = 0;
gint N_layer = 0;
gint STC_Zone_Dedicated_Pilots = 0;
gint STC_Zone_Matrix = 0;
gint INC_CID = 0;
gint sub_dl_ul_map = 0;
static 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_109x = -1; /* SUB-DL-UL-MAP */
static gint ett_109x_dl = -1;
static gint ett_109x_ul = -1;
static gint ett_275_phy = -1;
static gint ett_275_1 = -1;
static gint ett_277 = -1;
static gint ett_277b = -1;
static gint ett_278 = -1;
static gint ett_279 = -1;
static gint ett_280 = -1;
static gint ett_281 = -1;
static gint ett_282 = -1;
static gint ett_283 = -1;
static gint ett_284 = -1;
static gint ett_285 = -1;
static gint ett_286 = -1;
static gint ett_286a = -1;
static gint ett_286b = -1;
static gint ett_286c = -1;
static gint ett_286d = -1;
static gint ett_286e = -1;
static gint ett_286f = -1;
static gint ett_286g = -1;
static gint ett_286h = -1;
static gint ett_286i = -1;
static gint ett_286j = -1;
static gint ett_286k = -1;
static gint ett_286l = -1;
static gint ett_286m = -1;
static gint ett_286n = -1;
static gint ett_286o = -1;
static gint ett_286p = -1;
static gint ett_286q = -1;
static gint ett_286r = -1;
static gint ett_286s = -1;
static gint ett_286t = -1;
static gint ett_286u = -1;
static gint ett_286v = -1;
static gint ett_286w = -1;
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_308a = -1;
#define DCD_DOWNLINK_BURST_PROFILE 1
#define DCD_BS_EIRP 2
#define DCD_FRAME_DURATION 3
#define DCD_PHY_TYPE 4
#define DCD_POWER_ADJUSTMENT 5
#define DCD_CHANNEL_NR 6
#define DCD_TTG 7
#define DCD_RTG 8
#define DCD_RSS 9
#define DCD_CHANNEL_SWITCH_FRAME_NR 10
#define DCD_FREQUENCY 12
#define DCD_BS_ID 13
#define DCD_FRAME_DURATION_CODE 14
#define DCD_FRAME_NR 15
#define DCD_SIZE_CQICH_ID 16
#define DCD_H_ARQ_ACK_DELAY 17
#define DCD_MAC_VERSION 148
#define DCD_RESTART_COUNT 154
#define DCD_BURST_FREQUENCY 1
#define DCD_BURST_FEC_CODE_TYPE 150
#define DCD_BURST_DIUC_EXIT_THRESHOLD 151
#define DCD_BURST_DIUC_ENTRY_THRESHOLD 152
#define DCD_BURST_TCS_ENABLE 153
#define DCD_TLV_T_541_TYPE_FUNCTION_ACTION 1
#define DCD_TLV_T542_TRIGGER_VALUE 2
#define DCD_TLV_T_543_TRIGGER_AVERAGING_DURATION 3
#define DCD_TLV_T_19_PERMUTATION_TYPE_FOR_BROADCAST_REGION_IN_HARQ_ZONE 19
#define DCD_TLV_T_20_MAXIMUM_RETRANSMISSION 20
#define DCD_TLV_T_21_DEFAULT_RSSI_AND_CINR_AVERAGING_PARAMETER 21
#define DCD_TLV_T_22_DL_AMC_ALLOCATED_PHYSICAL_BANDS_BITMAP 22
#define DCD_TLV_T_31_H_ADD_THRESHOLD 31
#define DCD_TLV_T_32_H_DELETE_THRESHOLD 32
#define DCD_TLV_T_33_ASR 33
#define DCD_TLV_T_34_DL_REGION_DEFINITION 34
#define DCD_TLV_T_35_PAGING_GROUP_ID 35
#define DCD_TLV_T_36_TUSC1_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP 36
#define DCD_TLV_T_37_TUSC2_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP 37
#define DCD_TLV_T_45_PAGING_INTERVAL_LENGTH 45
#define DCD_TLV_T_50_HO_TYPE_SUPPORT 50
#define DCD_TLV_T_51_HYSTERSIS_MARGIN 51
#define DCD_TLV_T_52_TIME_TO_TRIGGER_DURATION 52
#define DCD_TLV_T_54_TRIGGER 54
#define DCD_TLV_T_153_DOWNLINK_BURST_PROFILE_FOR_MULTIPLE_FEC_TYPES 153
#define DL_MAP_NCT_PMP 0
#define DL_MAP_NCT_DM 1
#define DL_MAP_NCT_PTP 2
#if 0
/* NCT messages */
static const value_string nct_msgs[] =
{
{ DL_MAP_NCT_PMP, "PMP" },
{ DL_MAP_NCT_PMP, "DM" },
{ DL_MAP_NCT_PMP, "PTP" },
{ 0, NULL }
};
#endif
/* Repetition Coding Indications */
static const value_string rep_msgs[] =
{
{ 0, "No Repetition Coding" },
{ 1, "Repetition Coding of 2 Used" },
{ 2, "Repetition Coding of 4 Used" },
{ 3, "Repetition Coding of 6 Used" },
{ 0, NULL }
};
/* DL Frame Prefix Coding Indications */
static const value_string boost_msgs[] =
{
{ 0, "Normal (not boosted)" },
{ 1, "+6dB" },
{ 2, "-6dB" },
{ 3, "+9dB" },
{ 4, "+3dB" },
{ 5, "-3dB" },
{ 6, "-9dB" },
{ 7, "-12dB" },
{ 0, NULL }
};
/* OFDMA frame duration ms (Table 320)*/
static const value_string frame_duration[] =
{
{ 0, "reserved"},
{ 1, "2 ms"},
{ 2, "2.5 ms"},
{ 3, "4 ms"},
{ 4, "5 ms"},
{ 5, "8 ms"},
{ 6, "10 ms"},
{ 7, "12.5 ms"},
{ 8, "20 ms"},
{ 0, NULL}
};
/* OFDMA frames per second (Table 320)*/
static const value_string frames_per_second[] =
{
{ 0, "reserved"},
{ 1, "500"},
{ 2, "400"},
{ 3, "250"},
{ 4, "200"},
{ 5, "125"},
{ 6, "100"},
{ 7, "80"},
{ 8, "50"},
{ 0, NULL}
};
/* dl-map fields */
static gint hf_dlmap_phy_fdur = -1;
static gint hf_dlmap_phy_fdur_ms = -1;
static gint hf_dlmap_phy_fdur_per_sec = -1;
static gint hf_dlmap_phy_fnum = -1;
/* static gint hf_dlmap_fch_expected = -1; */
static gint hf_dlmap_dcd = -1;
static gint hf_dlmap_bsid = -1;
static gint hf_dlmap_ofdma_sym = -1;
/* static gint hf_dlmap_ie = -1; */
static gint hf_dlmap_ie_diuc = -1;
static gint hf_dlmap_ie_reserved_extended2_duic = -1;
static gint hf_dlmap_ie_reserved_extended_duic = -1;
static gint hf_dlmap_ie_diuc_ext = -1;
static gint hf_dlmap_ie_diuc_ext2 = -1;
static gint hf_dlmap_ie_length = -1;
static gint hf_dlmap_ie_bitmap = -1;
static gint hf_dlmap_ie_bitmap_cqi = -1;
static gint hf_dlmap_ie_bitmap_pusc = -1;
static gint hf_dlmap_ie_bitmap_opt_pusc = -1;
static gint hf_dlmap_ie_bitmap_amc = -1;
static gint hf_dlmap_ie_bitmap_aas = -1;
static gint hf_dlmap_ie_bitmap_periodic_ranging = -1;
static gint hf_dlmap_ie_bitmap_sounding = -1;
static gint hf_dlmap_ie_bitmap_mimo = -1;
static gint hf_dlmap_ie_ncid = -1;
static gint hf_dlmap_ie_cid = -1;
static gint hf_dlmap_ie_offsym = -1;
static gint hf_dlmap_ie_offsub = -1;
static gint hf_dlmap_ie_boosting = -1;
static gint hf_dlmap_ie_numsym = -1;
static gint hf_dlmap_ie_numsub = -1;
static gint hf_dlmap_ie_rep = -1;
static gint hf_dlmap_ie_offsym2 = -1;
static gint hf_dlmap_ie_offsub2 = -1;
static gint hf_dlmap_ie_boosting2 = -1;
static gint hf_dlmap_ie_numsym2 = -1;
static gint hf_dlmap_ie_numsub2 = -1;
static gint hf_dlmap_ie_rep2 = -1;
/* static gint hf_dlmap_xie_diuc = -1; */
/* static gint hf_dlmap_xie_len = -1; */
static gint hf_dlmapc_compr = -1;
static gint hf_dlmapc_ulmap = -1;
static gint hf_dlmapc_rsv = -1;
static gint hf_dlmapc_len = -1;
/* static gint hf_dlmapc_sync = -1; */
static gint hf_dlmapc_opid = -1;
static gint hf_dlmapc_secid = -1;
static gint hf_dlmapc_count = -1;
#if 0
static gint hf_109x_cmi = -1;
static gint hf_109x_len = -1;
static gint hf_109x_rcid = -1;
static gint hf_109x_haoi = -1;
static gint hf_109x_dl = -1;
static gint hf_109x_ul = -1;
static gint hf_109x_dlie = -1;
static gint hf_109x_symofs = -1;
static gint hf_109x_subofs = -1;
static gint hf_109x_rsv = -1;
#endif
static gint hf_308a_cmi = -1;
static gint hf_308a_ulmap = -1;
static gint hf_308a_type = -1;
static gint hf_308a_mult = -1;
static gint hf_308a_rsv = -1;
static gint hf_mac_header_compress_dlmap_crc = -1;
static gint hf_mac_header_compress_dlmap_crc_status = -1;
static gint hf_crc16 = -1;
static gint hf_crc16_status = -1;
static gint hf_padding = -1;
static gint hf_cid_mask = -1;
static gint hf_reserved = -1;
/* Generated via "one time" script to help create filterable fields */
static int hf_dlmap_rcid_ie_cid = -1;
static int hf_dlmap_rcid_ie_prefix = -1;
static int hf_dlmap_rcid_ie_cid11 = -1;
static int hf_dlmap_rcid_ie_cid7 = -1;
static int hf_dlmap_rcid_ie_cid3 = -1;
static int hf_dlmap_dedicated_dl_control_length = -1;
static int hf_dlmap_dedicated_dl_control_control_header = -1;
static int hf_dlmap_dedicated_dl_control_num_sdma_layers = -1;
static int hf_dlmap_dedicated_mimo_dl_control_length = -1;
static int hf_dlmap_dedicated_mimo_dl_control_control_header_mimo_control_info = -1;
static int hf_dlmap_dedicated_mimo_dl_control_control_header_cqi_control_info = -1;
static int hf_dlmap_dedicated_mimo_dl_control_control_header_closed_mimo_control_info = -1;
static int hf_dlmap_dedicated_mimo_dl_control_n_layer = -1;
static int hf_dlmap_dedicated_mimo_dl_control_matrix = -1;
static int hf_dlmap_dedicated_mimo_dl_control_num_beamformed_streams = -1;
static int hf_dlmap_dedicated_mimo_dl_control_period = -1;
static int hf_dlmap_dedicated_mimo_dl_control_frame_offset = -1;
static int hf_dlmap_dedicated_mimo_dl_control_duration = -1;
static int hf_dlmap_dedicated_mimo_dl_control_allocation_index = -1;
static int hf_dlmap_dedicated_mimo_dl_control_cqich_num = -1;
static int hf_dlmap_dedicated_mimo_dl_control_feedback_type = -1;
static int hf_dlmap_dedicated_mimo_dl_control_antenna_grouping_index = -1;
static int hf_dlmap_dedicated_mimo_dl_control_num_stream = -1;
static int hf_dlmap_dedicated_mimo_dl_control_antenna_selection_index = -1;
static int hf_dlmap_dedicated_mimo_dl_control_codebook_precoding_index = -1;
static int hf_dlmap_n_sub_burst_isi = -1;
static int hf_dlmap_harq_chase_n_ack_channel = -1;
static int hf_dlmap_harq_chase_duration = -1;
static int hf_dlmap_harq_chase_sub_burst_diuc_indicator = -1;
static int hf_dlmap_reserved_uint = -1;
static int hf_dlmap_harq_chase_diuc = -1;
static int hf_dlmap_harq_chase_repetition_coding_indication = -1;
static int hf_dlmap_harq_chase_acid = -1;
static int hf_dlmap_harq_chase_ai_sn = -1;
static int hf_dlmap_harq_chase_ack_disable = -1;
static int hf_dlmap_harq_chase_dedicated_dl_control_indicator = -1;
static int hf_dlmap_harq_chase_allocation_index = -1;
static int hf_dlmap_harq_chase_period = -1;
static int hf_dlmap_harq_chase_frame_offset = -1;
static int hf_dlmap_harq_ir_ctc_n_ack_channel = -1;
static int hf_dlmap_harq_ir_ctc_nep = -1;
static int hf_dlmap_harq_ir_ctc_nsch = -1;
static int hf_dlmap_harq_ir_ctc_spid = -1;
static int hf_dlmap_harq_ir_ctc_acid = -1;
static int hf_dlmap_harq_ir_ctc_ai_sn = -1;
static int hf_dlmap_harq_ir_ctc_ack_disable = -1;
static int hf_dlmap_harq_ir_ctc_dedicated_dl_control_indicator = -1;
static int hf_dlmap_harq_ir_ctc_duration = -1;
static int hf_dlmap_harq_ir_ctc_allocation_index = -1;
static int hf_dlmap_harq_ir_ctc_period = -1;
static int hf_dlmap_harq_ir_ctc_frame_offset = -1;
static int hf_dlmap_harq_ir_cc_n_ack_channel = -1;
static int hf_dlmap_harq_ir_cc_duration = -1;
static int hf_dlmap_harq_ir_cc_sub_burst_diuc_indicator = -1;
static int hf_dlmap_harq_ir_cc_diuc = -1;
static int hf_dlmap_harq_ir_cc_repetition_coding_indication = -1;
static int hf_dlmap_harq_ir_cc_acid = -1;
static int hf_dlmap_harq_ir_cc_ai_sn = -1;
static int hf_dlmap_harq_ir_cc_spid = -1;
static int hf_dlmap_harq_ir_cc_ack_disable = -1;
static int hf_dlmap_harq_ir_cc_dedicated_dl_control_indicator = -1;
static int hf_dlmap_harq_ir_cc_allocation_index = -1;
static int hf_dlmap_harq_ir_cc_period = -1;
static int hf_dlmap_harq_ir_cc_frame_offset = -1;
static int hf_dlmap_mimo_dl_chase_harq_n_ack_channel = -1;
static int hf_dlmap_mimo_dl_chase_harq_mu_indicator = -1;
static int hf_dlmap_mimo_dl_chase_harq_dedicated_mimo_dl_control_indicator = -1;
static int hf_dlmap_mimo_dl_chase_harq_ack_disable = -1;
static int hf_dlmap_mimo_dl_chase_harq_duration = -1;
static int hf_dlmap_mimo_dl_chase_harq_diuc = -1;
static int hf_dlmap_mimo_dl_chase_harq_repetition_coding_indication = -1;
static int hf_dlmap_mimo_dl_chase_harq_acid = -1;
static int hf_dlmap_mimo_dl_chase_harq_ai_sn = -1;
static int hf_dlmap_mimo_dl_ir_harq_n_ack_channel = -1;
static int hf_dlmap_mimo_dl_ir_harq_mu_indicator = -1;
static int hf_dlmap_mimo_dl_ir_harq_dedicated_mimo_dl_control_indicator = -1;
static int hf_dlmap_mimo_dl_ir_harq_ack_disable = -1;
static int hf_dlmap_mimo_dl_ir_harq_nsch = -1;
static int hf_dlmap_mimo_dl_ir_harq_nep = -1;
static int hf_dlmap_mimo_dl_ir_harq_spid = -1;
static int hf_dlmap_mimo_dl_ir_harq_acid = -1;
static int hf_dlmap_mimo_dl_ir_harq_ai_sn = -1;
static int hf_dlmap_mimo_dl_ir_harq_cc_n_ack_channel = -1;
static int hf_dlmap_mimo_dl_ir_harq_cc_mu_indicator = -1;
static int hf_dlmap_mimo_dl_ir_harq_cc_dedicated_mimo_dl_control_indicator = -1;
static int hf_dlmap_mimo_dl_ir_harq_cc_ack_disable = -1;
static int hf_dlmap_mimo_dl_ir_harq_cc_duration = -1;
static int hf_dlmap_mimo_dl_ir_harq_cc_diuc = -1;
static int hf_dlmap_mimo_dl_ir_harq_cc_repetition_coding_indication = -1;
static int hf_dlmap_mimo_dl_ir_harq_cc_acid = -1;
static int hf_dlmap_mimo_dl_ir_harq_cc_ai_sn = -1;
static int hf_dlmap_mimo_dl_ir_harq_cc_spid = -1;
static int hf_dlmap_mimo_dl_stc_harq_n_ack_channel = -1;
static int hf_dlmap_mimo_dl_stc_harq_tx_count = -1;
static int hf_dlmap_mimo_dl_stc_harq_duration = -1;
static int hf_dlmap_mimo_dl_stc_harq_sub_burst_offset_indication = -1;
static int hf_dlmap_mimo_dl_stc_harq_sub_burst_offset = -1;
static int hf_dlmap_mimo_dl_stc_harq_ack_disable = -1;
static int hf_dlmap_mimo_dl_stc_harq_dedicated_mimo_dl_control_indicator = -1;
static int hf_dlmap_mimo_dl_stc_harq_diuc = -1;
static int hf_dlmap_mimo_dl_stc_harq_repetition_coding_indication = -1;
static int hf_dlmap_mimo_dl_stc_harq_acid = -1;
static int hf_dlmap_mbs_map_extended_2_diuc = -1;
static int hf_dlmap_mbs_map_mbs_zone_identifier = -1;
static int hf_dlmap_mbs_map_macro_diversity_enhanced = -1;
static int hf_dlmap_mbs_map_permutation = -1;
static int hf_dlmap_mbs_map_dl_permbase = -1;
static int hf_dlmap_mbs_map_prbs_id = -1;
static int hf_dlmap_mbs_map_ofdma_symbol_offset = -1;
static int hf_dlmap_mbs_map_diuc_change_indication = -1;
static int hf_dlmap_mbs_map_boosting = -1;
static int hf_dlmap_mbs_map_diuc = -1;
static int hf_dlmap_mbs_map_num_subchannels = -1;
static int hf_dlmap_mbs_map_num_ofdma_symbols = -1;
static int hf_dlmap_mbs_map_repetition_coding_indication = -1;
static int hf_dlmap_mbs_map_cid = -1;
static int hf_dlmap_mbs_map_ofdma_symbols_offset = -1;
static int hf_dlmap_mbs_map_subchannel_offset = -1;
static int hf_dlmap_mbs_map_slc_3_indication = -1;
static int hf_dlmap_mbs_map_next_mbs_map_ie_frame_offset = -1;
static int hf_dlmap_skip_extended_2_diuc = -1;
static int hf_dlmap_skip_mode = -1;
static int hf_dlmap_harq_dl_map_extended_2_diuc = -1;
static int hf_dlmap_harq_dl_map_rcid_type = -1;
static int hf_dlmap_harq_dl_map_boosting = -1;
static int hf_dlmap_harq_dl_map_region_id_use_indicator = -1;
static int hf_dlmap_harq_dl_map_ofdma_symbol_offset = -1;
static int hf_dlmap_harq_dl_map_subchannel_offset = -1;
static int hf_dlmap_harq_dl_map_number_of_ofdma_symbols = -1;
static int hf_dlmap_harq_dl_map_number_of_subchannels = -1;
static int hf_dlmap_harq_dl_map_rectangular_sub_burst_indicator = -1;
static int hf_dlmap_harq_dl_map_region_id = -1;
static int hf_dlmap_harq_dl_map_mode = -1;
static int hf_dlmap_harq_dl_map_sub_burst_ie_length = -1;
static int hf_dlmap_harq_dl_map_reserved_mode = -1;
static int hf_dlmap_harq_ack_bitmap_data = -1;
static int hf_dlmap_enhanced_dl_map_extended_2_diuc = -1;
static int hf_dlmap_enhanced_dl_map_num_assignment = -1;
static int hf_dlmap_enhanced_dl_map_n_cid = -1;
static int hf_dlmap_enhanced_dl_map_cid = -1;
static int hf_dlmap_enhanced_dl_map_diuc = -1;
static int hf_dlmap_enhanced_dl_map_boosting = -1;
static int hf_dlmap_enhanced_dl_map_repetition_coding_indication = -1;
static int hf_dlmap_enhanced_dl_map_region_id = -1;
static int hf_dlmap_aas_sdma_dl_extended_2_diuc = -1;
static int hf_dlmap_aas_sdma_dl_rcid_type = -1;
static int hf_dlmap_aas_sdma_dl_num_burst_region = -1;
static int hf_dlmap_aas_sdma_dl_ofdma_symbol_offset = -1;
static int hf_dlmap_aas_sdma_dl_subchannel_offset = -1;
static int hf_dlmap_aas_sdma_dl_num_ofdma_triple_symbols = -1;
static int hf_dlmap_aas_sdma_dl_num_subchannels = -1;
static int hf_dlmap_aas_sdma_dl_number_of_users = -1;
static int hf_dlmap_aas_sdma_dl_encoding_mode = -1;
static int hf_dlmap_aas_sdma_dl_cqich_allocation = -1;
static int hf_dlmap_aas_sdma_dl_ackch_allocation = -1;
static int hf_dlmap_aas_sdma_dl_pilot_pattern_modifier = -1;
static int hf_dlmap_aas_sdma_dl_preamble_modifier_index = -1;
static int hf_dlmap_aas_sdma_dl_pilot_pattern = -1;
static int hf_dlmap_aas_sdma_dl_diuc = -1;
static int hf_dlmap_aas_sdma_dl_repetition_coding_indication = -1;
static int hf_dlmap_aas_sdma_dl_ack_ch_index = -1;
static int hf_dlmap_aas_sdma_dl_acid = -1;
static int hf_dlmap_aas_sdma_dl_ai_sn = -1;
static int hf_dlmap_aas_sdma_dl_nep = -1;
static int hf_dlmap_aas_sdma_dl_nsch = -1;
static int hf_dlmap_aas_sdma_dl_spid = -1;
static int hf_dlmap_aas_sdma_dl_allocation_index = -1;
static int hf_dlmap_aas_sdma_dl_period = -1;
static int hf_dlmap_aas_sdma_dl_frame_offset = -1;
static int hf_dlmap_aas_sdma_dl_duration = -1;
static int hf_dlmap_channel_measurement_channel_nr = -1;
static int hf_dlmap_channel_measurement_ofdma_symbol_offset = -1;
static int hf_dlmap_channel_measurement_cid = -1;
static int hf_dlmap_stc_zone_ofdma_symbol_offset = -1;
static int hf_dlmap_stc_zone_permutations = -1;
static int hf_dlmap_stc_zone_use_all_sc_indicator = -1;
static int hf_dlmap_stc_zone_stc = -1;
static int hf_dlmap_stc_zone_matrix_indicator = -1;
static int hf_dlmap_stc_zone_dl_permbase = -1;
static int hf_dlmap_stc_zone_prbs_id = -1;
static int hf_dlmap_stc_zone_amc_type = -1;
static int hf_dlmap_stc_zone_midamble_presence = -1;
static int hf_dlmap_stc_zone_midamble_boosting = -1;
static int hf_dlmap_stc_zone_2_3_antenna_select = -1;
static int hf_dlmap_stc_zone_dedicated_pilots = -1;
static int hf_dlmap_aas_dl_ofdma_symbol_offset = -1;
static int hf_dlmap_aas_dl_permutation = -1;
static int hf_dlmap_aas_dl_dl_permbase = -1;
static int hf_dlmap_aas_dl_downlink_preamble_config = -1;
static int hf_dlmap_aas_dl_preamble_type = -1;
static int hf_dlmap_aas_dl_prbs_id = -1;
static int hf_dlmap_aas_dl_diversity_map = -1;
static int hf_dlmap_data_location_another_bs_segment = -1;
static int hf_dlmap_data_location_another_bs_used_subchannels = -1;
static int hf_dlmap_data_location_another_bs_diuc = -1;
static int hf_dlmap_data_location_another_bs_frame_advance = -1;
static int hf_dlmap_data_location_another_bs_ofdma_symbol_offset = -1;
static int hf_dlmap_data_location_another_bs_subchannel_offset = -1;
static int hf_dlmap_data_location_another_bs_boosting = -1;
static int hf_dlmap_data_location_another_bs_preamble_index = -1;
static int hf_dlmap_data_location_another_bs_num_ofdma_symbols = -1;
static int hf_dlmap_data_location_another_bs_num_subchannels = -1;
static int hf_dlmap_data_location_another_bs_repetition_coding_indication = -1;
static int hf_dlmap_data_location_another_bs_cid = -1;
static int hf_dlmap_harq_map_pointer_diuc = -1;
static int hf_dlmap_harq_map_pointer_num_slots = -1;
static int hf_dlmap_harq_map_pointer_repetition_coding_indication = -1;
static int hf_dlmap_harq_map_pointer_map_version = -1;
static int hf_dlmap_harq_map_pointer_idle_users = -1;
static int hf_dlmap_harq_map_pointer_sleep_users = -1;
static int hf_dlmap_harq_map_pointer_cid_mask_length = -1;
static int hf_dlmap_phymod_dl_preamble_modifier_type = -1;
static int hf_dlmap_phymod_dl_preamble_frequency_shift_index = -1;
static int hf_dlmap_phymod_dl_preamble_time_shift_index = -1;
static int hf_dlmap_phymod_dl_pilot_pattern_modifier = -1;
static int hf_dlmap_phymod_dl_pilot_pattern_index = -1;
static int hf_dlmap_broadcast_ctrl_ptr_dcd_ucd_transmission_frame = -1;
static int hf_dlmap_broadcast_ctrl_ptr_skip_broadcast_system_update = -1;
static int hf_dlmap_broadcast_ctrl_ptr_broadcast_system_update_type = -1;
static int hf_dlmap_broadcast_ctrl_ptr_broadcast_system_update_transmission_frame = -1;
static int hf_dlmap_dl_pusc_burst_allocation_cid = -1;
static int hf_dlmap_dl_pusc_burst_allocation_diuc = -1;
static int hf_dlmap_dl_pusc_burst_allocation_segment = -1;
static int hf_dlmap_dl_pusc_burst_allocation_boosting = -1;
static int hf_dlmap_dl_pusc_burst_allocation_idcell = -1;
static int hf_dlmap_dl_pusc_burst_allocation_dl_permbase = -1;
static int hf_dlmap_dl_pusc_burst_allocation_prbs_id = -1;
static int hf_dlmap_dl_pusc_burst_allocation_repetition_coding_indication = -1;
static int hf_dlmap_dl_pusc_burst_allocation_used_subchannels = -1;
static int hf_dlmap_dl_pusc_burst_allocation_ofdma_symbol_offset = -1;
static int hf_dlmap_dl_pusc_burst_allocation_num_ofdma_symbols = -1;
static int hf_dlmap_dl_pusc_burst_allocation_subchannel_offset = -1;
static int hf_dlmap_dl_pusc_burst_allocation_num_subchannels = -1;
static int hf_dlmap_pusc_asca_alloc_diuc = -1;
static int hf_dlmap_pusc_asca_alloc_short_basic_cid = -1;
static int hf_dlmap_pusc_asca_alloc_ofdma_symbol_offset = -1;
static int hf_dlmap_pusc_asca_alloc_subchannel_offset = -1;
static int hf_dlmap_pusc_asca_alloc_num_ofdma_symbols = -1;
static int hf_dlmap_pusc_asca_alloc_num_symbols = -1;
static int hf_dlmap_pusc_asca_alloc_repetition_coding_information = -1;
static int hf_dlmap_pusc_asca_alloc_permutation_id = -1;
static int hf_dlmap_reduced_aas_num_ie = -1;
static int hf_dlmap_reduced_aas_periodicity = -1;
static int hf_dlmap_reduced_aas_cid_included = -1;
static int hf_dlmap_reduced_aas_dcd_count_included = -1;
static int hf_dlmap_reduced_aas_phy_modification_included = -1;
static int hf_dlmap_reduced_aas_cqich_control_indicator = -1;
static int hf_dlmap_reduced_aas_encoding_mode = -1;
static int hf_dlmap_reduced_aas_separate_mcs_enabled = -1;
static int hf_dlmap_reduced_aas_duration = -1;
static int hf_dlmap_reduced_aas_diuc = -1;
static int hf_dlmap_reduced_aas_repetition_coding_indication = -1;
static int hf_dlmap_reduced_aas_cid = -1;
static int hf_dlmap_reduced_aas_allocation_index = -1;
static int hf_dlmap_reduced_aas_report_period = -1;
static int hf_dlmap_reduced_aas_frame_offset = -1;
static int hf_dlmap_reduced_aas_report_duration = -1;
static int hf_dlmap_reduced_aas_cqi_measurement_type = -1;
static int hf_dlmap_reduced_aas_dcd_count = -1;
static int hf_dlmap_reduced_aas_preamble_select = -1;
static int hf_dlmap_reduced_aas_preamble_shift_index = -1;
static int hf_dlmap_reduced_aas_pilot_pattern_modifier = -1;
static int hf_dlmap_reduced_aas_pilot_pattern_index = -1;
static int hf_dlmap_reduced_aas_dl_frame_offset = -1;
static int hf_dlmap_reduced_aas_zone_symbol_offset = -1;
static int hf_dlmap_reduced_aas_ofdma_symbol_offset = -1;
static int hf_dlmap_reduced_aas_subchannel_offset = -1;
static int hf_dlmap_reduced_aas_num_ofdma_triple_symbol = -1;
static int hf_dlmap_reduced_aas_num_subchannels = -1;
static int hf_dlmap_reduced_aas_num_ofdma_symbols = -1;
static int hf_dlmap_reduced_aas_diuc_nep = -1;
static int hf_dlmap_reduced_aas_dl_harq_ack_bitmap = -1;
static int hf_dlmap_reduced_aas_ack_allocation_index = -1;
static int hf_dlmap_reduced_aas_acid = -1;
static int hf_dlmap_reduced_aas_ai_sn = -1;
static int hf_dlmap_reduced_aas_nsch = -1;
static int hf_dlmap_reduced_aas_spid = -1;
static expert_field ei_dlmap_not_implemented = EI_INIT;
static expert_field ei_crc16 = EI_INIT;
static expert_field ei_mac_header_compress_dlmap_crc = EI_INIT;
static expert_field ei_mac_header_invalid_length = EI_INIT;
/* Copied and renamed from proto.c because global value_strings don't work for plugins */
static const value_string plugin_proto_checksum_vals[] = {
{ PROTO_CHECKSUM_E_BAD, "Bad" },
{ PROTO_CHECKSUM_E_GOOD, "Good" },
{ PROTO_CHECKSUM_E_UNVERIFIED, "Unverified" },
{ PROTO_CHECKSUM_E_NOT_PRESENT, "Not present" },
{ 0, NULL }
};
/********************************************************************
* DL-MAP Miscellaneous IEs and TLVs
*******************************************************************/
gint RCID_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb, gint RCID_Type_lcl)
{
/* RCID_IE 8.4.5.3 and 8.4.5.3.20.1 */
/* offset of IE in bits, length is variable */
gint bit = offset;
proto_item *ti = NULL;
proto_tree *tree = NULL;
gint Prefix = 0;
gint cid = 0;
if (RCID_Type_lcl == 0)
length = 16;
else {
Prefix = TVB_BIT_BIT(bit, tvb);
if (Prefix == 1) length = 12;
else if (RCID_Type_lcl == 1) length = 12;
else if (RCID_Type_lcl == 2) length = 8;
else if (RCID_Type_lcl == 3) length = 4;
}
tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, length), ett_286j, &ti, "RCID_IE");
if (RCID_Type_lcl == 0) {
XBIT_HF_VALUE(cid, 16, hf_dlmap_rcid_ie_cid);
} else {
XBIT_HF_VALUE(Prefix, 1, hf_dlmap_rcid_ie_prefix);
if (Prefix == 1) {
/* RCID 11 */
XBIT_HF_VALUE(cid, 11, hf_dlmap_rcid_ie_cid11);
} else {
if (RCID_Type_lcl == 1) {
/* RCID 11 */
XBIT_HF_VALUE(cid, 11, hf_dlmap_rcid_ie_cid11);
} else if (RCID_Type_lcl == 2) {
/* RCID 7 */
XBIT_HF_VALUE(cid, 7, hf_dlmap_rcid_ie_cid7);
} else if (RCID_Type_lcl == 3) {
/* RCID 3 */
XBIT_HF_VALUE(cid, 3, hf_dlmap_rcid_ie_cid3);
}
}
}
proto_item_append_text(ti, " (CID = %d)", cid);
return length; /* return length in bits */
}
/********************************************************************
* DL-MAP Extended-2 HARQ sub-burst IEs (8.4.5.3.21)
*******************************************************************/
static gint Dedicated_DL_Control_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.3.20 */
/* offset of IE in nibbles, length is variable */
gint nib;
gint nibble;
proto_tree *tree;
gint len;
nib = offset;
length = TVB_NIB_NIBBLE(nib, tvb); /* length in nibbles */
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(nib, length+1), ett_286i, NULL, "Dedicated_DL_Control_IE");
VNIB(length, 1, hf_dlmap_dedicated_dl_control_length);
VNIB(nibble, 1, hf_dlmap_dedicated_dl_control_control_header);
if ((nibble & 1) == 1) {
nibble = TVB_NIB_NIBBLE(nib, tvb);
proto_tree_add_uint(tree, hf_dlmap_dedicated_dl_control_num_sdma_layers, tvb, NIBHI(nib,1), (nibble >> 2) & 0x3);
/* Bit padding */
if ((nib*4)+2 < (offset+length)*4) {
len = ((offset + length - nib) * 4) - 2;
proto_tree_add_bytes_format(tree, hf_reserved, tvb, BITHI(nib*4, len), NULL, "Reserved bits");
}
} else {
/* Nibble padding */
if (nib < offset+length) {
len = (offset + length) - nib;
proto_tree_add_bytes_format(tree, hf_reserved, tvb, NIBHI(nib,len), NULL, "Reserved bits");
}
}
return (length + 1);
}
static gint Dedicated_MIMO_DL_Control_IE(proto_tree *diuc_tree, gint offset, gint length _U_, tvbuff_t *tvb)
{
/* offset of IE in bits, length is variable */
gint bit;
proto_tree *tree;
gint mci, cqi, cmi, matrix = 0, pad, CQICH_num, mimo_mode;
gint j;
bit = offset;
/* 8.4.5.3.21 table 286t */
tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 1), ett_286t, NULL, "Dedicated MIMO DL Control IE");
XBIT_HF_VALUE(length, 5, hf_dlmap_dedicated_mimo_dl_control_length);
XBIT_HF_VALUE(mci, 1, hf_dlmap_dedicated_mimo_dl_control_control_header_mimo_control_info);
XBIT_HF_VALUE(cqi, 1, hf_dlmap_dedicated_mimo_dl_control_control_header_cqi_control_info);
XBIT_HF_VALUE(cmi, 1, hf_dlmap_dedicated_mimo_dl_control_control_header_closed_mimo_control_info);
XBIT_HF_VALUE(N_layer, 2, hf_dlmap_dedicated_mimo_dl_control_n_layer);
/* MIMO Control Info */
if (mci == 1) {
XBIT_HF_VALUE(matrix, 2, hf_dlmap_dedicated_mimo_dl_control_matrix);
if (STC_Zone_Dedicated_Pilots == 1) {
XBIT_HF(2, hf_dlmap_dedicated_mimo_dl_control_num_beamformed_streams);
}
}
/* CQICH Control Info */
if (cqi == 1) {
XBIT_HF(3, hf_dlmap_dedicated_mimo_dl_control_period);
XBIT_HF(3, hf_dlmap_dedicated_mimo_dl_control_frame_offset);
XBIT_HF(4, hf_dlmap_dedicated_mimo_dl_control_duration);
for (j = 0; j < N_layer; j++) {
XBIT_HF(6, hf_dlmap_dedicated_mimo_dl_control_allocation_index);
}
XBIT_HF_VALUE(CQICH_num, 2, hf_dlmap_dedicated_mimo_dl_control_cqich_num);
for (j = 0; j < CQICH_num; j++) {
XBIT_HF(3, hf_dlmap_dedicated_mimo_dl_control_feedback_type);
XBIT_HF(6, hf_dlmap_dedicated_mimo_dl_control_allocation_index);
}
}
/* Closed MIMO Control Info */
if (cmi == 1) {
if (mci == 1) {
mimo_mode = matrix;
} else {
mimo_mode = STC_Zone_Matrix;
}
if (mimo_mode == 0 || mimo_mode == 1) {
XBIT_HF(3, hf_dlmap_dedicated_mimo_dl_control_antenna_grouping_index);
} else if (mimo_mode == 2) {
XBIT_HF(2, hf_dlmap_dedicated_mimo_dl_control_num_stream);
XBIT_HF(3, hf_dlmap_dedicated_mimo_dl_control_antenna_selection_index);
} else if (mimo_mode == 3) {
XBIT_HF(2, hf_dlmap_dedicated_mimo_dl_control_num_stream);
XBIT_HF(6, hf_dlmap_dedicated_mimo_dl_control_codebook_precoding_index);
}
}
/* padding to nibble */
pad = BIT_PADDING(bit,4);
if(pad){
proto_tree_add_bytes_format_value(tree, hf_padding, tvb, BITHI(bit,pad), NULL, "%d bits", pad);
bit += pad;
}
return (bit - offset);
}
static gint DL_HARQ_Chase_sub_burst_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.3.21 DL_HARQ_Chase_sub_burst_IE */
/* offset of IE in nibbles, length is variable */
gint bit;
proto_tree *tree;
gint nsub, ddci, dur, sbi;
gint j;
bit = NIB_TO_BIT(offset);
/* 8.4.5.3.21 table 286m */
tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, length), ett_286m, NULL, "DL_HARQ_Chase_sub_burst_IE");
XBIT_HF_VALUE(nsub, 4, hf_dlmap_n_sub_burst_isi);
XBIT_HF(4, hf_dlmap_harq_chase_n_ack_channel);
nsub += 1;
for (j = 0; j < nsub; j++) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
XBIT_HF_VALUE(dur, 10, hf_dlmap_harq_chase_duration);
XBIT_HF_VALUE(sbi, 1, hf_dlmap_harq_chase_sub_burst_diuc_indicator);
XBIT_HF(1, hf_dlmap_reserved_uint);
if (sbi == 1) {
XBIT_HF(4, hf_dlmap_harq_chase_diuc);
XBIT_HF(2, hf_dlmap_harq_chase_repetition_coding_indication);
XBIT_HF(2, hf_dlmap_reserved_uint);
}
XBIT_HF(4, hf_dlmap_harq_chase_acid);
XBIT_HF(1, hf_dlmap_harq_chase_ai_sn);
XBIT_HF(1, hf_dlmap_harq_chase_ack_disable);
XBIT_HF_VALUE(ddci, 2, hf_dlmap_harq_chase_dedicated_dl_control_indicator);
if ((ddci & 1) == 1) {
XBIT_HF_VALUE(dur, 4, hf_dlmap_harq_chase_duration);
if (dur != 0) {
XBIT_HF(6, hf_dlmap_harq_chase_allocation_index);
XBIT_HF(3, hf_dlmap_harq_chase_period);
XBIT_HF(3, hf_dlmap_harq_chase_frame_offset);
}
}
if ((ddci & 2) == 2) {
bit += Dedicated_DL_Control_IE(tree, BIT_TO_NIB(bit), length, tvb) * 4;
}
}
/* XBIT_HF(data, 4, "(DL HARQ Chase sub-burst IE)"); */
return (BIT_TO_NIB(bit) - offset);
}
static gint DL_HARQ_IR_CTC_sub_burst_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* offset of IE in nibbles, length is variable */
gint bit;
proto_tree *tree;
gint nsub, ddci, dur;
gint j;
guint32 calculated_crc;
bit = NIB_TO_BIT(offset);
/* 8.4.5.3.21 table 286n */
tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 4), ett_286n, NULL, "DL HARQ IR CTC sub-burst IE");
XBIT_HF_VALUE(nsub, 4, hf_dlmap_n_sub_burst_isi);
XBIT_HF(4, hf_dlmap_harq_ir_ctc_n_ack_channel);
nsub += 1;
for (j = 0; j < nsub; j++) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
XBIT_HF(4, hf_dlmap_harq_ir_ctc_nep);
XBIT_HF(4, hf_dlmap_harq_ir_ctc_nsch);
XBIT_HF(2, hf_dlmap_harq_ir_ctc_spid);
XBIT_HF(4, hf_dlmap_harq_ir_ctc_acid);
XBIT_HF(1, hf_dlmap_harq_ir_ctc_ai_sn);
XBIT_HF(1, hf_dlmap_harq_ir_ctc_ack_disable);
XBIT_HF(2, hf_dlmap_reserved_uint);
XBIT_HF_VALUE(ddci, 2, hf_dlmap_harq_ir_ctc_dedicated_dl_control_indicator);
if ((ddci & 1) == 1) {
XBIT_HF_VALUE(dur, 4, hf_dlmap_harq_ir_ctc_duration);
if (dur != 0) {
XBIT_HF(6, hf_dlmap_harq_ir_ctc_allocation_index);
XBIT_HF(3, hf_dlmap_harq_ir_ctc_period);
XBIT_HF(3, hf_dlmap_harq_ir_ctc_frame_offset);
}
}
if ((ddci & 2) == 2) {
bit += Dedicated_DL_Control_IE(tree, BIT_TO_NIB(bit), length, tvb);
}
}
if (include_cor2_changes)
{
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BIT_ADDR(bit), hf_crc16, hf_crc16_status, &ei_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
return (BIT_TO_NIB(bit) - offset);
}
static gint DL_HARQ_IR_CC_sub_burst_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* offset of IE in nibbles, length is variable */
gint bit;
proto_tree *tree;
gint nsub, sbdi, ddci, dur;
gint j;
guint16 calculated_crc;
bit = NIB_TO_BIT(offset);
/* 8.4.5.3.21 table 286o */
tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 4), ett_286o, NULL, "DL HARQ IR CC sub-burst IE");
XBIT_HF_VALUE(nsub, 4, hf_dlmap_n_sub_burst_isi);
XBIT_HF(4, hf_dlmap_harq_ir_cc_n_ack_channel);
nsub += 1;
for (j = 0; j < nsub; j++) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type) / 4;
XBIT_HF(10, hf_dlmap_harq_ir_cc_duration);
XBIT_HF_VALUE(sbdi, 1, hf_dlmap_harq_ir_cc_sub_burst_diuc_indicator);
XBIT_HF(1, hf_dlmap_reserved_uint);
if (sbdi) {
XBIT_HF(4, hf_dlmap_harq_ir_cc_diuc);
XBIT_HF(2, hf_dlmap_harq_ir_cc_repetition_coding_indication);
XBIT_HF(2, hf_dlmap_reserved_uint);
}
XBIT_HF(4, hf_dlmap_harq_ir_cc_acid);
XBIT_HF(1, hf_dlmap_harq_ir_cc_ai_sn);
XBIT_HF(2, hf_dlmap_harq_ir_cc_spid);
XBIT_HF(1, hf_dlmap_harq_ir_cc_ack_disable);
XBIT_HF_VALUE(ddci, 2, hf_dlmap_harq_ir_cc_dedicated_dl_control_indicator);
XBIT_HF(2, hf_dlmap_reserved_uint);
if (ddci & 1) {
XBIT_HF_VALUE(dur, 4, hf_dlmap_harq_ir_cc_duration);
if (dur != 0) {
XBIT_HF(6, hf_dlmap_harq_ir_cc_allocation_index);
XBIT_HF(3, hf_dlmap_harq_ir_cc_period);
XBIT_HF(3, hf_dlmap_harq_ir_cc_frame_offset);
}
}
if ((ddci & 2) == 2) {
bit += Dedicated_DL_Control_IE(tree, BIT_TO_NIB(bit), length, tvb);
}
}
if (include_cor2_changes)
{
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BIT_ADDR(bit), hf_crc16, hf_crc16_status, &ei_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
return (BIT_TO_NIB(bit) - offset);
}
static gint MIMO_DL_Chase_HARQ_sub_burst_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* offset of IE in nibbles, length is variable */
gint bit;
gint data;
proto_tree *tree;
gint nsub, mui, dci, akd;
gint i, j;
guint16 calculated_crc;
bit = NIB_TO_BIT(offset);
/* 8.4.5.3.21 table 286p */
tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 1), ett_286p, NULL, "MIMO DL Chase HARQ sub-burst IE");
XBIT_HF_VALUE(nsub, 4, hf_dlmap_n_sub_burst_isi);
XBIT_HF(6, hf_dlmap_mimo_dl_chase_harq_n_ack_channel);
nsub += 1;
for (j = 0; j < nsub; j++) {
XBIT_HF_VALUE(mui, 1, hf_dlmap_mimo_dl_chase_harq_mu_indicator);
XBIT_HF_VALUE(dci, 1, hf_dlmap_mimo_dl_chase_harq_dedicated_mimo_dl_control_indicator);
XBIT_HF_VALUE(akd, 1, hf_dlmap_mimo_dl_chase_harq_ack_disable);
if (mui == 0) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
}
if (dci == 1) {
bit += Dedicated_MIMO_DL_Control_IE(tree, bit, length, tvb);
}
XBIT_HF(10, hf_dlmap_mimo_dl_chase_harq_duration);
for (i = 0; i < N_layer; i++) {
if (mui == 1) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
}
XBIT_HF(4, hf_dlmap_mimo_dl_chase_harq_diuc);
XBIT_HF(2, hf_dlmap_mimo_dl_chase_harq_repetition_coding_indication);
if (akd == 0) {
XBIT_HF(4, hf_dlmap_mimo_dl_chase_harq_acid);
XBIT_HF(1, hf_dlmap_mimo_dl_chase_harq_ai_sn);
}
}
}
/* Padding to nibble */
data = BIT_PADDING(bit, 4);
if (data) {
proto_tree_add_bytes_format_value(tree, hf_padding, tvb, BITHI(bit,data), NULL, "%d bits", data);
bit += data;
}
if (include_cor2_changes)
{
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BIT_ADDR(bit), hf_crc16, hf_crc16_status, &ei_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
return (BIT_TO_NIB(bit) - offset);
}
static gint MIMO_DL_IR_HARQ_sub_burst_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* offset of IE in nibbles, length is variable */
gint bit;
proto_tree *tree;
gint nsub, mui, dci, akd;
gint i, j;
guint16 calculated_crc;
bit = NIB_TO_BIT(offset);
/* 8.4.5.3.21 table 286q */
tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 4), ett_286q, NULL, "MIMO DL IR HARQ sub-burst IE");
XBIT_HF_VALUE(nsub, 4, hf_dlmap_n_sub_burst_isi);
XBIT_HF(6, hf_dlmap_mimo_dl_ir_harq_n_ack_channel);
nsub += 1;
for (j = 0; j < nsub; j++) {
XBIT_HF_VALUE(mui, 1, hf_dlmap_mimo_dl_ir_harq_mu_indicator);
XBIT_HF_VALUE(dci, 1, hf_dlmap_mimo_dl_ir_harq_dedicated_mimo_dl_control_indicator);
XBIT_HF_VALUE(akd, 1, hf_dlmap_mimo_dl_ir_harq_ack_disable);
if (mui == 0) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
}
if (dci == 1) {
bit += Dedicated_MIMO_DL_Control_IE(tree, bit, length, tvb);
}
XBIT_HF(4, hf_dlmap_mimo_dl_ir_harq_nsch);
for (i = 0; i < N_layer; i++) {
if (mui == 1) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
}
XBIT_HF(4, hf_dlmap_mimo_dl_ir_harq_nep);
if (akd) {
XBIT_HF(2, hf_dlmap_mimo_dl_ir_harq_spid);
XBIT_HF(4, hf_dlmap_mimo_dl_ir_harq_acid);
XBIT_HF(1, hf_dlmap_mimo_dl_ir_harq_ai_sn);
}
}
}
if (include_cor2_changes)
{
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BIT_ADDR(bit), hf_crc16, hf_crc16_status, &ei_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
return (BIT_TO_NIB(bit) - offset);
}
static gint MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* offset of IE in nibbles, length is variable */
gint bit;
proto_tree *tree;
gint nsub, mui, dci, akd;
gint i, j;
guint16 calculated_crc;
bit = NIB_TO_BIT(offset);
/* 8.4.5.3.21 table 286r */
tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 1), ett_286r, NULL, "MIMO DL IR HARQ for CC sub-burst IE");
XBIT_HF_VALUE(nsub, 4, hf_dlmap_n_sub_burst_isi);
XBIT_HF(6, hf_dlmap_mimo_dl_ir_harq_cc_n_ack_channel);
nsub += 1;
for (j = 0; j < nsub; j++) {
XBIT_HF_VALUE(mui, 1, hf_dlmap_mimo_dl_ir_harq_cc_mu_indicator);
XBIT_HF_VALUE(dci, 1, hf_dlmap_mimo_dl_ir_harq_cc_dedicated_mimo_dl_control_indicator);
XBIT_HF_VALUE(akd, 1, hf_dlmap_mimo_dl_ir_harq_cc_ack_disable);
if (mui == 0) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
}
if (dci == 1) {
bit += Dedicated_MIMO_DL_Control_IE(tree, bit, length, tvb);
}
XBIT_HF(10, hf_dlmap_mimo_dl_ir_harq_cc_duration);
for (i = 0; i < N_layer; i++) {
if (mui == 1) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
}
XBIT_HF(4, hf_dlmap_mimo_dl_ir_harq_cc_diuc);
XBIT_HF(2, hf_dlmap_mimo_dl_ir_harq_cc_repetition_coding_indication);
if (akd == 0) {
XBIT_HF(4, hf_dlmap_mimo_dl_ir_harq_cc_acid);
XBIT_HF(1, hf_dlmap_mimo_dl_ir_harq_cc_ai_sn);
XBIT_HF(2, hf_dlmap_mimo_dl_ir_harq_cc_spid);
}
}
}
if (include_cor2_changes)
{
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BIT_ADDR(bit), hf_crc16, hf_crc16_status, &ei_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
return (BIT_TO_NIB(bit) - offset);
}
static gint MIMO_DL_STC_HARQ_sub_burst_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* offset of IE in nibbles, length is variable */
gint bit;
proto_tree *tree;
gint nsub, sbi, txc, akd, dmci;
gint j;
guint16 calculated_crc;
bit = NIB_TO_BIT(offset);
/* 8.4.5.3.21 table 286s */
tree = proto_tree_add_subtree(diuc_tree, tvb, BITHI(bit, 1), ett_286s, NULL, "MIMO DL STC HARQ sub-burst IE");
XBIT_HF_VALUE(nsub, 4, hf_dlmap_n_sub_burst_isi);
XBIT_HF(6, hf_dlmap_mimo_dl_stc_harq_n_ack_channel);
nsub += 1;
for (j = 0; j < nsub; j++) {
XBIT_HF_VALUE(txc, 2, hf_dlmap_mimo_dl_stc_harq_tx_count);
XBIT_HF(10, hf_dlmap_mimo_dl_stc_harq_duration);
XBIT_HF_VALUE(sbi, 1, hf_dlmap_mimo_dl_stc_harq_sub_burst_offset_indication);
XBIT_HF(3, hf_dlmap_reserved_uint);
if (sbi == 1) {
XBIT_HF(8, hf_dlmap_mimo_dl_stc_harq_sub_burst_offset);
}
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
XBIT_HF_VALUE(akd, 1, hf_dlmap_mimo_dl_stc_harq_ack_disable);
if (txc == 0) {
XBIT_HF_VALUE(dmci, 1, hf_dlmap_mimo_dl_stc_harq_dedicated_mimo_dl_control_indicator);
if (dmci == 1) {
bit += Dedicated_MIMO_DL_Control_IE(tree, bit, length, tvb);
}
XBIT_HF(4, hf_dlmap_mimo_dl_stc_harq_diuc);
XBIT_HF(2, hf_dlmap_mimo_dl_stc_harq_repetition_coding_indication);
}
if (akd == 0) {
XBIT_HF(4, hf_dlmap_mimo_dl_stc_harq_acid);
}
}
if (include_cor2_changes)
{
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BIT_ADDR(bit), hf_crc16, hf_crc16_status, &ei_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
return (BIT_TO_NIB(bit) - offset);
}
/********************************************************************
* DL-MAP Extended-2 IEs
*******************************************************************/
static gint MBS_MAP_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended-2 IE = 0 */
/* 8.4.5.3.12 MBS_MAP_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_tree *tree;
gint mde, dci, s3i;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286a, NULL, "MBS_MAP_IE");
XBIT_HF(4, hf_dlmap_mbs_map_extended_2_diuc);
VBIT(data, 8, hf_dlmap_ie_length);
XBIT_HF(7, hf_dlmap_mbs_map_mbs_zone_identifier);
XBIT_HF_VALUE(mde, 1, hf_dlmap_mbs_map_macro_diversity_enhanced);
if (mde == 1)
{
XBIT_HF(2, hf_dlmap_mbs_map_permutation);
XBIT_HF(5, hf_dlmap_mbs_map_dl_permbase);
XBIT_HF(2, hf_dlmap_mbs_map_prbs_id);
XBIT_HF(7, hf_dlmap_mbs_map_ofdma_symbol_offset);
XBIT_HF_VALUE(dci, 1, hf_dlmap_mbs_map_diuc_change_indication);
XBIT_HF(3, hf_dlmap_reserved_uint);
if (dci == 1) {
XBIT_HF(3, hf_dlmap_reserved_uint);
XBIT_HF(3, hf_dlmap_mbs_map_boosting);
XBIT_HF(4, hf_dlmap_mbs_map_diuc);
XBIT_HF(6, hf_dlmap_mbs_map_num_subchannels);
XBIT_HF(6, hf_dlmap_mbs_map_num_ofdma_symbols);
XBIT_HF(2, hf_dlmap_mbs_map_repetition_coding_indication);
}
} else {
XBIT_HF(4, hf_dlmap_mbs_map_diuc);
XBIT_HF(16, hf_dlmap_mbs_map_cid);
XBIT_HF(8, hf_dlmap_mbs_map_ofdma_symbols_offset);
XBIT_HF(6, hf_dlmap_mbs_map_subchannel_offset);
XBIT_HF(3, hf_dlmap_mbs_map_boosting);
XBIT_HF_VALUE(s3i, 1, hf_dlmap_mbs_map_slc_3_indication);
XBIT_HF(6, hf_dlmap_mbs_map_num_ofdma_symbols);
XBIT_HF(6, hf_dlmap_mbs_map_num_subchannels);
XBIT_HF(2, hf_dlmap_mbs_map_repetition_coding_indication);
if (s3i == 1) {
XBIT_HF(8, hf_dlmap_mbs_map_next_mbs_map_ie_frame_offset);
}
}
data = BIT_PADDING(bit, 4);
if (data) {
proto_tree_add_bytes_format_value(tree, hf_padding, tvb, BITHI(bit,data), NULL, "%d bits", data);
bit += data;
}
return BIT_TO_NIB(bit);
}
static gint HO_Anchor_Active_DL_MAP_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended-2 IE = 1 */
/* 8.4.5.3.14 [2] HO_Anchor_Active_DL-MAP_IE TODO 1.1 */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_tree *tree;
nib = offset;
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286c, NULL, "HO_Anchor_Active_DL_MAP_IE");
VNIB(data, 1, hf_dlmap_ie_diuc_ext2);
VNIB(data, 2, hf_dlmap_ie_length);
proto_tree_add_expert(diuc_tree, pinfo, &ei_dlmap_not_implemented, tvb, NIBHI(nib, length-3));
return nib;
}
static gint HO_Active_Anchor_DL_MAP_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended-2 IE = 2 */
/* 8.4.5.3.15 HO_Active_Anchor_DL_MAP_IE TODO 1.1 */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_tree *tree;
nib = offset;
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286d, NULL, "HO_Active_Anchor_DL_MAP_IE");
VNIB(data, 1, hf_dlmap_ie_diuc_ext2);
VNIB(data, 2, hf_dlmap_ie_length);
proto_tree_add_expert(diuc_tree, pinfo, &ei_dlmap_not_implemented, tvb, NIBHI(nib, length-3));
return nib;
}
static gint HO_CID_Translation_MAP_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended-2 IE = 3 */
/* 8.4.5.3.16 HO_CID_Translation_MAP_IE TODO 1.1 */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_tree *tree;
nib = offset;
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286e, NULL, "CID_Translation_MAP_IE");
VNIB(data, 1, hf_dlmap_ie_diuc_ext2);
VNIB(data, 2, hf_dlmap_ie_length);
proto_tree_add_expert(diuc_tree, pinfo, &ei_dlmap_not_implemented, tvb, NIBHI(nib, length-3));
return nib;
}
static gint MIMO_in_another_BS_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended-2 IE = 4 */
/* 8.4.5.3.17 [2] MIMO_in_another_BS_IE (not implemented)*/
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_tree *tree;
nib = offset;
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286f, NULL, "MIMO_in_another_BS_IE");
VNIB(data, 1, hf_dlmap_ie_diuc_ext2);
VNIB(data, 2, hf_dlmap_ie_length);
proto_tree_add_expert(diuc_tree, pinfo, &ei_dlmap_not_implemented, tvb, NIBHI(nib, length-3));
return nib;
}
static gint Macro_MIMO_DL_Basic_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* dl-map extended-2 ie = 5 */
/* 8.4.5.3.18 [2] Macro-MIMO_DL_Basic_IE (not implemented) */
/* offset of tlv in nibbles, length of tlv in nibbles */
gint nib;
gint data;
proto_tree *tree;
nib = offset;
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286g, NULL, "Macro_MIMO_DL_Basic_IE");
VNIB(data, 1, hf_dlmap_ie_diuc_ext2);
VNIB(data, 2, hf_dlmap_ie_length);
proto_tree_add_expert(diuc_tree, pinfo, &ei_dlmap_not_implemented, tvb, NIBHI(nib, length-3));
return nib;
}
static gint Skip_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended-2 IE = 6 */
/* 8.4.5.3.20.2 Skip_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_tree *tree;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286k, NULL, "Skip_IE");
XBIT_HF(4, hf_dlmap_skip_extended_2_diuc);
VBIT(data, 8, hf_dlmap_ie_length);
XBIT_HF(1, hf_dlmap_skip_mode);
XBIT_HF(7, hf_dlmap_reserved_uint);
return BIT_TO_NIB(bit);
}
static gint HARQ_DL_MAP_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended-2 IE = 7 */
/* 8.4.5.3.21 [2] HARQ_DL_MAP_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_tree *tree;
gint len, lastbit, rui, mode, sub_len, pad;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286l, NULL, "HARQ_DL_MAP_IE");
XBIT_HF(4, hf_dlmap_harq_dl_map_extended_2_diuc);
VBIT(len, 2, hf_dlmap_ie_length);
XBIT_HF_VALUE(RCID_Type, 2, hf_dlmap_harq_dl_map_rcid_type);
XBIT_HF(2, hf_dlmap_reserved_uint);
/* while data remains */
length = NIB_TO_BIT(length);
/* Subtract extra nibble to be sure to stop in time. */
lastbit = bit + BYTE_TO_BIT(len) - 14 - 4;
while (bit < lastbit) {
XBIT_HF(3, hf_dlmap_harq_dl_map_boosting);
XBIT_HF_VALUE(rui, 1, hf_dlmap_harq_dl_map_region_id_use_indicator);
if (rui == 0) {
XBIT_HF(8, hf_dlmap_harq_dl_map_ofdma_symbol_offset);
XBIT_HF(7, hf_dlmap_harq_dl_map_subchannel_offset);
XBIT_HF(7, hf_dlmap_harq_dl_map_number_of_ofdma_symbols);
XBIT_HF(7, hf_dlmap_harq_dl_map_number_of_subchannels);
if (include_cor2_changes)
{
XBIT_HF(1, hf_dlmap_harq_dl_map_rectangular_sub_burst_indicator); /* Implemented: "Rectangular Sub-Burst Indicator" field added */
XBIT_HF(2, hf_dlmap_reserved_uint); /* and "Reserved" field resized from 3 bits to 2 bits */
}
else
{
XBIT_HF(3, hf_dlmap_reserved_uint);
}
} else {
XBIT_HF(8, hf_dlmap_harq_dl_map_region_id);
}
XBIT_HF_VALUE(mode, 4, hf_dlmap_harq_dl_map_mode);
XBIT_HF_VALUE(sub_len, 8, hf_dlmap_harq_dl_map_sub_burst_ie_length);
/* 8.4.5.3.21 */
/* length of these are variable, each returns length in nibbles */
if (mode == 0) {
DL_HARQ_Chase_sub_burst_IE(tree, BIT_TO_NIB(bit), length, tvb);
} else if (mode == 1) {
DL_HARQ_IR_CTC_sub_burst_IE(tree, pinfo, BIT_TO_NIB(bit), length, tvb);
} else if (mode == 2) {
DL_HARQ_IR_CC_sub_burst_IE(tree, pinfo, BIT_TO_NIB(bit), length, tvb);
} else if (mode == 3) {
MIMO_DL_Chase_HARQ_sub_burst_IE(tree, pinfo, BIT_TO_NIB(bit), length, tvb);
} else if (mode == 4) {
MIMO_DL_IR_HARQ_sub_burst_IE(tree, pinfo, BIT_TO_NIB(bit), length, tvb);
} else if (mode == 5) {
MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(tree, pinfo, BIT_TO_NIB(bit), length, tvb);
} else if (mode == 6) {
MIMO_DL_STC_HARQ_sub_burst_IE(tree, pinfo, BIT_TO_NIB(bit), length, tvb);
} else {
proto_tree_add_bits_item(tree, hf_dlmap_harq_dl_map_reserved_mode, tvb, bit, 1, ENC_BIG_ENDIAN);
break; /* cannot continue */
}
bit += NIB_TO_BIT(sub_len);
}
pad = NIB_TO_BIT(offset) + length - bit;
if (pad) {
proto_tree_add_bytes_format_value(tree, hf_padding, tvb, BITHI(bit,pad), NULL, "%d bits",pad);
bit += pad;
}
return BIT_TO_NIB(bit);
}
static gint HARQ_ACK_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended-2 IE = 8 */
/* 8.4.5.3.22 HARQ_ACK IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint data;
gint nib;
proto_tree *tree;
nib = offset;
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286u, NULL, "HARQ_ACK_IE");
VNIB(data, 1, hf_dlmap_ie_diuc_ext2);
VNIB(data, 2, hf_dlmap_ie_length);
proto_tree_add_item(diuc_tree, hf_dlmap_harq_ack_bitmap_data, tvb, NIBHI(nib,length-3), ENC_NA);
return nib;
}
static gint Enhanced_DL_MAP_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended-2 IE = 9 */
/* 8.4.5.3.23 Enhanced DL MAP IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_tree *tree;
gint numass, n_cid;
gint i, n;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286v, NULL, "Enhanced_DL-MAP_IE");
XBIT_HF(4, hf_dlmap_enhanced_dl_map_extended_2_diuc);
VBIT(data, 8, hf_dlmap_ie_length);
XBIT_HF_VALUE(numass, 4, hf_dlmap_enhanced_dl_map_num_assignment);
for (i = 0; i < numass; i++) {
if (INC_CID == 1) {
XBIT_HF_VALUE(n_cid, 8, hf_dlmap_enhanced_dl_map_n_cid);
for (n = 0; n < n_cid; n++) {
XBIT_HF(16, hf_dlmap_enhanced_dl_map_cid);
}
}
XBIT_HF(4, hf_dlmap_enhanced_dl_map_diuc);
XBIT_HF(3, hf_dlmap_enhanced_dl_map_boosting);
XBIT_HF(2, hf_dlmap_enhanced_dl_map_repetition_coding_indication);
XBIT_HF(8, hf_dlmap_enhanced_dl_map_region_id);
XBIT_HF(3, hf_dlmap_reserved_uint);
}
return BIT_TO_NIB(bit);
}
static gint Closed_loop_MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended-2 IE = 0xA */
/* 8.4.5.3.24 Closed-loop MIMO DL Enhanced IE (not implemented) */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_tree *tree;
nib = offset;
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286w, NULL, "CL_MIMO_DL_Enhanced_IE");
VNIB(data, 1, hf_dlmap_ie_diuc_ext2);
VNIB(data, 2, hf_dlmap_ie_length);
proto_tree_add_expert(diuc_tree, pinfo, &ei_dlmap_not_implemented, tvb, NIBHI(nib, length-3));
return nib;
}
static gint AAS_SDMA_DL_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended-2 IE = 0xE */
/* 8.4.5.3.26 AAS_SDMA_DL_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_tree *tree;
gint num_region, num_users, pilot_pattern, encoding_mode, ackch_alloc, cqich_alloc;
gint aas_preamble = 1;
gint zone_permut = 0; /* TODO */
gint i, j;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286y, NULL, "AAS_SDMA_DL_IE");
XBIT_HF(4, hf_dlmap_aas_sdma_dl_extended_2_diuc);
VBIT(data, 8, hf_dlmap_ie_length);
XBIT_HF_VALUE(RCID_Type, 2, hf_dlmap_aas_sdma_dl_rcid_type);
XBIT_HF_VALUE(num_region, 4, hf_dlmap_aas_sdma_dl_num_burst_region);
XBIT_HF(2, hf_dlmap_reserved_uint);
for (i = 0; i < num_region; i++) {
XBIT_HF(8, hf_dlmap_aas_sdma_dl_ofdma_symbol_offset);
if (zone_permut == 0) {
XBIT_HF(8, hf_dlmap_aas_sdma_dl_subchannel_offset);
XBIT_HF(5, hf_dlmap_aas_sdma_dl_num_ofdma_triple_symbols);
XBIT_HF(6, hf_dlmap_aas_sdma_dl_num_subchannels);
} else {
XBIT_HF(6, hf_dlmap_aas_sdma_dl_subchannel_offset);
XBIT_HF(7, hf_dlmap_aas_sdma_dl_num_ofdma_triple_symbols);
XBIT_HF(6, hf_dlmap_aas_sdma_dl_num_subchannels);
}
XBIT_HF_VALUE(num_users, 3, hf_dlmap_aas_sdma_dl_number_of_users);
XBIT_HF(2, hf_dlmap_reserved_uint);
for (j = 0; j < num_users; j++) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
XBIT_HF_VALUE(encoding_mode, 2, hf_dlmap_aas_sdma_dl_encoding_mode);
XBIT_HF_VALUE(cqich_alloc, 1, hf_dlmap_aas_sdma_dl_cqich_allocation);
XBIT_HF_VALUE(ackch_alloc, 1, hf_dlmap_aas_sdma_dl_ackch_allocation);
XBIT_HF_VALUE(pilot_pattern, 1, hf_dlmap_aas_sdma_dl_pilot_pattern_modifier);
if (aas_preamble) {
XBIT_HF(4, hf_dlmap_aas_sdma_dl_preamble_modifier_index);
}
if (pilot_pattern) {
XBIT_HF(2, hf_dlmap_aas_sdma_dl_pilot_pattern);
XBIT_HF(1, hf_dlmap_reserved_uint);
} else {
XBIT_HF(3, hf_dlmap_reserved_uint);
}
if (encoding_mode == 0x0) {
XBIT_HF(4, hf_dlmap_aas_sdma_dl_diuc);
XBIT_HF(2, hf_dlmap_aas_sdma_dl_repetition_coding_indication);
XBIT_HF(2, hf_dlmap_reserved_uint);
}
if (encoding_mode == 0x1) {
if (ackch_alloc) {
XBIT_HF(5, hf_dlmap_aas_sdma_dl_ack_ch_index);
} else {
XBIT_HF(1, hf_dlmap_reserved_uint);
}
XBIT_HF(4, hf_dlmap_aas_sdma_dl_diuc);
XBIT_HF(2, hf_dlmap_aas_sdma_dl_repetition_coding_indication);
XBIT_HF(4, hf_dlmap_aas_sdma_dl_acid);
XBIT_HF(1, hf_dlmap_aas_sdma_dl_ai_sn);
}
if (encoding_mode == 0x2) {
if (ackch_alloc) {
XBIT_HF(5, hf_dlmap_aas_sdma_dl_ack_ch_index);
} else {
XBIT_HF(1, hf_dlmap_reserved_uint);
}
XBIT_HF(4, hf_dlmap_aas_sdma_dl_nep);
XBIT_HF(4, hf_dlmap_aas_sdma_dl_nsch);
XBIT_HF(2, hf_dlmap_aas_sdma_dl_spid);
XBIT_HF(4, hf_dlmap_aas_sdma_dl_acid);
XBIT_HF(1, hf_dlmap_aas_sdma_dl_ai_sn);
}
if (encoding_mode == 0x3) {
if (ackch_alloc) {
XBIT_HF(5, hf_dlmap_aas_sdma_dl_ack_ch_index);
XBIT_HF(2, hf_dlmap_reserved_uint);
} else {
XBIT_HF(3, hf_dlmap_reserved_uint);
}
XBIT_HF(4, hf_dlmap_aas_sdma_dl_diuc);
XBIT_HF(2, hf_dlmap_aas_sdma_dl_repetition_coding_indication);
XBIT_HF(2, hf_dlmap_aas_sdma_dl_spid);
XBIT_HF(4, hf_dlmap_aas_sdma_dl_acid);
XBIT_HF(1, hf_dlmap_aas_sdma_dl_ai_sn);
}
if (cqich_alloc) {
XBIT_HF(6, hf_dlmap_aas_sdma_dl_allocation_index);
XBIT_HF(3, hf_dlmap_aas_sdma_dl_period);
XBIT_HF(3, hf_dlmap_aas_sdma_dl_frame_offset);
XBIT_HF(4, hf_dlmap_aas_sdma_dl_duration);
}
}
}
data = BIT_PADDING(bit,4);
/* Should this be an optional field? Or do we want it, even if it has a length of zero? */
proto_tree_add_bytes_format_value(tree, hf_padding, tvb, BITHI(bit,data), NULL, "%d bits", data);
bit += data;
return BIT_TO_NIB(bit);
}
/********************************************************************
* DL-MAP Extended IEs
*******************************************************************/
static gint Channel_Measurement_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 0 */
/* 8.4.5.3.5 [1] Channel_Measurement_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_tree *tree;
nib = offset;
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_280, NULL, "Channel_Measurement_IE");
VNIB(data, 1, hf_dlmap_ie_diuc_ext);
VNIB(data, 1, hf_dlmap_ie_length);
VNIB(data, 2, hf_dlmap_channel_measurement_channel_nr);
VNIB(data, 2, hf_dlmap_channel_measurement_ofdma_symbol_offset);
VNIB(data, 4, hf_dlmap_channel_measurement_cid);
return nib;
}
static gint STC_Zone_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 1 */
/* 8.4.5.3.4 STC_Zone_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
/* set globals: STC_Zone_Dedicated_Pilots, STC_Zone_Matrix
* used in 8.4.5.3.21.1 Dedicated MIMO Control IE 286t */
gint bit;
gint data;
proto_tree *tree;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_279, NULL, "STC_Zone_IE");
VBIT(data, 4, hf_dlmap_ie_diuc_ext);
VBIT(data, 4, hf_dlmap_ie_length);
XBIT_HF(8, hf_dlmap_stc_zone_ofdma_symbol_offset);
XBIT_HF(2, hf_dlmap_stc_zone_permutations);
XBIT_HF(1, hf_dlmap_stc_zone_use_all_sc_indicator);
XBIT_HF(2, hf_dlmap_stc_zone_stc);
XBIT_HF_VALUE(STC_Zone_Matrix, 2, hf_dlmap_stc_zone_matrix_indicator);
XBIT_HF(5, hf_dlmap_stc_zone_dl_permbase);
XBIT_HF(2, hf_dlmap_stc_zone_prbs_id);
XBIT_HF(2, hf_dlmap_stc_zone_amc_type);
XBIT_HF(1, hf_dlmap_stc_zone_midamble_presence);
XBIT_HF(1, hf_dlmap_stc_zone_midamble_boosting);
XBIT_HF(1, hf_dlmap_stc_zone_2_3_antenna_select);
XBIT_HF_VALUE(STC_Zone_Dedicated_Pilots, 1, hf_dlmap_stc_zone_dedicated_pilots);
XBIT_HF(4, hf_dlmap_reserved_uint);
return BIT_TO_NIB(bit);
}
static gint AAS_DL_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 2 */
/* 8.4.5.3.3 AAS_DL_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_tree *tree;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_278, NULL, "AAS_DL_IE");
VBIT(data, 4, hf_dlmap_ie_diuc_ext);
VBIT(data, 4, hf_dlmap_ie_length);
XBIT_HF(8, hf_dlmap_aas_dl_ofdma_symbol_offset);
XBIT_HF(3, hf_dlmap_aas_dl_permutation);
XBIT_HF(6, hf_dlmap_aas_dl_dl_permbase);
XBIT_HF(2, hf_dlmap_aas_dl_downlink_preamble_config);
XBIT_HF(1, hf_dlmap_aas_dl_preamble_type);
XBIT_HF(2, hf_dlmap_aas_dl_prbs_id);
XBIT_HF(1, hf_dlmap_aas_dl_diversity_map);
XBIT_HF(1, hf_dlmap_reserved_uint);
return BIT_TO_NIB(bit);
}
static gint Data_location_in_another_BS_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 3 */
/* 8.4.5.3.6 Data_location_in_another_BS_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_tree *tree;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_281, NULL, "Data location in another BS IE");
VBIT(data, 4, hf_dlmap_ie_diuc_ext);
VBIT(data, 4, hf_dlmap_ie_length);
XBIT_HF(2, hf_dlmap_data_location_another_bs_segment);
XBIT_HF(6, hf_dlmap_data_location_another_bs_used_subchannels);
XBIT_HF(4, hf_dlmap_data_location_another_bs_diuc);
XBIT_HF(3, hf_dlmap_data_location_another_bs_frame_advance);
XBIT_HF(1, hf_dlmap_reserved_uint);
XBIT_HF(8, hf_dlmap_data_location_another_bs_ofdma_symbol_offset);
XBIT_HF(6, hf_dlmap_data_location_another_bs_subchannel_offset);
XBIT_HF(3, hf_dlmap_data_location_another_bs_boosting);
XBIT_HF(7, hf_dlmap_data_location_another_bs_preamble_index);
XBIT_HF(8, hf_dlmap_data_location_another_bs_num_ofdma_symbols);
XBIT_HF(6, hf_dlmap_data_location_another_bs_num_subchannels);
XBIT_HF(2, hf_dlmap_data_location_another_bs_repetition_coding_indication);
XBIT_HF(16, hf_dlmap_data_location_another_bs_cid);
return BIT_TO_NIB(bit);
}
static gint CID_Switch_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 4 */
/* 8.4.5.3.7 [1] CID_Switch_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_tree *tree;
nib = offset;
INC_CID = INC_CID ? 0 : 1;
tree = proto_tree_add_subtree_format(diuc_tree, tvb, NIBHI(offset, length), ett_282, NULL, "CID_Switch_IE (INC_CID = %d)", INC_CID);
VNIB(data, 1, hf_dlmap_ie_diuc_ext);
VNIB(data, 1, hf_dlmap_ie_length);
return nib;
}
static gint MIMO_DL_Basic_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 5 */
/* 8.4.5.3.8 MIMO_DL_Basic_IE (not implemented) */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_tree *tree;
nib = offset;
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_283, NULL, "MIMO_DL_Basic_IE");
VNIB(data, 1, hf_dlmap_ie_diuc_ext2);
VNIB(data, 2, hf_dlmap_ie_length);
proto_tree_add_expert(diuc_tree, pinfo, &ei_dlmap_not_implemented, tvb, NIBHI(nib, length-2));
return nib;
}
static gint MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 6 */
/* 8.4.5.3.9 MIMO_DL_Enhanced_IE (not implemented) */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_tree *tree;
nib = offset;
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_284, NULL, "MIMO_DL_Enhanced_IE");
VNIB(data, 1, hf_dlmap_ie_diuc_ext2);
VNIB(data, 2, hf_dlmap_ie_length);
proto_tree_add_expert(diuc_tree, pinfo, &ei_dlmap_not_implemented, tvb, NIBHI(nib, length-2));
return nib;
}
static gint HARQ_Map_Pointer_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 7 */
/* 8.4.5.3.10 [2] HARQ_Map_Pointer_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_tree *tree;
gint length_in_bits, map, mask_len;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_285, NULL, "HARQ_Map_Pointer_IE");
VBIT(data, 4, hf_dlmap_ie_diuc_ext);
VBIT(data, 4, hf_dlmap_ie_length);
length_in_bits = NIB_TO_BIT(length-1);
while (bit < length_in_bits) {
XBIT_HF(4, hf_dlmap_harq_map_pointer_diuc);
XBIT_HF(8, hf_dlmap_harq_map_pointer_num_slots);
XBIT_HF(2, hf_dlmap_harq_map_pointer_repetition_coding_indication);
XBIT_HF_VALUE(map, 2, hf_dlmap_harq_map_pointer_map_version);
if (map == 2) {
XBIT_HF(1, hf_dlmap_harq_map_pointer_idle_users);
XBIT_HF(1, hf_dlmap_harq_map_pointer_sleep_users);
XBIT_HF_VALUE(mask_len, 2, hf_dlmap_harq_map_pointer_cid_mask_length);
if (mask_len == 0) {
/* 12 bits */
proto_tree_add_bytes_format_value(diuc_tree, hf_cid_mask, tvb, BITHI(bit,12), NULL, "12 bits");
bit += 12;
} else if (mask_len == 1) {
/* 20 bits */
proto_tree_add_bytes_format_value(diuc_tree, hf_cid_mask, tvb, BITHI(bit,20), NULL, "20 bits");
bit += 20;
} else if (mask_len == 2) {
/* 36 bits */
proto_tree_add_bytes_format_value(diuc_tree, hf_cid_mask, tvb, BITHI(bit,36), NULL, "36 bits");
bit += 36;
} else if (mask_len == 3) {
/* 52 bits */
proto_tree_add_bytes_format_value(diuc_tree, hf_cid_mask, tvb, BITHI(bit,52), NULL, "52 bits");
bit += 52;
}
}
}
return BIT_TO_NIB(bit);
}
static gint PHYMOD_DL_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 8 */
/* 8.4.5.3.11 PHYMOD_DL_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_tree *tree;
gint pmt;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286, NULL, "PHYMOD_DL_IE");
VBIT(data, 4, hf_dlmap_ie_diuc_ext);
VBIT(data, 4, hf_dlmap_ie_length);
XBIT_HF_VALUE(pmt, 1, hf_dlmap_phymod_dl_preamble_modifier_type);
if (pmt == 0) {
XBIT_HF(4, hf_dlmap_phymod_dl_preamble_frequency_shift_index);
} else {
XBIT_HF(4, hf_dlmap_phymod_dl_preamble_time_shift_index);
}
XBIT_HF(1, hf_dlmap_phymod_dl_pilot_pattern_modifier);
XBIT_HF(2, hf_dlmap_phymod_dl_pilot_pattern_index);
return BIT_TO_NIB(bit);
}
static gint Broadcast_Control_Pointer_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 0xA */
/* 8.4.5.3.25 Broadcast Control Pointer IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_tree *tree;
gint skip;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286x, NULL, "Broadcast Control Pointer IE");
VBIT(data, 4, hf_dlmap_ie_diuc_ext);
VBIT(data, 4, hf_dlmap_ie_length);
XBIT_HF(7, hf_dlmap_broadcast_ctrl_ptr_dcd_ucd_transmission_frame);
XBIT_HF_VALUE(skip, 1, hf_dlmap_broadcast_ctrl_ptr_skip_broadcast_system_update);
if (skip == 0) {
XBIT_HF(1, hf_dlmap_broadcast_ctrl_ptr_broadcast_system_update_type);
XBIT_HF(7, hf_dlmap_broadcast_ctrl_ptr_broadcast_system_update_transmission_frame);
}
return BIT_TO_NIB(bit);
}
static gint DL_PUSC_Burst_Allocation_in_Other_Segment_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 0xB */
/* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_tree *tree;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286b, NULL, "DL_PUSC_Burst_Allocation_in_Other_Segment_IE");
VBIT(data, 4, hf_dlmap_ie_diuc_ext);
VBIT(data, 4, hf_dlmap_ie_length);
XBIT_HF(16, hf_dlmap_dl_pusc_burst_allocation_cid);
XBIT_HF(4, hf_dlmap_dl_pusc_burst_allocation_diuc);
XBIT_HF(2, hf_dlmap_dl_pusc_burst_allocation_segment);
XBIT_HF(3, hf_dlmap_dl_pusc_burst_allocation_boosting);
XBIT_HF(5, hf_dlmap_dl_pusc_burst_allocation_idcell);
XBIT_HF(5, hf_dlmap_dl_pusc_burst_allocation_dl_permbase);
XBIT_HF(2, hf_dlmap_dl_pusc_burst_allocation_prbs_id);
XBIT_HF(2, hf_dlmap_dl_pusc_burst_allocation_repetition_coding_indication);
XBIT_HF(6, hf_dlmap_dl_pusc_burst_allocation_used_subchannels);
XBIT_HF(8, hf_dlmap_dl_pusc_burst_allocation_ofdma_symbol_offset);
XBIT_HF(1, hf_dlmap_reserved_uint);
XBIT_HF(7, hf_dlmap_dl_pusc_burst_allocation_num_ofdma_symbols);
XBIT_HF(6, hf_dlmap_dl_pusc_burst_allocation_subchannel_offset);
XBIT_HF(6, hf_dlmap_dl_pusc_burst_allocation_num_subchannels);
XBIT_HF(7, hf_dlmap_reserved_uint);
return BIT_TO_NIB(bit);
}
static gint PUSC_ASCA_Alloc_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 0xC */
/* 8.4.5.3.27 PUSC_ASCA_Alloc_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_tree *tree;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286z, NULL, "PUSC_ASCA_Alloc_IE");
VBIT(data, 4, hf_dlmap_ie_diuc_ext);
VBIT(data, 4, hf_dlmap_ie_length);
XBIT_HF(4, hf_dlmap_pusc_asca_alloc_diuc);
XBIT_HF(12, hf_dlmap_pusc_asca_alloc_short_basic_cid);
XBIT_HF(8, hf_dlmap_pusc_asca_alloc_ofdma_symbol_offset);
XBIT_HF(6, hf_dlmap_pusc_asca_alloc_subchannel_offset);
XBIT_HF(7, hf_dlmap_pusc_asca_alloc_num_ofdma_symbols);
XBIT_HF(6, hf_dlmap_pusc_asca_alloc_num_symbols);
XBIT_HF(2, hf_dlmap_pusc_asca_alloc_repetition_coding_information);
XBIT_HF(4, hf_dlmap_pusc_asca_alloc_permutation_id);
XBIT_HF(7, hf_dlmap_reserved_uint);
return BIT_TO_NIB(bit);
}
static gint UL_interference_and_noise_level_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* DL-MAP Extended IE = 0xF */
/* 8.4.5.3.19 UL_interference_and_noise_level_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
proto_tree *tree;
gint nib = offset;
gint bitmap, data;
tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286h, NULL, "UL_interference_and_noise_level_IE");
VNIB(data, 1, hf_dlmap_ie_diuc_ext);
VNIB(data, 1, hf_dlmap_ie_length);
VNIB(bitmap, 2, hf_dlmap_ie_bitmap);
if (bitmap & 0x01) {
VNIB(data, 2, hf_dlmap_ie_bitmap_cqi);
}
if (bitmap & 0x02) {
VNIB(data, 2, hf_dlmap_ie_bitmap_pusc);
}
if (bitmap & 0x04) {
VNIB(data, 2, hf_dlmap_ie_bitmap_opt_pusc);
}
if (bitmap & 0x08) {
VNIB(data, 2, hf_dlmap_ie_bitmap_amc);
}
if (bitmap & 0x10) {
VNIB(data, 2, hf_dlmap_ie_bitmap_aas);
}
if (bitmap & 0x20) {
VNIB(data, 2, hf_dlmap_ie_bitmap_periodic_ranging);
}
if (bitmap & 0x40) {
VNIB(data, 2, hf_dlmap_ie_bitmap_sounding);
}
if (bitmap & 0x80) {
VNIB(data, 2, hf_dlmap_ie_bitmap_mimo);
}
return nib;
}
/********************************************************************
* DL-MAP Plugin
*******************************************************************/
static gint dissect_dlmap_ie(proto_tree *ie_tree, packet_info *pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* decode a single DL-MAP IE and return the
* length of the IE in nibbles
* offset = start of IE (nibbles)
* length = total length of IE (nibbles) */
proto_item *ti = NULL;
proto_tree *tree = NULL;
gint nibble = offset;
gint diuc;
gint ext2_diuc;
gint len;
gint ext_diuc;
gint alt_format = 0;
guint data = 0;
gint i;
/*gint papr = 0;*/
gint ie_len = 9;
gint n_cid;
/* 8.4.5.3 DL-MAP IE format - table 275 */
diuc = TVB_NIB_NIBBLE(nibble, tvb);
if (diuc == 14)
{
/* 8.4.5.3.2.2 [2] Extended-2 DIUC dependent IE table 277b */
ext2_diuc = TVB_NIB_NIBBLE(1+nibble, tvb);
len = TVB_NIB_BYTE(1+nibble+1, tvb);
ti = proto_tree_add_uint(ie_tree, hf_dlmap_ie_diuc, tvb, NIBHI(nibble, 1+3+len*2), diuc);
proto_item_append_text(ti, " (Extended-2)");
tree = proto_item_add_subtree(ti, ett_277b);
nibble++;
len = 3 + BYTE_TO_NIB(len);
/* table 277c [2] */
switch (ext2_diuc)
{
case 0x00:
/* 8.4.5.3.12 MBS_MAP_IE */
nibble = MBS_MAP_IE(tree, nibble, len, tvb);
break;
case 0x01:
/* 8.4.5.3.14 HO_Anchor_Active_DL-MAP_IE */
nibble = HO_Anchor_Active_DL_MAP_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x02:
/* 8.4.5.3.15 HO_Active_Anchor_DL_MAP_IE */
nibble = HO_Active_Anchor_DL_MAP_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x03:
/* 8.4.5.3.16 HO_CID_Translation_MAP_IE */
nibble = HO_CID_Translation_MAP_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x04:
/* 8.4.5.3.17 MIMO_in_another_BS_IE */
nibble = MIMO_in_another_BS_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x05:
/* 8.4.5.3.18 Macro-MIMO_DL_Basic_IE */
nibble = Macro_MIMO_DL_Basic_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x06:
/* 8.4.5.3.20.2 Skip_IE */
nibble = Skip_IE(tree, nibble, len, tvb);
break;
case 0x07:
/* 8.4.5.3.21 HARQ_DL_MAP_IE */
nibble = HARQ_DL_MAP_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x08:
/* 8.4.5.3.22 HARQ_ACK IE */
nibble = HARQ_ACK_IE(tree, nibble, len, tvb);
break;
case 0x09:
/* 8.4.5.3.23 Enhanced DL MAP IE */
nibble = Enhanced_DL_MAP_IE(tree, nibble, len, tvb);
break;
case 0x0a:
/* 8.4.5.3.24 Closed-loop MIMO DL Enhanced IE */
nibble = Closed_loop_MIMO_DL_Enhanced_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x0b:
nibble = MIMO_DL_Basic_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x0c:
nibble = MIMO_DL_Enhanced_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x0e:
nibble = AAS_SDMA_DL_IE(tree, nibble, len, tvb);
break;
default:
proto_tree_add_bytes_format(tree, hf_dlmap_ie_reserved_extended2_duic, tvb, NIBHI(nibble,len), NULL, "(reserved Extended-2 DIUC: %d)", ext2_diuc);
nibble += len;
break;
}
}
else if (diuc == 15)
{
/* 8.4.5.3.2.1 [1] Extended DIUC dependent IE - table 277 */
ext_diuc = TVB_NIB_NIBBLE(1+nibble, tvb);
len = TVB_NIB_NIBBLE(1+nibble+1, tvb);
ti = proto_tree_add_uint(ie_tree, hf_dlmap_ie_diuc, tvb, NIBHI(nibble, 1+2+len*2), diuc);
proto_item_append_text(ti, " (Extended)");
tree = proto_item_add_subtree(ti, ett_277);
nibble++;
len = 2 + BYTE_TO_NIB(len);
/* TODO 8.4.5.3.27 PUSC_ASCA_IE -- unspecified ExtDIUC? */
/* 8.4.5.3.2.1 table 277a */
switch (ext_diuc)
{
case 0x00:
/* 8.4.5.3.? Channel_Measurement_IE */
nibble = Channel_Measurement_IE(tree, nibble, len, tvb);
break;
case 0x01:
/* 8.4.5.3.4 STC_Zone_IE */
nibble = STC_Zone_IE(tree, nibble, len, tvb);
break;
case 0x02:
/* 8.4.5.3.3 AAS_DL_IE */
nibble = AAS_DL_IE(tree, nibble, len, tvb);
break;
case 0x03:
/* 8.4.5.3.6 Data_location_in_another_BS_IE */
nibble = Data_location_in_another_BS_IE(tree, nibble, len, tvb);
break;
case 0x04:
/* 8.4.5.3.7 CID_Switch_IE */
nibble = CID_Switch_IE(tree, nibble, len, tvb);
break;
case 0x07:
/* 8.4.5.3.10 HARQ_Map_Pointer_IE */
nibble = HARQ_Map_Pointer_IE(tree, nibble, len, tvb);
break;
case 0x08:
/* 8.4.5.3.11 PHYMOD_DL_IE */
nibble = PHYMOD_DL_IE(tree, nibble, len, tvb);
break;
case 0x0a:
/* 8.4.5.3.25 Broadcast Control Pointer IE */
nibble = Broadcast_Control_Pointer_IE(tree, nibble, len, tvb);
break;
case 0x0b:
/* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */
nibble = DL_PUSC_Burst_Allocation_in_Other_Segment_IE(tree, nibble, len, tvb);
break;
case 0x0c:
nibble = PUSC_ASCA_Alloc_IE(tree, nibble, len, tvb);
break;
case 0x0f:
/* 8.4.5.3.19 UL_interference_and_noise_level_IE */
nibble = UL_interference_and_noise_level_IE(tree, nibble, len, tvb);
break;
default:
proto_tree_add_bytes_format(tree, hf_dlmap_ie_reserved_extended_duic, tvb, NIBHI(nibble,len), NULL, "(reserved Extended DIUC: %d)", ext_diuc);
nibble += len;
break;
}
}
else
{
/* Downlink IE */
alt_format = 0;
/*papr = 0; XX: not used ? */
ie_len = 9;
/* TODO: alt_format = 1 if (Permutation == 0x11) and (AMC type is 2x3 or 1x6) */
/* precalculate IE len for correct highlighting */
if (INC_CID && !sub_dl_ul_map) {
ie_len += 2 + (TVB_NIB_BYTE(nibble+1, tvb) * 4);
}
/* DL-MAP_IE */
ti = proto_tree_add_uint(ie_tree, hf_dlmap_ie_diuc, tvb, NIBHI(nibble, ie_len), diuc);
tree = proto_item_add_subtree(ti, ett_275_1);
nibble += 1;
if (diuc == 13) {
/* 8.4.5.3.1 [1] Gap/PAPR Reduction */
/*papr = 1; XX: not used ? */
proto_item_append_text(ti, " (Gap/PAPR Reduction)");
}
if (INC_CID)
{
n_cid = TVB_NIB_BYTE(nibble, tvb);
proto_tree_add_uint(tree, hf_dlmap_ie_ncid, tvb, NIBHI(nibble, 2), n_cid);
nibble += 2;
for (i = 0; i < n_cid; i++)
{
if (sub_dl_ul_map) {
/* RCID_IE 8.4.5.3 and 8.4.5.3.20.1, only part of SUB-DL-UL-MAP */
/* RCID_Type comes from 6.3.2.3.43.2 [2] Format_configuration_IE in Compact_DL-MAP_IE */
nibble += RCID_IE(tree, nibble*4, length, tvb, RCID_Type) / 4;
} else {
data = TVB_NIB_WORD(nibble, tvb);
proto_tree_add_uint(tree, hf_dlmap_ie_cid, tvb, NIBHI(nibble, 4), data);
nibble += 4;
}
}
}
data = TVB_NIB_LONG(nibble, tvb);
if (alt_format) {
proto_tree_add_uint(tree, hf_dlmap_ie_offsym2, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_dlmap_ie_offsub2, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_dlmap_ie_boosting2, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_dlmap_ie_numsym2, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_dlmap_ie_numsub2, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_dlmap_ie_rep2, tvb, NIBHI(nibble, 8), data);
} else {
proto_tree_add_uint(tree, hf_dlmap_ie_offsym, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_dlmap_ie_offsub, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_dlmap_ie_boosting, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_dlmap_ie_numsym, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_dlmap_ie_numsub, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_dlmap_ie_rep, tvb, NIBHI(nibble, 8), data);
}
nibble += 8;
}
/* length in nibbles */
return (nibble - offset);
}
static int dissect_mac_mgmt_msg_dlmap_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tree, void* data _U_)
{
/* 6.3.2.3.2 [2] DL-MAP table 16 */
guint offset = 0;
gint length, nib, pad;
proto_item *ti = NULL;
proto_tree *dlmap_tree = NULL;
proto_tree *ie_tree = NULL;
proto_tree *phy_tree = NULL;
gint tvb_len = tvb_reported_length(tvb);
INC_CID = 0;
/* add protocol */
ti = proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_dlmap_decoder, tvb, offset, -1, "DL-MAP");
dlmap_tree = proto_item_add_subtree(ti, ett_dlmap);
/* PHY Synchronization Field 8.4.5.1 */
{
phy_tree = proto_tree_add_subtree(dlmap_tree, tvb, offset, 4, ett_275_phy, NULL, "Phy Synchronization Field");
proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur_ms, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur_per_sec, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_item(phy_tree, hf_dlmap_phy_fnum, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 3;
}
proto_tree_add_item(dlmap_tree, hf_dlmap_dcd, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_item(dlmap_tree, hf_dlmap_bsid, tvb, offset, 6, ENC_NA);
offset += 6;
proto_tree_add_item(dlmap_tree, hf_dlmap_ofdma_sym, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* DL-MAP IEs */
length = tvb_len - offset; /* remaining length in bytes */
ie_tree = proto_tree_add_subtree_format(dlmap_tree, tvb, offset, length, ett_dlmap_ie, NULL, "DL-MAP IEs (%d bytes)", length);
/* length = BYTE_TO_NIB(length); */ /* convert length to nibbles */
nib = BYTE_TO_NIB(offset);
while (nib < ((tvb_len*2)-1)) {
nib += dissect_dlmap_ie(ie_tree, pinfo, nib, tvb_len * 2, tvb);
}
pad = NIB_PADDING(nib);
if (pad) {
proto_tree_add_bytes_format(dlmap_tree, hf_padding, tvb, NIBHI(nib,1), NULL, "Padding nibble");
nib++;
}
return tvb_captured_length(tvb);
}
gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tree)
{
/* 8.4.5.6.1 [2] Compressed DL-MAP */
/* decode a compressed dl-map and return the length in bytes; */
/* if there is a compressed ul-map, also decode that and include in the length */
guint offset = 0;
proto_item *ti = NULL;
proto_item *ti_phy = NULL;
proto_item *ti_dlmap_ies = NULL;
proto_tree *tree = NULL;
proto_tree *ie_tree = NULL;
proto_tree *phy_tree = NULL;
gint ulmap_appended;
guint length, lennib, pad;
guint mac_len, dl_ie_count;
guint tvb_len = tvb_reported_length(tvb);
guint nib = 0;
guint32 mac_crc, calculated_crc;
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compressed DL-MAP");
INC_CID = 0;
length = tvb_get_ntohs(tvb, offset) & 0x07FF; /* compressed map length is 11 bits */
mac_len = length;
lennib = BYTE_TO_NIB(length);
ulmap_appended = (tvb_get_guint8(tvb, offset) >> 4) & 1; /* UL MAP appended? */
/* display MAC Compressed DL-MAP and create subtree */
ti = proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_dlmap_decoder, tvb, offset, length, "Compressed DL-MAP (%u bytes)", length);
tree = proto_item_add_subtree(ti, ett_305);
/* decode dlmap fields */
proto_tree_add_item(tree, hf_dlmapc_compr, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_dlmapc_ulmap, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_dlmapc_rsv, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_dlmapc_len, tvb, offset, 2, ENC_BIG_ENDIAN);
/* PHY Synchronization Field 8.4.5.1 */
{
phy_tree = proto_tree_add_subtree(tree, tvb, offset+2, 4, ett_275_phy, &ti_phy, "Phy Synchronization Field");
proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur_ms, tvb, offset+2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(phy_tree, hf_dlmap_phy_fdur_per_sec, tvb, offset+2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(phy_tree, hf_dlmap_phy_fnum, tvb, offset+3, 3, ENC_BIG_ENDIAN);
}
proto_tree_add_item(tree, hf_dlmap_dcd, tvb, offset+6, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_dlmapc_opid, tvb, offset+7, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_dlmapc_secid, tvb, offset+8, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_dlmap_ofdma_sym, tvb, offset+9, 1, ENC_BIG_ENDIAN); /* 2005 */
proto_tree_add_item(tree, hf_dlmapc_count, tvb, offset+10,1, ENC_BIG_ENDIAN);
dl_ie_count = tvb_get_guint8(tvb, offset + 10);
offset += 11;
nib = BYTE_TO_NIB(offset);
/* DL-MAP IEs */
length -= 15; /* remaining length in bytes (11 bytes above + CRC at end) */
if (dl_ie_count) {
ie_tree = proto_tree_add_subtree_format(tree, tvb, offset, length, ett_dlmap_ie, &ti_dlmap_ies, "DL-MAP IEs (%d bytes)", length);
/* length = BYTE_TO_NIB(mac_len - (int)sizeof(mac_crc) - 1); */ /* convert length to nibbles */
while (dl_ie_count--) {
nib += dissect_dlmap_ie(ie_tree, pinfo, nib, tvb_len * 2, tvb);
}
pad = NIB_PADDING(nib);
if (pad) {
proto_tree_add_bytes_format(tree, hf_padding, tvb, NIBHI(nib,1), NULL, "Padding nibble");
nib++;
}
}
if (ulmap_appended) {
/* Replace the text of items to set the correct length in bytes.*/
proto_item_set_text(ti, "Compressed DL-MAP (%u bytes)", NIB_ADDR(nib));
proto_item_set_text(ti_dlmap_ies, "DL-MAP IEs (%u bytes)",NIB_ADDR(nib)- offset);
/* set the length of items */
proto_item_set_end(ti_dlmap_ies, tvb, NIB_ADDR(nib));
proto_item_set_end(ti, tvb, NIB_ADDR(nib));
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compressed UL-MAP");
/* subtract 8 from lennib (CRC) */
wimax_decode_ulmapc(base_tree, pinfo, nib, lennib - 8, tvb);
}
/* CRC is always appended */
/* check the length */
if (mac_len <= sizeof(mac_crc))
{
expert_add_info_format(pinfo, ti, &ei_mac_header_invalid_length,
"Invalid length: %d.", mac_len);
return sizeof(mac_crc);
}
else if (MIN(tvb_len, tvb_reported_length(tvb)) >= mac_len)
{
/* calculate the CRC */
calculated_crc = wimax_mac_calc_crc32(tvb_get_ptr(tvb, 0, mac_len - (int)sizeof(mac_crc)), mac_len - (int)sizeof(mac_crc));
proto_tree_add_checksum(base_tree, tvb, mac_len - (int)sizeof(mac_crc), hf_mac_header_compress_dlmap_crc, hf_mac_header_compress_dlmap_crc_status, &ei_mac_header_compress_dlmap_crc,
pinfo, calculated_crc, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
}
else
{ /* display error message */
proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_dlmap_decoder, tvb, 0, tvb_len, "CRC missing - the frame is too short (%u bytes)", tvb_len);
}
return mac_len;
}
#if 0
static gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tree)
{
/* decode a SUB-DL-UL-MAP message 6.3.2.3.60 and return the length in bytes */
/* first three bits are 0x7, which following a compressed DL map indicates this message */
proto_tree *tree = NULL;
proto_tree *ie_tree = NULL;
proto_item *generic_item = NULL;
gint data;
gint i, numie;
guint16 calculated_crc;
gint length = tvb_reported_length(tvb);
gint nib = 0;
gint lennib = BYTE_TO_NIB(length);
sub_dl_ul_map = 1; /* set flag */
tree = proto_tree_add_subtree(base_tree, tvb, NIBHI(nib,lennib-nib), ett_109x, NULL, "SUB-DL-UL-MAP");
data = TVB_NIB_WORD(nib,tvb);
proto_tree_add_uint(tree, hf_109x_cmi, tvb, NIBHI(nib,4), data);
proto_tree_add_uint(tree, hf_109x_len, tvb, NIBHI(nib,4), data);
proto_tree_add_uint(tree, hf_109x_rcid, tvb, NIBHI(nib,4), data);
proto_tree_add_uint(tree, hf_109x_haoi, tvb, NIBHI(nib,4), data);
nib += 4;
/* HARQ ACK offset indicator */
if (data & 1) {
data = TVB_NIB_BYTE(nib,tvb);
proto_tree_add_uint(tree, hf_109x_dl, tvb, NIBHI(nib,2), data);
nib += 2;
data = TVB_NIB_BYTE(nib,tvb);
proto_tree_add_uint(tree, hf_109x_ul, tvb, NIBHI(nib,2), data);
nib += 2;
}
numie = TVB_NIB_BYTE(nib,tvb);
proto_tree_add_uint(tree, hf_109x_dlie, tvb, NIBHI(nib,2), numie);
nib += 2;
/* DL-MAP IEs */
ie_tree = proto_tree_add_subtree(tree, tvb, NIBHI(nib,1), ett_109x_dl, NULL, "DL-MAP IEs");
for (i = 0; i < numie; i++) {
nib += dissect_dlmap_ie(ie_tree, pinfo, nib, lennib - nib, tvb);
}
data = TVB_NIB_BYTE(nib,tvb);
proto_tree_add_uint(tree, hf_109x_symofs, tvb, NIBHI(nib,2), data);
nib += 2;
data = TVB_NIB_BYTE(nib,tvb);
proto_tree_add_uint(tree, hf_109x_subofs, tvb, NIBHI(nib,2), data);
proto_tree_add_uint(tree, hf_109x_rsv, tvb, NIBHI(nib,2), data);
nib += 2;
/* UL-MAP IEs */
ie_tree = proto_tree_add_subtree(tree, tvb, NIBHI(nib,lennib-nib), ett_109x_ul, NULL, "UL-MAP IEs");
for ( ; nib < lennib - 1; ) {
nib += dissect_ulmap_ie(ie_tree, nib, lennib - nib, tvb);
}
/* padding */
if (nib & 1) {
proto_tree_add_bytes_format(tree, hf_padding, tvb, NIBHI(nib,1), NULL, "Padding Nibble");
nib++;
}
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, NIB_TO_BYTE(nib)), NIB_TO_BYTE(nib));
proto_tree_add_checksum(tree, tvb, NIBHI(nib,4), hf_crc16, hf_crc16_status, &ei_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
/* nib += 4; */
sub_dl_ul_map = 0; /* clear flag */
/* return length */
return length;
}
#endif
gint wimax_decode_dlmap_reduced_aas(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *base_tree)
{
/* 8.4.5.8.1 [2] Reduced AAS private DL-MAP */
/* if there is an appended UL-MAP, also decode that */
guint offset = 0;
proto_item *ti = NULL;
proto_tree *tree = NULL;
gint ulmap_appended;
gint length;
gint tvb_len = tvb_reported_length(tvb);
gint bit = 0;
guint data, pad, mult;
gint numie = 1;
gint i;
guint16 calculated_crc;
gint smcs,cidi,dcdi,phyi,cqci;
length = tvb_len;
/* display MAC Reduced_AAS_Private_DL-MAP and create subtree */
ti = proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_dlmap_decoder, tvb, offset, length, "Reduced_AAS_Private_DL-MAP");
tree = proto_item_add_subtree(ti, ett_308a);
VBIT(data, 3, hf_308a_cmi);
VBIT(ulmap_appended, 1, hf_308a_ulmap);
VBIT(data, 2, hf_308a_type);
VBIT(mult, 1, hf_308a_mult);
VBIT(data, 1, hf_308a_rsv);
if (mult) {
XBIT_HF_VALUE(numie, 8, hf_dlmap_reduced_aas_num_ie);
}
for (i = 0; i < numie; i++) {
XBIT_HF(2, hf_dlmap_reduced_aas_periodicity);
XBIT_HF_VALUE(cidi, 1, hf_dlmap_reduced_aas_cid_included);
XBIT_HF_VALUE(dcdi, 1, hf_dlmap_reduced_aas_dcd_count_included);
XBIT_HF_VALUE(phyi, 1, hf_dlmap_reduced_aas_phy_modification_included);
XBIT_HF_VALUE(cqci, 1, hf_dlmap_reduced_aas_cqich_control_indicator);
XBIT_HF(2, hf_dlmap_reduced_aas_encoding_mode);
XBIT_HF_VALUE(smcs, 1, hf_dlmap_reduced_aas_separate_mcs_enabled);
if (smcs) {
XBIT_HF(10, hf_dlmap_reduced_aas_duration);
XBIT_HF(4, hf_dlmap_reduced_aas_diuc);
XBIT_HF(2, hf_dlmap_reduced_aas_repetition_coding_indication);
}
if (cidi) {
XBIT_HF(16, hf_dlmap_reduced_aas_cid);
}
if (cqci) {
XBIT_HF(6, hf_dlmap_reduced_aas_allocation_index);
XBIT_HF(3, hf_dlmap_reduced_aas_report_period);
XBIT_HF(3, hf_dlmap_reduced_aas_frame_offset);
XBIT_HF(4, hf_dlmap_reduced_aas_report_duration);
XBIT_HF(2, hf_dlmap_reduced_aas_cqi_measurement_type);
XBIT_HF(2, hf_dlmap_reserved_uint);
}
if (dcdi) {
XBIT_HF(8, hf_dlmap_reduced_aas_dcd_count);
}
if (phyi) {
XBIT_HF(1, hf_dlmap_reduced_aas_preamble_select);
XBIT_HF(4, hf_dlmap_reduced_aas_preamble_shift_index);
XBIT_HF(1, hf_dlmap_reduced_aas_pilot_pattern_modifier);
XBIT_HF(2, hf_dlmap_reduced_aas_pilot_pattern_index);
}
XBIT_HF(3, hf_dlmap_reduced_aas_dl_frame_offset);
if (fusc) {
XBIT_HF(8, hf_dlmap_reduced_aas_zone_symbol_offset);
}
XBIT_HF(8, hf_dlmap_reduced_aas_ofdma_symbol_offset);
if (tusc) {
XBIT_HF(8, hf_dlmap_reduced_aas_subchannel_offset);
XBIT_HF(5, hf_dlmap_reduced_aas_num_ofdma_triple_symbol);
XBIT_HF(6, hf_dlmap_reduced_aas_num_subchannels);
} else {
XBIT_HF(6, hf_dlmap_reduced_aas_subchannel_offset);
XBIT_HF(7, hf_dlmap_reduced_aas_num_ofdma_symbols);
XBIT_HF(6, hf_dlmap_reduced_aas_num_subchannels);
}
XBIT_HF(4, hf_dlmap_reduced_aas_diuc_nep);
if (harq) {
XBIT_HF(1, hf_dlmap_reduced_aas_dl_harq_ack_bitmap);
XBIT_HF(6, hf_dlmap_reduced_aas_ack_allocation_index);
XBIT_HF(4, hf_dlmap_reduced_aas_acid);
XBIT_HF(1, hf_dlmap_reduced_aas_ai_sn);
if (ir_type) {
XBIT_HF(4, hf_dlmap_reduced_aas_nsch);
XBIT_HF(2, hf_dlmap_reduced_aas_spid);
XBIT_HF(2, hf_dlmap_reserved_uint);
}
}
XBIT_HF(2, hf_dlmap_reduced_aas_repetition_coding_indication);
if (ulmap_appended) {
/* offset and length are in bits */
bit += wimax_decode_ulmap_reduced_aas(tree, offset, length*8, tvb);
}
XBIT_HF(3, hf_dlmap_reserved_uint);
}
/* padding */
pad = BIT_PADDING(bit,8);
if (pad) {
proto_tree_add_bytes_format_value(tree, hf_padding, tvb, BITHI(bit,pad), NULL, "%d bits",pad);
bit += pad;
}
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BIT_ADDR(bit), hf_crc16, hf_crc16_status, &ei_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
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_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
}
},
#if 0
{
&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
}
},
#endif
{
&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_diuc_ext,
{
"Extended DIUC", "wmx.dlmap.ie.ext_diuc",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_diuc_ext2,
{
"Extended-2 DIUC", "wmx.dlmap.ie.ext2_diuc",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_reserved_extended2_duic,
{
"Reserved Extended-2 DIUC", "wmx.dlmap.ie.ext2_diuc_reserved",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_reserved_extended_duic,
{
"Reserved Extended DIUC", "wmx.dlmap.ie.ext_diuc_reserved",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_length,
{
"Length", "wmx.dlmap.ie.length",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_bitmap,
{
"Bitmap", "wmx.dlmap.ie.bitmap",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_bitmap_cqi,
{
"CQI/ACK/Periodic Ranging region NI", "wmx.dlmap.ie.bitmap.cqi",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_bitmap_pusc,
{
"PUSC region NI", "wmx.dlmap.ie.bitmap.pusc",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_bitmap_opt_pusc,
{
"Optional PUSC region NI", "wmx.dlmap.ie.bitmap.opt_pusc",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_bitmap_amc,
{
"AMC region NI", "wmx.dlmap.ie.bitmap.amc",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_bitmap_aas,
{
"AAS region NI", "wmx.dlmap.ie.bitmap.aas",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_bitmap_periodic_ranging,
{
"Periodic Ranging region NI", "wmx.dlmap.ie.bitmap.periodic_ranging",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_bitmap_sounding,
{
"Sounding region NI", "wmx.dlmap.ie.bitmap.sounding",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dlmap_ie_bitmap_mimo,
{
"MIMO region NI", "wmx.dlmap.ie.bitmap.mimo",
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_fdur_ms,
{
"Frame Duration", "wmx.dlmap.phy_fdur",
FT_UINT8, BASE_HEX, VALS(frame_duration), 0x00, NULL, HFILL
}
},
{
&hf_dlmap_phy_fdur_per_sec,
{
"Frames per second", "wmx.dlmap.phy_fdur",
FT_UINT8, BASE_HEX, VALS(frames_per_second), 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
}
},
#if 0
{
&hf_dlmapc_sync,
{
"PHY Synchronization Field", "wmx.dlmapc.sync",
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
#endif
{
&hf_dlmapc_ulmap,
{
"UL-MAP appended", "wmx.dlmapc.ulmap",
FT_UINT16, BASE_DEC, NULL, 0x1000, NULL, HFILL
}
},
#if 0
{
&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
}
},
#endif
{
&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
}
},
{
&hf_mac_header_compress_dlmap_crc_status,
{
"CRC Status", "wmx.compress_dlmap_crc.status",
FT_UINT8, BASE_NONE, VALS(plugin_proto_checksum_vals), 0x0, NULL, HFILL
}
},
{
&hf_crc16,
{
"CRC-16", "wmx.dlmap.crc16",
FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_crc16_status,
{
"CRC-16 Status", "wmx.dlmap.crc16.status",
FT_UINT8, BASE_NONE, VALS(plugin_proto_checksum_vals), 0x0, NULL, HFILL
}
},
{
&hf_padding,
{
"Padding", "wmx.dlmap.padding",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_cid_mask,
{
"CID Mask", "wmx.dlmap.cid_mask",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reserved,
{
"Reserved", "wmx.dlmap.reserved",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
/* Generated via "one time" script to help create filterable fields */
{ &hf_dlmap_rcid_ie_cid, { "CID", "wmx.dlmap.rcid_ie.cid", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_rcid_ie_prefix, { "Prefix", "wmx.dlmap.rcid_ie.prefix", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_rcid_ie_cid11, { "CID11", "wmx.dlmap.rcid_ie.cid11", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_rcid_ie_cid7, { "CID7", "wmx.dlmap.rcid_ie.cid7", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_rcid_ie_cid3, { "CID3", "wmx.dlmap.rcid_ie.cid3", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_dl_control_length, { "Length", "wmx.dlmap.dedicated_dl_control.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_dl_control_control_header, { "Control Header", "wmx.dlmap.dedicated_dl_control.control_header", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_dl_control_num_sdma_layers, { "Num SDMA Layers", "wmx.dlmap.dedicated_dl_control.num_sdma_layers", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_length, { "Length (nibbles)", "wmx.dlmap.dedicated_mimo_dl_control.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_control_header_mimo_control_info, { "Control Header (MIMO Control Info)", "wmx.dlmap.dedicated_mimo_dl_control.control_header_mimo_control_info", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_control_header_cqi_control_info, { "Control Header (CQI Control Info)", "wmx.dlmap.dedicated_mimo_dl_control.control_header_cqi_control_info", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_control_header_closed_mimo_control_info, { "Control Header (Closed MIMO Control Info)", "wmx.dlmap.dedicated_mimo_dl_control.control_header_closed_mimo_control_info", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_n_layer, { "N_layer", "wmx.dlmap.dedicated_mimo_dl_control.n_layer", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_matrix, { "Matrix", "wmx.dlmap.dedicated_mimo_dl_control.matrix", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_num_beamformed_streams, { "Num_Beamformed_Streams", "wmx.dlmap.dedicated_mimo_dl_control.num_beamformed_streams", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_period, { "Period", "wmx.dlmap.dedicated_mimo_dl_control.period", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_frame_offset, { "Frame Offset", "wmx.dlmap.dedicated_mimo_dl_control.frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_duration, { "Duration", "wmx.dlmap.dedicated_mimo_dl_control.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_allocation_index, { "Allocation Index", "wmx.dlmap.dedicated_mimo_dl_control.allocation_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_cqich_num, { "CQICH_Num", "wmx.dlmap.dedicated_mimo_dl_control.cqich_num", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_feedback_type, { "Feedback type", "wmx.dlmap.dedicated_mimo_dl_control.feedback_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_antenna_grouping_index, { "Antenna Grouping Index", "wmx.dlmap.dedicated_mimo_dl_control.antenna_grouping_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_num_stream, { "Num_stream", "wmx.dlmap.dedicated_mimo_dl_control.num_stream", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_antenna_selection_index, { "Antenna Selection Index", "wmx.dlmap.dedicated_mimo_dl_control.antenna_selection_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dedicated_mimo_dl_control_codebook_precoding_index, { "Codebook Precoding Index", "wmx.dlmap.dedicated_mimo_dl_control.codebook_precoding_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_n_sub_burst_isi, { "N sub burst[ISI]", "wmx.dlmap.n_sub_burst_isi", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_chase_n_ack_channel, { "N ACK channel", "wmx.dlmap.harq_chase.n_ack_channel", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_chase_duration, { "Duration", "wmx.dlmap.harq_chase.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_chase_sub_burst_diuc_indicator, { "Sub-Burst DIUC Indicator", "wmx.dlmap.harq_chase.sub_burst_diuc_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reserved_uint, { "Reserved", "wmx.dlmap.reserved.uint", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_chase_diuc, { "DIUC", "wmx.dlmap.harq_chase.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_chase_repetition_coding_indication, { "Repetition Coding Indication", "wmx.dlmap.harq_chase.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_chase_acid, { "ACID", "wmx.dlmap.harq_chase.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_chase_ai_sn, { "AI_SN", "wmx.dlmap.harq_chase.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_chase_ack_disable, { "ACK disable", "wmx.dlmap.harq_chase.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_chase_dedicated_dl_control_indicator, { "Dedicated DL Control Indicator", "wmx.dlmap.harq_chase.dedicated_dl_control_indicator", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_chase_allocation_index, { "Allocation Index", "wmx.dlmap.harq_chase.allocation_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_chase_period, { "Period (p)", "wmx.dlmap.harq_chase.period", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_chase_frame_offset, { "Frame offset", "wmx.dlmap.harq_chase.frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_ctc_n_ack_channel, { "N ACK channel", "wmx.dlmap.harq_ir_ctc.n_ack_channel", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_ctc_nep, { "N(EP)", "wmx.dlmap.harq_ir_ctc.n_ep", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_ctc_nsch, { "N(SCH)", "wmx.dlmap.harq_ir_ctc.n_sch", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_ctc_spid, { "SPID", "wmx.dlmap.harq_ir_ctc.spid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_ctc_acid, { "ACID", "wmx.dlmap.harq_ir_ctc.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_ctc_ai_sn, { "AI_SN", "wmx.dlmap.harq_ir_ctc.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_ctc_ack_disable, { "ACK disable", "wmx.dlmap.harq_ir_ctc.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_ctc_dedicated_dl_control_indicator, { "Dedicated DL Control Indicator", "wmx.dlmap.harq_ir_ctc.dedicated_dl_control_indicator", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_ctc_duration, { "Duration (d)", "wmx.dlmap.harq_ir_ctc.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_ctc_allocation_index, { "Allocation Index", "wmx.dlmap.harq_ir_ctc.allocation_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_ctc_period, { "Period (p)", "wmx.dlmap.harq_ir_ctc.period", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_ctc_frame_offset, { "Frame offset", "wmx.dlmap.harq_ir_ctc.frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_n_ack_channel, { "N ACK channel", "wmx.dlmap.harq_ir_cc.n_ack_channel", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_duration, { "Duration", "wmx.dlmap.harq_ir_cc.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_sub_burst_diuc_indicator, { "Sub-Burst DIUC Indicator", "wmx.dlmap.harq_ir_cc.sub_burst_diuc_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_diuc, { "DIUC", "wmx.dlmap.harq_ir_cc.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_repetition_coding_indication, { "Repetition Coding Indication", "wmx.dlmap.harq_ir_cc.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_acid, { "ACID", "wmx.dlmap.harq_ir_cc.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_ai_sn, { "AI_SN", "wmx.dlmap.harq_ir_cc.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_spid, { "SPID", "wmx.dlmap.harq_ir_cc.spid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_ack_disable, { "ACK disable", "wmx.dlmap.harq_ir_cc.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_dedicated_dl_control_indicator, { "Dedicated DL Control Indicator", "wmx.dlmap.harq_ir_cc.dedicated_dl_control_indicator", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_allocation_index, { "Allocation Index", "wmx.dlmap.harq_ir_cc.allocation_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_period, { "Period (p)", "wmx.dlmap.harq_ir_cc.period", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ir_cc_frame_offset, { "Frame offset", "wmx.dlmap.harq_ir_cc.frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_chase_harq_n_ack_channel, { "N ACK channel", "wmx.dlmap.mimo_dl_chase_harq.n_ack_channel", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_chase_harq_mu_indicator, { "MU Indicator", "wmx.dlmap.mimo_dl_chase_harq.mu_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_chase_harq_dedicated_mimo_dl_control_indicator, { "Dedicated MIMO DL Control Indicator", "wmx.dlmap.mimo_dl_chase_harq.dedicated_mimo_dl_control_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_chase_harq_ack_disable, { "ACK Disable", "wmx.dlmap.mimo_dl_chase_harq.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_chase_harq_duration, { "Duration", "wmx.dlmap.mimo_dl_chase_harq.duration", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_chase_harq_diuc, { "DIUC", "wmx.dlmap.mimo_dl_chase_harq.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_chase_harq_repetition_coding_indication, { "Repetition Coding Indication", "wmx.dlmap.mimo_dl_chase_harq.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_chase_harq_acid, { "ACID", "wmx.dlmap.mimo_dl_chase_harq.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_chase_harq_ai_sn, { "AI_SN", "wmx.dlmap.mimo_dl_chase_harq.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_n_ack_channel, { "N ACK channel", "wmx.dlmap.mimo_dl_ir_harq.n_ack_channel", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_mu_indicator, { "MU Indicator", "wmx.dlmap.mimo_dl_ir_harq.mu_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_dedicated_mimo_dl_control_indicator, { "Dedicated MIMO DL Control Indicator", "wmx.dlmap.mimo_dl_ir_harq.dedicated_mimo_dl_control_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_ack_disable, { "ACK Disable", "wmx.dlmap.mimo_dl_ir_harq.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_nsch, { "N(SCH)", "wmx.dlmap.mimo_dl_ir_harq.n_sch", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_nep, { "N(EP)", "wmx.dlmap.mimo_dl_ir_harq.n_ep", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_spid, { "SPID", "wmx.dlmap.mimo_dl_ir_harq.spid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_acid, { "ACID", "wmx.dlmap.mimo_dl_ir_harq.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_ai_sn, { "AI_SN", "wmx.dlmap.mimo_dl_ir_harq.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_cc_n_ack_channel, { "N ACK channel", "wmx.dlmap.mimo_dl_ir_harq_cc.n_ack_channel", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_cc_mu_indicator, { "MU Indicator", "wmx.dlmap.mimo_dl_ir_harq_cc.mu_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_cc_dedicated_mimo_dl_control_indicator, { "Dedicated MIMO DL Control Indicator", "wmx.dlmap.mimo_dl_ir_harq_cc.dedicated_mimo_dl_control_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_cc_ack_disable, { "ACK Disable", "wmx.dlmap.mimo_dl_ir_harq_cc.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_cc_duration, { "Duration", "wmx.dlmap.mimo_dl_ir_harq_cc.duration", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_cc_diuc, { "DIUC", "wmx.dlmap.mimo_dl_ir_harq_cc.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_cc_repetition_coding_indication, { "Repetition Coding Indication", "wmx.dlmap.mimo_dl_ir_harq_cc.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_cc_acid, { "ACID", "wmx.dlmap.mimo_dl_ir_harq_cc.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_cc_ai_sn, { "AI_SN", "wmx.dlmap.mimo_dl_ir_harq_cc.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_ir_harq_cc_spid, { "SPID", "wmx.dlmap.mimo_dl_ir_harq_cc.spid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_stc_harq_n_ack_channel, { "N ACK channel", "wmx.dlmap.mimo_dl_stc_harq.n_ack_channel", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_stc_harq_tx_count, { "TX Count", "wmx.dlmap.mimo_dl_stc_harq.tx_count", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_stc_harq_duration, { "Duration", "wmx.dlmap.mimo_dl_stc_harq.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_stc_harq_sub_burst_offset_indication, { "Sub-burst offset indication", "wmx.dlmap.mimo_dl_stc_harq.sub_burst_offset_indication", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_stc_harq_sub_burst_offset, { "Sub-burst offset", "wmx.dlmap.mimo_dl_stc_harq.sub_burst_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_stc_harq_ack_disable, { "ACK Disable", "wmx.dlmap.mimo_dl_stc_harq.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_stc_harq_dedicated_mimo_dl_control_indicator, { "Dedicated MIMO DL Control Indicator", "wmx.dlmap.mimo_dl_stc_harq.dedicated_mimo_dl_control_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_stc_harq_diuc, { "DIUC", "wmx.dlmap.mimo_dl_stc_harq.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_stc_harq_repetition_coding_indication, { "Repetition coding Indication", "wmx.dlmap.mimo_dl_stc_harq.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mimo_dl_stc_harq_acid, { "ACID", "wmx.dlmap.mimo_dl_stc_harq.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_extended_2_diuc, { "Extended-2 DIUC", "wmx.dlmap.mbs_map.extended_2_diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_mbs_zone_identifier, { "MBS Zone identifier", "wmx.dlmap.mbs_map.mbs_zone_identifier", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_macro_diversity_enhanced, { "Macro diversity enhanced", "wmx.dlmap.mbs_map.macro_diversity_enhanced", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_permutation, { "Permutation", "wmx.dlmap.mbs_map.permutation", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_dl_permbase, { "DL_PermBase", "wmx.dlmap.mbs_map.dl_permbase", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_prbs_id, { "PRBS_ID", "wmx.dlmap.mbs_map.prbs_id", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_ofdma_symbol_offset, { "OFDMA_Symbol_Offset", "wmx.dlmap.mbs_map.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_diuc_change_indication, { "DIUC_change_indication", "wmx.dlmap.mbs_map.diuc_change_indication", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_boosting, { "Boosting", "wmx.dlmap.mbs_map.boosting", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_diuc, { "DIUC", "wmx.dlmap.mbs_map.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_num_subchannels, { "No. Subchannels", "wmx.dlmap.mbs_map.num_subchannels", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_num_ofdma_symbols, { "No. OFDMA Symbols", "wmx.dlmap.mbs_map.num_ofdma_symbols", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_repetition_coding_indication, { "Repetition Coding Indication", "wmx.dlmap.mbs_map.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_cid, { "CID", "wmx.dlmap.mbs_map.cid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_ofdma_symbols_offset, { "OFDMA Symbols Offset", "wmx.dlmap.mbs_map.ofdma_symbols_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_subchannel_offset, { "Subchannel offset", "wmx.dlmap.mbs_map.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_slc_3_indication, { "SLC_3_indication", "wmx.dlmap.mbs_map.slc_3_indication", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_mbs_map_next_mbs_map_ie_frame_offset, { "Next MBS_MAP_IE frame offset", "wmx.dlmap.mbs_map.next_mbs_map_ie_frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_skip_extended_2_diuc, { "Extended-2 DIUC", "wmx.dlmap.skip.extended_2_diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_skip_mode, { "Mode", "wmx.dlmap.skip.mode", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_extended_2_diuc, { "Extended-2 DIUC", "wmx.dlmap.harq_dl_map.extended_2_diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_rcid_type, { "RCID_Type", "wmx.dlmap.harq_dl_map.rcid_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_boosting, { "Boosting", "wmx.dlmap.harq_dl_map.boosting", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_region_id_use_indicator, { "Region_ID use indicator", "wmx.dlmap.harq_dl_map.region_id_use_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_ofdma_symbol_offset, { "OFDMA symbol offset", "wmx.dlmap.harq_dl_map.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_subchannel_offset, { "Subchannel offset", "wmx.dlmap.harq_dl_map.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_number_of_ofdma_symbols, { "Number of OFDMA symbols", "wmx.dlmap.harq_dl_map.number_of_ofdma_symbols", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_number_of_subchannels, { "Number of subchannels", "wmx.dlmap.harq_dl_map.number_of_subchannels", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_rectangular_sub_burst_indicator, { "Rectangular Sub-Burst Indicator", "wmx.dlmap.harq_dl_map.rectangular_sub_burst_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_region_id, { "Region_ID", "wmx.dlmap.harq_dl_map.region_id", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_mode, { "Mode", "wmx.dlmap.harq_dl_map.mode", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_sub_burst_ie_length, { "Sub-burst IE Length", "wmx.dlmap.harq_dl_map.sub_burst_ie_length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_dl_map_reserved_mode, { "Reserved Mode", "wmx.dlmap.harq_dl_map.reserved_mode", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_ack_bitmap_data, { "Bitmap data", "wmx.dlmap.harq_ack.bitmap_data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_enhanced_dl_map_extended_2_diuc, { "Extended-2 DIUC", "wmx.dlmap.enhanced_dl_map.extended_2_diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_enhanced_dl_map_num_assignment, { "Num_Assignment", "wmx.dlmap.enhanced_dl_map.num_assignment", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_enhanced_dl_map_n_cid, { "N_CID", "wmx.dlmap.enhanced_dl_map.n_cid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_enhanced_dl_map_cid, { "CID", "wmx.dlmap.enhanced_dl_map.cid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_enhanced_dl_map_diuc, { "DIUC", "wmx.dlmap.enhanced_dl_map.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_enhanced_dl_map_boosting, { "Boosting", "wmx.dlmap.enhanced_dl_map.boosting", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_enhanced_dl_map_repetition_coding_indication, { "Repetition Coding Indication", "wmx.dlmap.enhanced_dl_map.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_enhanced_dl_map_region_id, { "Region_ID", "wmx.dlmap.enhanced_dl_map.region_id", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_extended_2_diuc, { "Extended-2 DIUC", "wmx.dlmap.aas_sdma_dl.extended_2_diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_rcid_type, { "RCID_Type", "wmx.dlmap.aas_sdma_dl.rcid_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_num_burst_region, { "Num_Burst_Region", "wmx.dlmap.aas_sdma_dl.num_burst_region", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_ofdma_symbol_offset, { "OFDMA Symbol Offset", "wmx.dlmap.aas_sdma_dl.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_subchannel_offset, { "Subchannel offset", "wmx.dlmap.aas_sdma_dl.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_num_ofdma_triple_symbols, { "No. OFDMA triple symbols", "wmx.dlmap.aas_sdma_dl.num_ofdma_triple_symbols", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_num_subchannels, { "No. subchannels", "wmx.dlmap.aas_sdma_dl.num_subchannels", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_number_of_users, { "Number of Users", "wmx.dlmap.aas_sdma_dl.number_of_users", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_encoding_mode, { "Encoding Mode", "wmx.dlmap.aas_sdma_dl.encoding_mode", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_cqich_allocation, { "CQICH Allocation", "wmx.dlmap.aas_sdma_dl.cqich_allocation", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_ackch_allocation, { "ACKCH Allocation", "wmx.dlmap.aas_sdma_dl.ackch_allocation", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_pilot_pattern_modifier, { "Pilot Pattern Modifier", "wmx.dlmap.aas_sdma_dl.pilot_pattern_modifier", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_preamble_modifier_index, { "Preamble Modifier Index", "wmx.dlmap.aas_sdma_dl.preamble_modifier_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_pilot_pattern, { "Pilot Pattern", "wmx.dlmap.aas_sdma_dl.pilot_pattern", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_diuc, { "DIUC", "wmx.dlmap.aas_sdma_dl.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_repetition_coding_indication, { "Repetition Coding Indication", "wmx.dlmap.aas_sdma_dl.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_ack_ch_index, { "ACK CH Index", "wmx.dlmap.aas_sdma_dl.ack_ch_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_acid, { "ACID", "wmx.dlmap.aas_sdma_dl.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_ai_sn, { "AI_SN", "wmx.dlmap.aas_sdma_dl.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_nep, { "N(EP)", "wmx.dlmap.aas_sdma_dl.n_ep", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_nsch, { "N(SCH)", "wmx.dlmap.aas_sdma_dl.n_sch", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_spid, { "SPID", "wmx.dlmap.aas_sdma_dl.spid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_allocation_index, { "Allocation Index", "wmx.dlmap.aas_sdma_dl.allocation_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_period, { "Period (p)", "wmx.dlmap.aas_sdma_dl.period", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_frame_offset, { "Frame offset", "wmx.dlmap.aas_sdma_dl.frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_sdma_dl_duration, { "Duration (d)", "wmx.dlmap.aas_sdma_dl.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_channel_measurement_channel_nr, { "Channel Nr", "wmx.dlmap.channel_measurement.channel_nr", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_channel_measurement_ofdma_symbol_offset, { "OFDMA Symbol Offset", "wmx.dlmap.channel_measurement.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_channel_measurement_cid, { "CID", "wmx.dlmap.channel_measurement.cid", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_stc_zone_ofdma_symbol_offset, { "OFDMA Symbol Offset", "wmx.dlmap.stc_zone.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_stc_zone_permutations, { "Permutations", "wmx.dlmap.stc_zone.permutations", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_stc_zone_use_all_sc_indicator, { "Use All SC indicator", "wmx.dlmap.stc_zone.use_all_sc_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_stc_zone_stc, { "STC", "wmx.dlmap.stc_zone.stc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_stc_zone_matrix_indicator, { "Matrix indicator", "wmx.dlmap.stc_zone.matrix_indicator", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_stc_zone_dl_permbase, { "DL_PermBase", "wmx.dlmap.stc_zone.dl_permbase", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_stc_zone_prbs_id, { "PRBS_ID", "wmx.dlmap.stc_zone.prbs_id", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_stc_zone_amc_type, { "AMC type", "wmx.dlmap.stc_zone.amc_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_stc_zone_midamble_presence, { "Midamble Presence", "wmx.dlmap.stc_zone.midamble_presence", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_stc_zone_midamble_boosting, { "Midamble Boosting", "wmx.dlmap.stc_zone.midamble_boosting", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_stc_zone_2_3_antenna_select, { "2/3 antenna select", "wmx.dlmap.stc_zone.2_3_antenna_select", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_stc_zone_dedicated_pilots, { "Dedicated Pilots", "wmx.dlmap.stc_zone.dedicated_pilots", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_dl_ofdma_symbol_offset, { "OFDMA Symbol Offset", "wmx.dlmap.aas_dl.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_dl_permutation, { "Permutation", "wmx.dlmap.aas_dl.permutation", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_dl_dl_permbase, { "DL_PermBase", "wmx.dlmap.aas_dl.dl_permbase", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_dl_downlink_preamble_config, { "Downlink_preamble_config", "wmx.dlmap.aas_dl.downlink_preamble_config", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_dl_preamble_type, { "Preamble type", "wmx.dlmap.aas_dl.preamble_type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_dl_prbs_id, { "PRBS_ID", "wmx.dlmap.aas_dl.prbs_id", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_aas_dl_diversity_map, { "Diversity Map", "wmx.dlmap.aas_dl.diversity_map", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_data_location_another_bs_segment, { "Segment", "wmx.dlmap.data_location_another_bs.segment", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_data_location_another_bs_used_subchannels, { "Used subchannels", "wmx.dlmap.data_location_another_bs.used_subchannels", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_data_location_another_bs_diuc, { "DIUC", "wmx.dlmap.data_location_another_bs.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_data_location_another_bs_frame_advance, { "Frame Advance", "wmx.dlmap.data_location_another_bs.frame_advance", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_data_location_another_bs_ofdma_symbol_offset, { "OFDMA Symbol Offset", "wmx.dlmap.data_location_another_bs.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_data_location_another_bs_subchannel_offset, { "Subchannel Offset", "wmx.dlmap.data_location_another_bs.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_data_location_another_bs_boosting, { "Boosting", "wmx.dlmap.data_location_another_bs.boosting", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_data_location_another_bs_preamble_index, { "Preamble Index", "wmx.dlmap.data_location_another_bs.preamble_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_data_location_another_bs_num_ofdma_symbols, { "No. OFDMA Symbols", "wmx.dlmap.data_location_another_bs.num_ofdma_symbols", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_data_location_another_bs_num_subchannels, { "No. Subchannels", "wmx.dlmap.data_location_another_bs.num_subchannels", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_data_location_another_bs_repetition_coding_indication, { "Repetition Coding Indication", "wmx.dlmap.data_location_another_bs.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_data_location_another_bs_cid, { "CID", "wmx.dlmap.data_location_another_bs.cid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_map_pointer_diuc, { "DIUC", "wmx.dlmap.harq_map_pointer.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_map_pointer_num_slots, { "No. Slots", "wmx.dlmap.harq_map_pointer.num_slots", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_map_pointer_repetition_coding_indication, { "Repetition Coding Indication", "wmx.dlmap.harq_map_pointer.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_map_pointer_map_version, { "Map Version", "wmx.dlmap.harq_map_pointer.map_version", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_map_pointer_idle_users, { "Idle users", "wmx.dlmap.harq_map_pointer.idle_users", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_map_pointer_sleep_users, { "Sleep users", "wmx.dlmap.harq_map_pointer.sleep_users", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_harq_map_pointer_cid_mask_length, { "CID Mask Length", "wmx.dlmap.harq_map_pointer.cid_mask_length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_phymod_dl_preamble_modifier_type, { "Preamble Modifier Type", "wmx.dlmap.phymod_dl.preamble_modifier_type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_phymod_dl_preamble_frequency_shift_index, { "Preamble frequency shift index", "wmx.dlmap.phymod_dl.preamble_frequency_shift_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_phymod_dl_preamble_time_shift_index, { "Preamble Time Shift Index", "wmx.dlmap.phymod_dl.preamble_time_shift_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_phymod_dl_pilot_pattern_modifier, { "Pilot Pattern Modifier", "wmx.dlmap.phymod_dl.pilot_pattern_modifier", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_phymod_dl_pilot_pattern_index, { "Pilot Pattern Index", "wmx.dlmap.phymod_dl.pilot_pattern_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_broadcast_ctrl_ptr_dcd_ucd_transmission_frame, { "DCD_UCD Transmission Frame", "wmx.dlmap.broadcast_ctrl_ptr.dcd_ucd_transmission_frame", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_broadcast_ctrl_ptr_skip_broadcast_system_update, { "Skip Broadcast_System_Update", "wmx.dlmap.broadcast_ctrl_ptr.skip_broadcast_system_update", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_broadcast_ctrl_ptr_broadcast_system_update_type, { "Broadcast_System_Update_Type", "wmx.dlmap.broadcast_ctrl_ptr.broadcast_system_update_type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_broadcast_ctrl_ptr_broadcast_system_update_transmission_frame, { "Broadcast_System_Update_Transmission_Frame", "wmx.dlmap.broadcast_ctrl_ptr.broadcast_system_update_transmission_frame", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_cid, { "CID", "wmx.dlmap.dl_pusc_burst_allocation.cid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_diuc, { "DIUC", "wmx.dlmap.dl_pusc_burst_allocation.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_segment, { "Segment", "wmx.dlmap.dl_pusc_burst_allocation.segment", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_boosting, { "Boosting", "wmx.dlmap.dl_pusc_burst_allocation.boosting", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_idcell, { "IDcell", "wmx.dlmap.dl_pusc_burst_allocation.idcell", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_dl_permbase, { "DL_PermBase", "wmx.dlmap.dl_pusc_burst_allocation.dl_permbase", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_prbs_id, { "PRBS_ID", "wmx.dlmap.dl_pusc_burst_allocation.prbs_id", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_repetition_coding_indication, { "Repetition coding indication", "wmx.dlmap.dl_pusc_burst_allocation.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_used_subchannels, { "Used Subchannels", "wmx.dlmap.dl_pusc_burst_allocation.used_subchannels", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_ofdma_symbol_offset, { "OFDMA symbol offset", "wmx.dlmap.dl_pusc_burst_allocation.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_num_ofdma_symbols, { "# OFDMA symbols", "wmx.dlmap.dl_pusc_burst_allocation.num_ofdma_symbols", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_subchannel_offset, { "Subchannel offset", "wmx.dlmap.dl_pusc_burst_allocation.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_dl_pusc_burst_allocation_num_subchannels, { "# subchannels", "wmx.dlmap.dl_pusc_burst_allocation.num_subchannels", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_pusc_asca_alloc_diuc, { "DIUC", "wmx.dlmap.pusc_asca_alloc.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_pusc_asca_alloc_short_basic_cid, { "Short Basic CID", "wmx.dlmap.pusc_asca_alloc.short_basic_cid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_pusc_asca_alloc_ofdma_symbol_offset, { "OFDMA Symbol offset", "wmx.dlmap.pusc_asca_alloc.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_pusc_asca_alloc_subchannel_offset, { "Subchannel offset", "wmx.dlmap.pusc_asca_alloc.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_pusc_asca_alloc_num_ofdma_symbols, { "# OFDMA Symbols", "wmx.dlmap.pusc_asca_alloc.num_ofdma_symbols", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_pusc_asca_alloc_num_symbols, { "# Symbols", "wmx.dlmap.pusc_asca_alloc.num_symbols", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_pusc_asca_alloc_repetition_coding_information, { "Repetition Coding Information", "wmx.dlmap.pusc_asca_alloc.repetition_coding_information", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_pusc_asca_alloc_permutation_id, { "Permutation ID", "wmx.dlmap.pusc_asca_alloc.permutation_id", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_num_ie, { "NUM IE", "wmx.dlmap.reduced_aas.num_ie", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_periodicity, { "Periodicity", "wmx.dlmap.reduced_aas.periodicity", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_cid_included, { "CID Included", "wmx.dlmap.reduced_aas.cid_included", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_dcd_count_included, { "DCD Count Included", "wmx.dlmap.reduced_aas.dcd_count_included", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_phy_modification_included, { "PHY modification included", "wmx.dlmap.reduced_aas.phy_modification_included", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_cqich_control_indicator, { "CQICH control indicator", "wmx.dlmap.reduced_aas.cqich_control_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_encoding_mode, { "Encoding Mode", "wmx.dlmap.reduced_aas.encoding_mode", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_separate_mcs_enabled, { "Separate MCS Enabled", "wmx.dlmap.reduced_aas.separate_mcs_enabled", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_duration, { "Duration", "wmx.dlmap.reduced_aas.duration", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_diuc, { "DIUC", "wmx.dlmap.reduced_aas.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_repetition_coding_indication, { "Repetition Coding Indication", "wmx.dlmap.reduced_aas.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_cid, { "CID", "wmx.dlmap.reduced_aas.cid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_allocation_index, { "Allocation Index", "wmx.dlmap.reduced_aas.allocation_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_report_period, { "Report Period", "wmx.dlmap.reduced_aas.report_period", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_frame_offset, { "Frame Offset", "wmx.dlmap.reduced_aas.frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_report_duration, { "Report Duration", "wmx.dlmap.reduced_aas.report_duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_cqi_measurement_type, { "CQI Measurement Type", "wmx.dlmap.reduced_aas.cqi_measurement_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_dcd_count, { "DCD Count", "wmx.dlmap.reduced_aas.dcd_count", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_preamble_select, { "Preamble Select", "wmx.dlmap.reduced_aas.preamble_select", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_preamble_shift_index, { "Preamble Shift Index", "wmx.dlmap.reduced_aas.preamble_shift_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_pilot_pattern_modifier, { "Pilot Pattern Modifier", "wmx.dlmap.reduced_aas.pilot_pattern_modifier", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_pilot_pattern_index, { "Pilot Pattern Index", "wmx.dlmap.reduced_aas.pilot_pattern_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_dl_frame_offset, { "DL Frame Offset", "wmx.dlmap.reduced_aas.dl_frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_zone_symbol_offset, { "Zone Symbol Offset", "wmx.dlmap.reduced_aas.zone_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_ofdma_symbol_offset, { "OFDMA Symbol Offset", "wmx.dlmap.reduced_aas.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_subchannel_offset, { "Subchannel Offset", "wmx.dlmap.reduced_aas.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_num_ofdma_triple_symbol, { "No. OFDMA triple symbol", "wmx.dlmap.reduced_aas.num_ofdma_triple_symbol", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_num_subchannels, { "No. subchannels", "wmx.dlmap.reduced_aas.num_subchannels", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_num_ofdma_symbols, { "No. OFDMA symbols", "wmx.dlmap.reduced_aas.num_ofdma_symbols", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_diuc_nep, { "DIUC/N(EP)", "wmx.dlmap.reduced_aas.diuc_nep", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_dl_harq_ack_bitmap, { "DL HARQ ACK bitmap", "wmx.dlmap.reduced_aas.dl_harq_ack_bitmap", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_ack_allocation_index, { "ACK Allocation Index", "wmx.dlmap.reduced_aas.ack_allocation_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_acid, { "ACID", "wmx.dlmap.reduced_aas.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_ai_sn, { "AI_SN", "wmx.dlmap.reduced_aas.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_nsch, { "N(SCH)", "wmx.dlmap.reduced_aas.nsch", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_dlmap_reduced_aas_spid, { "SPID", "wmx.dlmap.reduced_aas.spid", FT_UINT16, BASE_DEC, NULL, 0x00, 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,
};
static ei_register_info ei[] = {
{ &ei_dlmap_not_implemented, { "wmx.dlmap.not_implemented", PI_UNDECODED, PI_WARN, "Not implemented", EXPFILL }},
{ &ei_crc16, { "wmx.dlmap.bad_checksum", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }},
{ &ei_mac_header_compress_dlmap_crc, { "wmx.compress_dlmap.bad_checksum", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }},
{ &ei_mac_header_invalid_length, { "wmx.compress_dlmap.invalid_length", PI_MALFORMED, PI_ERROR, "Invalid length", EXPFILL }},
};
expert_module_t* expert_mac_mgmt_msg_dlmap;
proto_mac_mgmt_msg_dlmap_decoder = proto_register_protocol (
"WiMax DLMAP Messages", /* name */
"WiMax DLMAP", /* short name */
"wmx.dlmap" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_dlmap_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_mac_mgmt_msg_dlmap = expert_register_protocol(proto_mac_mgmt_msg_dlmap_decoder);
expert_register_field_array(expert_mac_mgmt_msg_dlmap, ei, array_length(ei));
dlmap_handle = register_dissector("mac_mgmt_msg_dlmap_handler", dissect_mac_mgmt_msg_dlmap_decoder, proto_mac_mgmt_msg_dlmap_decoder);
}
void proto_reg_handoff_mac_mgmt_msg_dlmap(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DL_MAP, dlmap_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_dreg.c | /* msg_dreg.c
* WiMax MAC Management DREG-REQ, DREG-CMD Message decoders
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: John R. Underwood <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
extern gboolean include_cor2_changes;
void proto_register_mac_mgmt_msg_dreg_req(void);
void proto_register_mac_mgmt_msg_dreg_cmd(void);
void proto_reg_handoff_mac_mgmt_msg_dreg(void);
static dissector_handle_t dreg_req_handle;
static dissector_handle_t dreg_cmd_handle;
/* Forward reference */
static void dissect_dreg_tlv(proto_tree *dreg_tree, gint tlv_type, tvbuff_t *tvb, guint tlv_offset, guint tlv_len);
static int dissect_mac_mgmt_msg_dreg_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
static int dissect_mac_mgmt_msg_dreg_cmd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
static gint proto_mac_mgmt_msg_dreg_req_decoder = -1;
static gint proto_mac_mgmt_msg_dreg_cmd_decoder = -1;
static gint ett_mac_mgmt_msg_dreg_decoder = -1;
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_mgmt_msg_dreg_decoder,
};
/* DREG fields */
/* static gint hf_ack_type_reserved = -1; */
static gint hf_dreg_cmd_action = -1;
static gint hf_dreg_cmd_action_cor2 = -1;
static gint hf_dreg_cmd_reserved = -1;
static gint hf_dreg_paging_cycle = -1;
static gint hf_dreg_paging_offset = -1;
static gint hf_dreg_paging_group_id = -1;
static gint hf_dreg_req_duration = -1;
static gint hf_paging_controller_id = -1;
static gint hf_mac_hash_skip_threshold = -1;
static gint hf_dreg_paging_cycle_request = -1;
static gint hf_dreg_retain_ms_service_sbc = -1;
static gint hf_dreg_retain_ms_service_pkm = -1;
static gint hf_dreg_retain_ms_service_reg = -1;
static gint hf_dreg_retain_ms_service_network_address = -1;
static gint hf_dreg_retain_ms_service_tod = -1;
static gint hf_dreg_retain_ms_service_tftp = -1;
static gint hf_dreg_retain_ms_service_full_service = -1;
static gint hf_dreg_consider_paging_pref = -1;
static gint hf_tlv_value = -1;
static gint hf_dreg_req_action = -1;
static gint hf_dreg_req_reserved = -1;
static gint hf_dreg_invalid_tlv = -1;
/* STRING RESOURCES */
static const value_string vals_dreg_req_code[] = {
{0, "SS De-Registration request from BS and network"},
{1, "MS request for De-Registration from serving BS and initiation of Idle Mode"},
{2, "MS response for the Unsolicited De-Registration initiated by BS"},
{3, "Reject for the unsolicited DREG-CMD with action \
code 05 (idle mode request) by the BS. \
Applicable only when MS has pending UL data to transmit"},
{4, "Reserved"},
{0, NULL}
};
static const value_string vals_dreg_cmd_action[] = {
{0, "SS shall immediately terminate service with the BS and \
should attempt network entry at another BS"},
{1, "SS shall listen to the current channel BS but shall not \
transmit until an RES-CMD message or DREG-CMD with \
Action Code 02 or 03 is received"},
{2, "SS shall listen to the BS but only transmit \
on the Basic, and Primary Management Connections"},
{3, "SS shall return to normal operation and may transmit on \
any of its active connections"},
{4, "SS shall terminate current Normal Operations with the BS; \
the BS shall transmit this action code only in response \
to any SS DREG-REQ message"},
{5, "MS shall immediately begin de-registration from serving \
BS and request initiation of MS Idle Mode"},
{6, "The MS may retransmit the DREG-REQ message after the \
time duration (REQ-duration) provided in the message"},
{7, "The MS shall not retransmit the DREG-REQ message and shall \
wait for the DREG-CMD message. BS transmittal of a \
subsequent DREG-CMD with Action Code 03 shall cancel \
this restriction"},
{0, NULL}
};
static const value_string vals_dreg_cmd_action_cor2[] = {
{0, "SS shall immediately terminate service with the BS and \
should attempt network entry at another BS"},
{1, "SS shall listen to the current channel BS but shall not \
transmit until an RES-CMD message or DREG-CMD with \
Action Code 02 or 03 is received"},
{2, "SS shall listen to the BS but only transmit \
on the Basic, and Primary Management Connections"},
{3, "SS shall return to normal operation and may transmit on \
any of its active connections"},
{4, "Only valid in response to a DREG-REQ message with DREG \
Code = 00. SS shall terminate current Normal Operations with the BS"},
{5, "MS shall immediately begin de-registration from serving \
BS and request initiation of MS Idle Mode"},
{6, "Only valid in response to a DREG-REQ message with DREG \
Code = 01. The MS may retransmit the DREG-REQ message after the \
REQ-duration provided in the message; \
BS sending a subsequent DREG-CMD message with \
Action Code 03 cancels this restriction"},
{0, NULL}
};
/* Decode sub-TLV's of either DREG-REQ or DREG-CMD. */
static void dissect_dreg_tlv(proto_tree *dreg_tree, gint tlv_type, tvbuff_t *tvb, guint tlv_offset, guint tlv_len)
{
switch (tlv_type) {
case DREG_PAGING_INFO:
proto_tree_add_item(dreg_tree, hf_dreg_paging_cycle, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(dreg_tree, hf_dreg_paging_offset, tvb, tlv_offset + 2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(dreg_tree, hf_dreg_paging_group_id, tvb, tlv_offset + 3, 2, ENC_BIG_ENDIAN);
break;
case DREG_REQ_DURATION:
proto_tree_add_item(dreg_tree, hf_dreg_req_duration, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case DREG_PAGING_CONTROLLER_ID:
proto_tree_add_item(dreg_tree, hf_paging_controller_id, tvb, tlv_offset, 6, ENC_NA);
break;
case DREG_IDLE_MODE_RETAIN_INFO:
proto_tree_add_item(dreg_tree, hf_dreg_retain_ms_service_sbc, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(dreg_tree, hf_dreg_retain_ms_service_pkm, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(dreg_tree, hf_dreg_retain_ms_service_reg, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(dreg_tree, hf_dreg_retain_ms_service_network_address, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(dreg_tree, hf_dreg_retain_ms_service_tod, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(dreg_tree, hf_dreg_retain_ms_service_tftp, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(dreg_tree, hf_dreg_retain_ms_service_full_service, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(dreg_tree, hf_dreg_consider_paging_pref, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case DREG_MAC_HASH_SKIP_THRESHOLD:
proto_tree_add_item(dreg_tree, hf_mac_hash_skip_threshold, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
break;
case DREG_PAGING_CYCLE_REQUEST:
proto_tree_add_item(dreg_tree, hf_dreg_paging_cycle_request, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
break;
default:
proto_tree_add_item(dreg_tree, hf_tlv_value, tvb, tlv_offset, tlv_len, ENC_NA);
break;
}
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_dreg_req(void)
{
/* DREG fields display */
static hf_register_info hf[] =
{
{
&hf_dreg_consider_paging_pref,
{
"Consider Paging Preference of each Service Flow in resource retention", "wmx.dreg.consider_paging_preference",
FT_UINT8, BASE_DEC, NULL, 0x80, NULL, HFILL
}
},
{
&hf_dreg_invalid_tlv,
{
"Invalid TLV", "wmx.dreg.invalid_tlv",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
}
},
{
&hf_mac_hash_skip_threshold,
{
"MAC Hash Skip Threshold", "wmx.dreg.mac_hash_skip_threshold",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_paging_controller_id,
{
"Paging Controller ID", "wmx.dreg.paging_controller_id",
FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dreg_paging_cycle,
{
"PAGING CYCLE", "wmx.dreg.paging_cycle",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dreg_paging_cycle_request,
{
"Paging Cycle Request", "wmx.dreg.paging_cycle_request",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dreg_paging_group_id,
{
"Paging-group-ID", "wmx.dreg.paging_group_id",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dreg_paging_offset,
{
"PAGING OFFSET", "wmx.dreg.paging_offset",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dreg_req_duration,
{
"REQ-duration (Waiting value for the DREG-REQ message re-transmission in frames)", "wmx.dreg.req_duration",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dreg_retain_ms_service_full_service,
{
"Retain MS service and operation information associated with Full service", "wmx.dreg.retain_ms_full_service",
FT_UINT8, BASE_DEC, NULL, 0x40, NULL, HFILL
}
},
{
&hf_dreg_retain_ms_service_network_address,
{
"Retain MS service and operational information associated with Network Address", "wmx.dreg.retain_ms_service_network_address",
FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL
}
},
{
&hf_dreg_retain_ms_service_pkm,
{
"Retain MS service and operational information associated with PKM-REQ/RSP", "wmx.dreg.retain_ms_service_pkm",
FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL
}
},
{
&hf_dreg_retain_ms_service_reg,
{
"Retain MS service and operational information associated with REG-REQ/RSP", "wmx.dreg.retain_ms_service_reg",
FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL
}
},
{
&hf_dreg_retain_ms_service_sbc,
{
"Retain MS service and operational information associated with SBC-REQ/RSP", "wmx.dreg.retain_ms_service_sbc",
FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL
}
},
{
&hf_dreg_retain_ms_service_tftp,
{
"Retain MS service and operational information associated with TFTP messages", "wmx.dreg.retain_ms_service_tftp",
FT_UINT8, BASE_DEC, NULL, 0x20, NULL, HFILL
}
},
{
&hf_dreg_retain_ms_service_tod,
{
"Retain MS service and operational information associated with Time of Day", "wmx.dreg.retain_ms_service_tod",
FT_UINT8, BASE_DEC, NULL, 0x10, NULL, HFILL
}
},
{
&hf_dreg_cmd_action,
{
"DREG-CMD Action code", "wmx.dreg_cmd.action",
FT_UINT8, BASE_DEC, VALS(vals_dreg_cmd_action), 0x07, NULL, HFILL
}
},
{
&hf_dreg_cmd_action_cor2,
{
"DREG-CMD Action code", "wmx.dreg_cmd.action",
FT_UINT8, BASE_DEC, VALS(vals_dreg_cmd_action_cor2), 0x07, NULL, HFILL
}
},
{
&hf_dreg_cmd_reserved,
{
"Reserved", "wmx.dreg_cmd.action_reserved",
FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL
}
},
{
&hf_dreg_req_action,
{
"DREG-REQ Action code", "wmx.dreg_req.action",
FT_UINT8, BASE_DEC, VALS(vals_dreg_req_code), 0x03, NULL, HFILL
}
},
{
&hf_dreg_req_reserved,
{
"Reserved", "wmx.dreg_req.action_reserved",
FT_UINT8, BASE_DEC, NULL, 0xFC, NULL, HFILL
}
},
{
&hf_tlv_value,
{
"Value", "wmx.dreg.unknown_tlv_value",
FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
#if 0
{
&hf_ack_type_reserved,
{
"Reserved", "wmx.ack_type_reserved",
FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL
}
}
#endif
};
proto_mac_mgmt_msg_dreg_req_decoder = proto_register_protocol (
"WiMax DREG-REQ Messages", /* name */
"WiMax DREG-REQ", /* short name */
"wmx.dreg_req" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_dreg_req_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
dreg_req_handle = register_dissector("mac_mgmt_msg_dreg_req_handler", dissect_mac_mgmt_msg_dreg_req_decoder, proto_mac_mgmt_msg_dreg_req_decoder);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_dreg_cmd(void)
{
proto_mac_mgmt_msg_dreg_cmd_decoder = proto_register_protocol (
"WiMax DREG-CMD Messages", /* name */
"WiMax DREG-CMD", /* short name */
"wmx.dreg_cmd" /* abbrev */
);
dreg_cmd_handle = register_dissector("mac_mgmt_msg_dreg_cmd_handler", dissect_mac_mgmt_msg_dreg_cmd_decoder, proto_mac_mgmt_msg_dreg_cmd_decoder);
}
/* Decode DREG-REQ messages. */
static int dissect_mac_mgmt_msg_dreg_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tlv_offset;
guint tvb_len;
proto_item *dreg_req_item;
proto_tree *dreg_req_tree;
proto_tree *tlv_tree = NULL;
tlv_info_t tlv_info;
gint tlv_type;
gint tlv_len;
gboolean hmac_found = FALSE;
{ /* we are being asked for details */
/* Get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* display MAC payload type DREG-REQ */
dreg_req_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dreg_req_decoder, tvb, 0, -1, "MAC Management Message, DREG-REQ");
/* add MAC DREG REQ subtree */
dreg_req_tree = proto_item_add_subtree(dreg_req_item, ett_mac_mgmt_msg_dreg_decoder);
/* display the Action Code */
proto_tree_add_item(dreg_req_tree, hf_dreg_req_action, tvb, offset, 1, ENC_BIG_ENDIAN);
/* show the Reserved bits */
proto_tree_add_item(dreg_req_tree, hf_dreg_req_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DREG-REQ TLV error");
proto_tree_add_item(dreg_req_tree, hf_dreg_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
break;
}
/* get the offset to the TLV data */
tlv_offset = offset + get_tlv_value_offset(&tlv_info);
switch (tlv_type) {
case HMAC_TUPLE: /* Table 348d */
/* decode and display the HMAC Tuple */
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dreg_decoder, dreg_req_tree, proto_mac_mgmt_msg_dreg_req_decoder, tvb, offset, tlv_len, "HMAC Tuple");
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_dreg_decoder, dreg_req_tree, proto_mac_mgmt_msg_dreg_req_decoder, tvb, offset, tlv_len, "CMAC Tuple");
wimax_cmac_tuple_decoder(tlv_tree, tvb, tlv_offset, tlv_len);
break;
default:
/* Decode DREG-REQ sub-TLV's */
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dreg_decoder, dreg_req_tree, proto_mac_mgmt_msg_dreg_req_decoder, tvb, offset, tlv_len, "DREG-REQ sub-TLV's");
dissect_dreg_tlv(tlv_tree, tlv_type, tvb, tlv_offset, tlv_len);
break;
}
offset = tlv_len + tlv_offset;
} /* end of TLV process while loop */
if (!hmac_found)
proto_item_append_text(dreg_req_tree, " (HMAC Tuple is missing !)");
}
return tvb_captured_length(tvb);
}
/* Decode DREG-CMD messages. */
static int dissect_mac_mgmt_msg_dreg_cmd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tlv_offset;
guint tvb_len;
proto_item *dreg_cmd_item;
proto_tree *dreg_cmd_tree;
proto_tree *tlv_tree = NULL;
tlv_info_t tlv_info;
gint tlv_type;
gint tlv_len;
gboolean hmac_found = FALSE;
{ /* we are being asked for details */
/* Get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* display MAC payload type DREG-CMD */
dreg_cmd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dreg_cmd_decoder, tvb, 0, -1, "MAC Management Message, DREG-CMD");
/* add MAC DREG CMD subtree */
dreg_cmd_tree = proto_item_add_subtree(dreg_cmd_item, ett_mac_mgmt_msg_dreg_decoder);
/* display the Action Code */
if (include_cor2_changes)
proto_tree_add_item(dreg_cmd_tree, hf_dreg_cmd_action_cor2, tvb, offset, 1, ENC_BIG_ENDIAN);
else
proto_tree_add_item(dreg_cmd_tree, hf_dreg_cmd_action, tvb, offset, 1, ENC_BIG_ENDIAN);
/* show the Reserved bits */
proto_tree_add_item(dreg_cmd_tree, hf_dreg_cmd_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
offset ++;
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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DREG-CMD TLV error");
proto_tree_add_item(dreg_cmd_tree, hf_dreg_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
break;
}
/* get the offset to the TLV data */
tlv_offset = offset + get_tlv_value_offset(&tlv_info);
switch (tlv_type) {
case HMAC_TUPLE: /* Table 348d */
/* decode and display the HMAC Tuple */
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dreg_decoder, dreg_cmd_tree, proto_mac_mgmt_msg_dreg_cmd_decoder, tvb, offset, tlv_len, "HMAC Tuple");
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_dreg_decoder, dreg_cmd_tree, proto_mac_mgmt_msg_dreg_cmd_decoder, tvb, offset, tlv_len, "CMAC Tuple");
wimax_cmac_tuple_decoder(tlv_tree, tvb, tlv_offset, tlv_len);
break;
default:
/* Decode DREG-CMD sub-TLV's */
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dreg_decoder, dreg_cmd_tree, proto_mac_mgmt_msg_dreg_cmd_decoder, tvb, offset, tlv_len, "DREG-CMD sub-TLV's");
dissect_dreg_tlv(tlv_tree, tlv_type, tvb, tlv_offset, tlv_len);
break;
}
offset = tlv_len + tlv_offset;
} /* end of TLV process while loop */
if (!hmac_found)
proto_item_append_text(dreg_cmd_tree, " (HMAC Tuple is missing !)");
}
return tvb_captured_length(tvb);
}
void
proto_reg_handoff_mac_mgmt_msg_dreg(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DREG_REQ, dreg_req_handle);
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DREG_CMD, dreg_cmd_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_dsa.c | /* msg_dsa.c
* WiMax MAC Management DSA-REQ/RSP/ACK Messages decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
/*
#define DEBUG
*/
#include <epan/packet.h>
#include "wimax_mac.h"
#include "wimax_utils.h"
void proto_register_mac_mgmt_msg_dsa(void);
void proto_reg_handoff_mac_mgmt_msg_dsa(void);
static dissector_handle_t dsa_req_handle;
static dissector_handle_t dsa_rsp_handle;
static dissector_handle_t dsa_ack_handle;
static 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;
/* fix fields */
static gint hf_dsa_transaction_id = -1;
static gint hf_dsa_confirmation_code = -1;
static int dissect_mac_mgmt_msg_dsa_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *dsa_item;
proto_tree *dsa_tree;
{ /* we are being asked for details */
/* display MAC message type */
dsa_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsa_decoder, tvb, offset, -1,
"Dynamic Service Addition Request (DSA-REQ)");
/* 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) */
/* display the Transaction ID */
proto_tree_add_item(dsa_tree, hf_dsa_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
/* move to next field */
offset += 2;
/* process DSA-REQ message TLV Encode Information */
wimax_common_tlv_encoding_decoder(tvb_new_subset_remaining(tvb, offset), pinfo, dsa_tree);
}
return tvb_captured_length(tvb);
}
static int dissect_mac_mgmt_msg_dsa_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *dsa_item;
proto_tree *dsa_tree;
{ /* we are being asked for details */
/* display MAC message type */
dsa_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsa_decoder, tvb, offset, -1,
"Dynamic Service Addition Response (DSA-RSP)");
/* 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) */
/* display the Transaction ID */
proto_tree_add_item(dsa_tree, hf_dsa_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
/* move to next field */
offset += 2;
/* display the Confirmation Code */
proto_tree_add_item(dsa_tree, hf_dsa_confirmation_code, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
/* process DSA RSP message TLV Encode Information */
wimax_common_tlv_encoding_decoder(tvb_new_subset_remaining(tvb, offset), pinfo, dsa_tree);
}
return tvb_captured_length(tvb);
}
static int dissect_mac_mgmt_msg_dsa_ack_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *dsa_item;
proto_tree *dsa_tree;
{ /* we are being asked for details */
/* display MAC message type */
dsa_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsa_decoder, tvb, offset, -1,
"Dynamic Service Addition Acknowledge (DSA-ACK)");
/* 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) */
/* display the Transaction ID */
proto_tree_add_item(dsa_tree, hf_dsa_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
/* move to next field */
offset += 2;
/* display the Confirmation Code */
proto_tree_add_item(dsa_tree, hf_dsa_confirmation_code, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
/* process DSA-REQ message TLV Encode Information */
wimax_common_tlv_encoding_decoder(tvb_new_subset_remaining(tvb, offset), pinfo, dsa_tree);
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_dsa(void)
{
/* DSx display */
static hf_register_info hf[] =
{
{
&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 Messages", /* name */
"WiMax DSA", /* short name */
"wmx.dsa" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_dsa_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
dsa_req_handle = register_dissector("mac_mgmt_msg_dsa_req_handler", dissect_mac_mgmt_msg_dsa_req_decoder, proto_mac_mgmt_msg_dsa_decoder);
dsa_rsp_handle = register_dissector("mac_mgmt_msg_dsa_rsp_handler", dissect_mac_mgmt_msg_dsa_rsp_decoder, proto_mac_mgmt_msg_dsa_decoder);
dsa_ack_handle = register_dissector("mac_mgmt_msg_dsa_ack_handler", dissect_mac_mgmt_msg_dsa_ack_decoder, proto_mac_mgmt_msg_dsa_decoder);
}
void
proto_reg_handoff_mac_mgmt_msg_dsa (void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DSA_REQ, dsa_req_handle);
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DSA_RSP, dsa_rsp_handle);
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DSA_ACK, dsa_ack_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_dsc.c | /* msg_dsc.c
* WiMax MAC Management DSC-REQ/RSP/ACK Messages decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
/*
#define DEBUG
*/
#include <epan/packet.h>
#include "wimax_mac.h"
#include "wimax_utils.h"
void proto_register_mac_mgmt_msg_dsc(void);
void proto_reg_handoff_mac_mgmt_msg_dsc(void);
static dissector_handle_t dsc_req_handle;
static dissector_handle_t dsc_rsp_handle;
static dissector_handle_t dsc_ack_handle;
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;
/* fix fields */
static gint hf_dsc_transaction_id = -1;
static gint hf_dsc_confirmation_code = -1;
static int dissect_mac_mgmt_msg_dsc_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *dsc_item;
proto_tree *dsc_tree;
{ /* we are being asked for details */
/* display MAC message type */
dsc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsc_decoder, tvb, offset, -1,
"Dynamic Service Change Request (DSC-REQ)");
/* 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) */
/* display the Transaction ID */
proto_tree_add_item(dsc_tree, hf_dsc_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
/* move to next field */
offset += 2;
/* process DSC REQ message TLV Encode Information */
wimax_common_tlv_encoding_decoder(tvb_new_subset_remaining(tvb, offset), pinfo, dsc_tree);
}
return tvb_captured_length(tvb);
}
static int dissect_mac_mgmt_msg_dsc_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *dsc_item;
proto_tree *dsc_tree;
{ /* we are being asked for details */
/* display MAC message type */
dsc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsc_decoder, tvb, offset, -1,
"Dynamic Service Change Response (DSC-RSP)");
/* 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) */
/* display the Transaction ID */
proto_tree_add_item(dsc_tree, hf_dsc_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
/* move to next field */
offset += 2;
/* display the Confirmation Code */
proto_tree_add_item(dsc_tree, hf_dsc_confirmation_code, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
/* process DSC RSP message TLV Encode Information */
wimax_common_tlv_encoding_decoder(tvb_new_subset_remaining(tvb, offset), pinfo, dsc_tree);
}
return tvb_captured_length(tvb);
}
static int dissect_mac_mgmt_msg_dsc_ack_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *dsc_item;
proto_tree *dsc_tree;
{ /* we are being asked for details */
/* display MAC message type */
dsc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsc_decoder, tvb, offset, -1,
"Dynamic Service Change Acknowledge (DSC-ACK)");
/* 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) */
/* display the Transaction ID */
proto_tree_add_item(dsc_tree, hf_dsc_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
/* move to next field */
offset += 2;
/* display the Confirmation Code */
proto_tree_add_item(dsc_tree, hf_dsc_confirmation_code, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
/* process DSC ACK message TLV Encode Information */
wimax_common_tlv_encoding_decoder(tvb_new_subset_remaining(tvb, offset), pinfo, dsc_tree);
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_dsc(void)
{
/* DSx display */
static hf_register_info hf[] =
{
{
&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_register_protocol (
"WiMax DSC Messages", /* name */
"WiMax DSC", /* short name */
"wmx.dsc" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_dsc_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
dsc_req_handle = register_dissector("mac_mgmt_msg_dsc_req_handler", dissect_mac_mgmt_msg_dsc_req_decoder, proto_mac_mgmt_msg_dsc_decoder);
dsc_rsp_handle = register_dissector("mac_mgmt_msg_dsc_rsp_handler", dissect_mac_mgmt_msg_dsc_rsp_decoder, proto_mac_mgmt_msg_dsc_decoder);
dsc_ack_handle = register_dissector("mac_mgmt_msg_dsc_ack_handler", dissect_mac_mgmt_msg_dsc_ack_decoder, proto_mac_mgmt_msg_dsc_decoder);
}
void
proto_reg_handoff_mac_mgmt_msg_dsc(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DSC_REQ, dsc_req_handle);
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DSC_RSP, dsc_rsp_handle);
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DSC_ACK, dsc_ack_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_dsd.c | /* msg_dsd.c
* WiMax MAC Management DSD-REQ/RSP Messages decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
/*
#define DEBUG
*/
#include <epan/packet.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
void proto_register_mac_mgmt_msg_dsd(void);
void proto_reg_handoff_mac_mgmt_msg_dsd(void);
static dissector_handle_t dsd_req_handle;
static dissector_handle_t dsd_rsp_handle;
static 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; */
/* fix fields */
static gint hf_dsd_transaction_id = -1;
static gint hf_dsd_service_flow_id = -1;
static gint hf_dsd_confirmation_code = -1;
static gint hf_dsd_invalid_tlv = -1;
static gint hf_dsd_unknown_type = -1;
static int dissect_mac_mgmt_msg_dsd_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tvb_len, tlv_len, tlv_value_offset;
gint tlv_type;
proto_item *dsd_item;
proto_tree *dsd_tree;
proto_tree *tlv_tree = NULL;
tlv_info_t tlv_info;
{ /* we are being asked for details */
/* 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, -1,
"Dynamic Service Deletion Request (DSD-REQ)");
/* 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 */
/* display the Transaction ID */
proto_tree_add_item(dsd_tree, hf_dsd_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
/* move to next field */
offset += 2;
/* display the Service Flow ID */
proto_tree_add_item(dsd_tree, hf_dsd_service_flow_id, tvb, offset, 4, ENC_BIG_ENDIAN);
/* move to next field */
offset += 4;
/* process DSD REQ message TLV Encode Information */
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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DSD-REQ TLV error");
proto_tree_add_item(dsd_tree, hf_dsd_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(dsd_tree, proto_mac_mgmt_msg_dsd_decoder, tvb, offset, tlv_len + tlv_value_offset, "DSD-REQ TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len + tlv_value_offset, offset, tvb_len);
#endif
/* process TLV */
switch (tlv_type)
{
case HMAC_TUPLE: /* Table 348d */
/* decode and display the HMAC Tuple */
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dsd_req_decoder, dsd_tree, proto_mac_mgmt_msg_dsd_decoder, tvb, offset, tlv_len, "HMAC Tuple");
wimax_hmac_tuple_decoder(tlv_tree, tvb, offset+tlv_value_offset, tlv_len);
break;
case CMAC_TUPLE: /* Table 348b */
/* decode and display the CMAC Tuple */
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dsd_req_decoder, dsd_tree, proto_mac_mgmt_msg_dsd_decoder, tvb, offset, tlv_len, "CMAC Tuple");
wimax_cmac_tuple_decoder(tlv_tree, tvb, offset+tlv_value_offset, tlv_len);
break;
default:
/* display the unknown tlv in hex */
add_tlv_subtree(&tlv_info, dsd_tree, hf_dsd_unknown_type, tvb, offset, ENC_NA);
break;
}
offset += (tlv_len+tlv_value_offset);
} /* end of while loop */
}
return tvb_captured_length(tvb);
}
static int dissect_mac_mgmt_msg_dsd_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tvb_len, tlv_len, tlv_value_offset;
gint tlv_type;
proto_item *dsd_item;
proto_tree *dsd_tree;
proto_tree *tlv_tree = NULL;
tlv_info_t tlv_info;
{ /* we are being asked for details */
/* 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, -1,
"Dynamic Service Deletion Response (DSD-RSP)");
/* 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 */
/* display the Transaction ID */
proto_tree_add_item(dsd_tree, hf_dsd_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
/* move to next field */
offset += 2;
/* display the Confirmation Code */
proto_tree_add_item(dsd_tree, hf_dsd_confirmation_code, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next field */
offset++;
/* display the Service Flow ID */
proto_tree_add_item(dsd_tree, hf_dsd_service_flow_id, tvb, offset, 4, ENC_BIG_ENDIAN);
/* move to next field */
offset += 4;
/* process DSD RSP message TLV Encode Information */
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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DSD RSP TLV error");
proto_tree_add_item(dsd_tree, hf_dsd_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(dsd_tree, proto_mac_mgmt_msg_dsd_decoder, tvb, offset, tlv_len + tlv_value_offset, "DSD-RSP TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len + tlv_value_offset, offset, tvb_len);
#endif
/* process TLV */
switch (tlv_type)
{
case HMAC_TUPLE: /* Table 348d */
/* decode and display the HMAC Tuple */
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dsd_req_decoder, dsd_tree, proto_mac_mgmt_msg_dsd_decoder, tvb, offset, tlv_len, "HMAC Tuple");
wimax_hmac_tuple_decoder(tlv_tree, tvb, offset+tlv_value_offset, tlv_len);
break;
case CMAC_TUPLE: /* Table 348b */
/* decode and display the CMAC Tuple */
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_dsd_req_decoder, dsd_tree, proto_mac_mgmt_msg_dsd_decoder, tvb, offset, tlv_len, "CMAC Tuple");
wimax_cmac_tuple_decoder(tlv_tree, tvb, offset+tlv_value_offset, tlv_len);
break;
default:
add_tlv_subtree(&tlv_info, dsd_tree, hf_dsd_unknown_type, tvb, offset, ENC_NA);
break;
}
offset += (tlv_len+tlv_value_offset);
} /* end of while loop */
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_dsd(void)
{
/* DSx display */
static hf_register_info hf[] =
{
{
&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
}
},
{
&hf_dsd_invalid_tlv,
{
"Invalid TLV", "wmx.dsd.invalid_tlv",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_dsd_unknown_type,
{
"Unknown type", "wmx.dsd.unknown_type",
FT_BYTES, BASE_NONE, 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_register_protocol (
"WiMax DSD Messages", /* name */
"WiMax DSD", /* short name */
"wmx.dsd" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_dsd_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
dsd_req_handle = register_dissector("mac_mgmt_msg_dsd_req_handler", dissect_mac_mgmt_msg_dsd_req_decoder, proto_mac_mgmt_msg_dsd_decoder);
dsd_rsp_handle = register_dissector("mac_mgmt_msg_dsd_rsp_handler", dissect_mac_mgmt_msg_dsd_rsp_decoder, proto_mac_mgmt_msg_dsd_decoder);
}
void
proto_reg_handoff_mac_mgmt_msg_dsd(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DSD_REQ, dsd_req_handle);
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DSD_RSP, dsd_rsp_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_dsx_rvd.c | /* msg_dsx_rvd.c
* WiMax MAC Management DSX-RVD Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_mac.h"
void proto_register_mac_mgmt_msg_dsx_rvd(void);
void proto_reg_handoff_mac_mgmt_msg_dsx_rvd(void);
static dissector_handle_t dsx_rvd_handle;
static gint proto_mac_mgmt_msg_dsx_rvd_decoder = -1;
static gint ett_mac_mgmt_msg_dsx_rvd_decoder = -1;
/* fix fields */
static gint hf_dsx_rvd_transaction_id = -1;
static gint hf_dsx_rvd_confirmation_code = -1;
/* Decode DSX-RVD messages. */
static int dissect_mac_mgmt_msg_dsx_rvd_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *dsx_rvd_item;
proto_tree *dsx_rvd_tree;
{ /* we are being asked for details */
/* display MAC message type */
dsx_rvd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsx_rvd_decoder, tvb, offset, -1, "DSx Received (DSX-RVD)");
/* add MAC DSx subtree */
dsx_rvd_tree = proto_item_add_subtree(dsx_rvd_item, ett_mac_mgmt_msg_dsx_rvd_decoder);
/* display the Transaction ID */
proto_tree_add_item(dsx_rvd_tree, hf_dsx_rvd_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
/* move to next field */
offset += 2;
/* display the Confirmation Code */
proto_tree_add_item(dsx_rvd_tree, hf_dsx_rvd_confirmation_code, tvb, offset, 1, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
/* 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_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_rvd)", /* short name */
"wmx.dsx_rvd" /* 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));
dsx_rvd_handle = register_dissector("mac_mgmt_msg_dsx_rvd_handler", dissect_mac_mgmt_msg_dsx_rvd_decoder, proto_mac_mgmt_msg_dsx_rvd_decoder);
}
void
proto_reg_handoff_mac_mgmt_msg_dsx_rvd(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DSX_RVD, dsx_rvd_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_fpc.c | /* msg_fpc.c
* WiMax MAC Management FPC Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: John R. Underwood <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_mac.h"
void proto_register_mac_mgmt_msg_fpc(void);
void proto_reg_handoff_mac_mgmt_msg_fpc(void);
static dissector_handle_t fpc_handle;
static gint proto_mac_mgmt_msg_fpc_decoder = -1;
static gint ett_mac_mgmt_msg_fpc_decoder = -1;
/* FPC fields */
static gint hf_fpc_number_of_stations = -1;
static gint hf_fpc_basic_cid = -1;
static gint hf_fpc_power_adjust = -1;
static gint hf_fpc_power_measurement_frame = -1;
/* static gint hf_fpc_invalid_tlv = -1; */
/* Decode FPC messages. */
static int dissect_mac_mgmt_msg_fpc_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint i;
guint number_stations;
guint tvb_len;
proto_item *fpc_item;
proto_tree *fpc_tree;
gint8 value;
gfloat power_change;
{ /* we are being asked for details */
/* Get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* display MAC payload type FPC */
fpc_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_fpc_decoder, tvb, 0, -1, "MAC Management Message, FPC");
/* add MAC FPC subtree */
fpc_tree = proto_item_add_subtree(fpc_item, ett_mac_mgmt_msg_fpc_decoder);
/* display the Number of stations */
proto_tree_add_item(fpc_tree, hf_fpc_number_of_stations, tvb, offset, 1, ENC_BIG_ENDIAN);
number_stations = tvb_get_guint8(tvb, offset);
offset++;
for (i = 0; ((i < number_stations) && (offset >= tvb_len)); i++ ) {
/* display the Basic CID*/
proto_tree_add_item(fpc_tree, hf_fpc_basic_cid, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* display the Power adjust value */
value = tvb_get_gint8(tvb, offset);
power_change = (float)0.25 * value; /* 0.25dB incr */
/* display the Power adjust value in dB */
proto_tree_add_float_format_value(fpc_tree, hf_fpc_power_adjust, tvb, offset, 1, power_change, " %.2f dB", power_change);
offset++;
/* display the Power measurement frame */
proto_tree_add_item(fpc_tree, hf_fpc_power_measurement_frame, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
}
}
return tvb_captured_length(tvb);
}
/* 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_basic_cid,
{
"Basic CID", "wmx.fpc.basic_cid",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
#if 0
{
&hf_fpc_invalid_tlv,
{
"Invalid TLV", "wmx.fpc.invalid_tlv",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
}
},
#endif
{
&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", "wmx.fpc.power_adjust",
FT_FLOAT, BASE_NONE, NULL, 0x0, "Signed change in power level (incr of 0.25dB) that the SS shall apply to its current power setting", HFILL
}
},
{
&hf_fpc_power_measurement_frame,
{
"Power measurement frame", "wmx.fpc.power_measurement_frame",
FT_INT8, BASE_DEC, NULL, 0x0, "The 8 LSB of the frame number in which the BS measured the power corrections referred to in the message", 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));
fpc_handle = register_dissector("mac_mgmt_msg_fpc_handler", dissect_mac_mgmt_msg_fpc_decoder, proto_mac_mgmt_msg_fpc_decoder);
}
void
proto_reg_handoff_mac_mgmt_msg_fpc(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_FPC, fpc_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_pkm.c | /* msg_pkm.c
* WiMax MAC Management PKM-REQ/RSP Messages decoders
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#if 0
#define DEBUG /* for debug only */
#endif
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
void proto_register_mac_mgmt_msg_pkm(void);
void proto_reg_handoff_mac_mgmt_msg_pkm(void);
static dissector_handle_t mac_mgmt_msg_pkm_req_handle;
static dissector_handle_t mac_mgmt_msg_pkm_rsp_handle;
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;
static const value_string vals_pkm_msg_code[] =
{
{ 3, "SA ADD"},
{ 4, "Auth Request"},
{ 5, "Auth Reply"},
{ 6, "Auth Reject"},
{ 7, "Key Request"},
{ 8, "Key Reply"},
{ 9, "Key Reject"},
{10, "Auth Invalid"},
{11, "TEK Invalid"},
{12, "Auth Info"},
{13, "PKMv2 RSA-Request"},
{14, "PKMv2 RSA-Reply"},
{15, "PKMv2 RSA-Reject"},
{16, "PKMv2 RSA-Acknowledgement"},
{17, "PKMv2 EAP Start"},
{18, "PKMv2 EAP-Transfer"},
{19, "PKMv2 Authenticated EAP-Transfer"},
{20, "PKMv2 SA TEK Challenge"},
{21, "PKMv2 SA TEK Request"},
{22, "PKMv2 SA TEK Response"},
{23, "PKMv2 Key-Request"},
{24, "PKMv2 Key-Reply"},
{25, "PKMv2 Key-Reject"},
{26, "PKMv2 SA-Addition"},
{27, "PKMv2 TEK-Invalid"},
{28, "PKMv2 Group-Key-Update-Command"},
{29, "PKMv2 EAP Complete"},
{30, "PKMv2 Authenticated EAP Start"},
{ 0, NULL}
};
/* fix fields */
static gint hf_pkm_msg_code = -1;
static gint hf_pkm_msg_pkm_id = -1;
/* Wimax Mac PKM-REQ Message Dissector */
static int dissect_mac_mgmt_msg_pkm_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *pkm_item;
proto_tree *pkm_tree;
/* display MAC payload type PKM-REQ */
pkm_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_pkm_decoder, tvb, offset, -1, "Privacy Key Management Request (PKM-REQ)");
/* add MAC PKM subtree */
pkm_tree = proto_item_add_subtree(pkm_item, ett_mac_mgmt_msg_pkm_req_decoder);
/* Decode and display the Privacy Key Management Request Message (PKM-REQ) (table 24) */
/* display the PKM Code */
proto_tree_add_item(pkm_tree, hf_pkm_msg_code, tvb, offset, 1, ENC_BIG_ENDIAN);
/* set the offset for the PKM ID */
offset++;
/* display the PKM ID */
proto_tree_add_item(pkm_tree, hf_pkm_msg_pkm_id, tvb, offset, 1, ENC_BIG_ENDIAN);
/* set the offset for the TLV Encoded info */
offset++;
wimax_pkm_tlv_encoded_attributes_decoder(tvb_new_subset_remaining(tvb, offset), pinfo, pkm_tree);
return tvb_captured_length(tvb);
}
/* Wimax Mac PKM-RSP Message Dissector */
static int dissect_mac_mgmt_msg_pkm_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *pkm_item;
proto_tree *pkm_tree;
/* display MAC payload type PKM-RSP */
pkm_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_pkm_decoder, tvb, offset, -1, "Privacy Key Management Response (PKM-RSP)");
/* add MAC PKM subtree */
pkm_tree = proto_item_add_subtree(pkm_item, ett_mac_mgmt_msg_pkm_rsp_decoder);
/* Decode and display the Privacy Key Management Response (PKM-RSP) (table 25) */
/* display the PKM Code */
proto_tree_add_item(pkm_tree, hf_pkm_msg_code, tvb, offset, 1, ENC_BIG_ENDIAN);
/* set the offset for the PKM ID */
offset++;
/* display the PKM ID */
proto_tree_add_item(pkm_tree, hf_pkm_msg_pkm_id, tvb, offset, 1, ENC_BIG_ENDIAN);
/* set the offset for the TLV Encoded info */
offset++;
/* process the PKM TLV Encoded Attributes */
wimax_pkm_tlv_encoded_attributes_decoder(tvb_new_subset_remaining(tvb, offset), pinfo, pkm_tree);
return tvb_captured_length(tvb);
}
/* 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}
},
};
/* 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));
mac_mgmt_msg_pkm_req_handle = register_dissector("mac_mgmt_msg_pkm_req_handler", dissect_mac_mgmt_msg_pkm_req_decoder, proto_mac_mgmt_msg_pkm_decoder);
mac_mgmt_msg_pkm_rsp_handle = register_dissector("mac_mgmt_msg_pkm_rsp_handler", dissect_mac_mgmt_msg_pkm_rsp_decoder, proto_mac_mgmt_msg_pkm_decoder);
}
void proto_reg_handoff_mac_mgmt_msg_pkm(void)
{
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_PKM_REQ, mac_mgmt_msg_pkm_req_handle );
dissector_add_uint( "wmx.mgmtmsg", MAC_MGMT_MSG_PKM_RSP, mac_mgmt_msg_pkm_rsp_handle );
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_pmc.c | /* msg_pmc.c
* WiMax MAC Management PMC-REQ, PMC-RSP Message decoders
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: John R. Underwood <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_mac.h"
extern gboolean include_cor2_changes;
void proto_register_mac_mgmt_msg_pmc_req(void);
void proto_register_mac_mgmt_msg_pmc_rsp(void);
void proto_reg_handoff_mac_mgmt_msg_pmc(void);
static int dissect_mac_mgmt_msg_pmc_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
static int dissect_mac_mgmt_msg_pmc_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
static dissector_handle_t pmc_req_handle;
static dissector_handle_t pmc_rsp_handle;
static gint proto_mac_mgmt_msg_pmc_req_decoder = -1;
static gint proto_mac_mgmt_msg_pmc_rsp_decoder = -1;
static gint ett_mac_mgmt_msg_pmc_decoder = -1;
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_mgmt_msg_pmc_decoder,
};
/* PMC fields */
static gint hf_pmc_req_pwr_control_mode_change = -1;
static gint hf_pmc_req_pwr_control_mode_change_cor2 = -1;
static gint hf_pmc_req_tx_power_level = -1;
static gint hf_pmc_req_confirmation = -1;
static gint hf_pmc_req_reserved = -1;
static gint hf_pmc_rsp_start_frame = -1;
static gint hf_pmc_rsp_power_adjust = -1;
static gint hf_pmc_rsp_offset_BS_per_MS = -1;
/* STRING RESOURCES */
static const value_string vals_pmc_req_pwr[] = {
{0, "Closed loop power control mode"},
{1, "Reserved"},
{2, "Open loop power control passive mode"},
{3, "Open loop power control active mode"},
{0, NULL}
};
static const value_string vals_pmc_req_pwr_cor2[] = {
{0, "Closed loop power control mode"},
{1, "Open loop power control passive mode with Offset_SSperSS retention"},
{2, "Open loop power control passive mode with Offset_SSperSS reset"},
{3, "Open loop power control active mode"},
{0, NULL}
};
static const value_string vals_pmc_req_confirmation[] = {
{0, "MS requests to change the power control mode"},
{1, "MS confirms the receipt of PMC_RSP from BS"},
{0, NULL}
};
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_pmc_req(void)
{
/* PMC fields display */
static hf_register_info hf[] =
{
{
&hf_pmc_req_confirmation,
{
"Confirmation", "wmx.pmc_req.confirmation",
FT_UINT16, BASE_DEC, VALS(vals_pmc_req_confirmation), 0x0020, NULL, HFILL
}
},
{
&hf_pmc_req_pwr_control_mode_change,
{
"Power control mode change", "wmx.pmc_req.power_control_mode",
FT_UINT16, BASE_DEC, VALS(vals_pmc_req_pwr), 0xC000, NULL, HFILL
}
},
{
&hf_pmc_req_pwr_control_mode_change_cor2,
{
"Power control mode change", "wmx.pmc_req.power_control_mode",
FT_UINT16, BASE_DEC, VALS(vals_pmc_req_pwr_cor2), 0xC000, NULL, HFILL
}
},
{
&hf_pmc_req_reserved,
{
"Reserved", "wmx.pmc_req.reserved",
FT_UINT16, BASE_DEC, NULL, 0x001F, NULL, HFILL
}
},
{
&hf_pmc_req_tx_power_level,
{
"UL Tx power level for the burst that carries this header", "wmx.pmc_req.ul_tx_power_level",
FT_UINT16, BASE_DEC, NULL, 0x3FC0, "When the Tx power is different from slot to slot, the maximum value is reported", HFILL
}
},
{
&hf_pmc_rsp_offset_BS_per_MS,
{
"Offset_BS per MS", "wmx.pmc_rsp.offset_BS_per_MS",
FT_FLOAT, BASE_NONE, NULL, 0x0, "Signed change in power level (incr of 0.25 dB) that the MS shall apply to the open loop power control formula in 8.4.10.3.2", HFILL
}
},
{
&hf_pmc_rsp_power_adjust,
{
"Power adjust", "wmx.pmc_rsp.power_adjust",
FT_FLOAT, BASE_NONE, NULL, 0x0, "Signed change in power level (incr of 0.25 dB) that the MS shall apply to its current transmission power. When subchannelization is employed, the SS shall interpret as a required change to the Tx power density", HFILL
}
},
{
&hf_pmc_rsp_start_frame,
{
"Start frame", "wmx.pmc_rsp.start_frame",
FT_UINT16, BASE_HEX, NULL, 0x3F00, "Apply mode change from current frame when 6 LSBs of frame match this", HFILL
}
}
};
proto_mac_mgmt_msg_pmc_req_decoder = proto_register_protocol (
"WiMax PMC-REQ Messages", /* name */
"WiMax PMC-REQ", /* short name */
"wmx.pmc_req" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_pmc_req_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
pmc_req_handle = register_dissector("mac_mgmt_msg_pmc_req_handler", dissect_mac_mgmt_msg_pmc_req_decoder, proto_mac_mgmt_msg_pmc_req_decoder);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_pmc_rsp(void)
{
proto_mac_mgmt_msg_pmc_rsp_decoder = proto_register_protocol (
"WiMax PMC-RSP Messages", /* name */
"WiMax PMC-RSP", /* short name */
"wmx.pmc_rsp" /* abbrev */
);
pmc_rsp_handle = register_dissector("mac_mgmt_msg_pmc_rsp_handler", dissect_mac_mgmt_msg_pmc_rsp_decoder, proto_mac_mgmt_msg_pmc_rsp_decoder);
}
/* Decode PMC-REQ messages. */
static int dissect_mac_mgmt_msg_pmc_req_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *pmc_req_item;
proto_tree *pmc_req_tree;
{ /* we are being asked for details */
/* display MAC payload type PMC-REQ */
pmc_req_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_pmc_req_decoder, tvb, 0, -1, "MAC Management Message, PMC-REQ");
/* add MAC PMC REQ subtree */
pmc_req_tree = proto_item_add_subtree(pmc_req_item, ett_mac_mgmt_msg_pmc_decoder);
/* display the Power Control Mode Change */
proto_tree_add_item(pmc_req_tree, hf_pmc_req_pwr_control_mode_change, tvb, offset, 2, ENC_BIG_ENDIAN);
/* show the Transmit Power Level */
proto_tree_add_item(pmc_req_tree, hf_pmc_req_tx_power_level, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the Confirmation/request */
proto_tree_add_item(pmc_req_tree, hf_pmc_req_confirmation, tvb, offset, 2, ENC_BIG_ENDIAN);
/* show the Reserved bits */
proto_tree_add_item(pmc_req_tree, hf_pmc_req_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
/* Decode PMC-RSP messages. */
static int dissect_mac_mgmt_msg_pmc_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *pmc_rsp_item;
proto_tree *pmc_rsp_tree;
guint8 pwr_control_mode;
gint8 value;
gfloat power_change;
{ /* we are being asked for details */
/* display MAC payload type PMC-RSP */
pmc_rsp_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_pmc_rsp_decoder, tvb, 0, -1, "MAC Management Message, PMC-RSP");
/* add MAC PMC RSP subtree */
pmc_rsp_tree = proto_item_add_subtree(pmc_rsp_item, ett_mac_mgmt_msg_pmc_decoder);
/* display the Power Control Mode Change */
if (include_cor2_changes)
proto_tree_add_item(pmc_rsp_tree, hf_pmc_req_pwr_control_mode_change_cor2, tvb, offset, 2, ENC_BIG_ENDIAN);
else
proto_tree_add_item(pmc_rsp_tree, hf_pmc_req_pwr_control_mode_change, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the Power Adjust start frame */
proto_tree_add_item(pmc_rsp_tree, hf_pmc_rsp_start_frame, tvb, offset, 2, ENC_BIG_ENDIAN);
pwr_control_mode = 0xC0 & tvb_get_guint8(tvb, offset);
offset++;
value = tvb_get_gint8(tvb, offset);
power_change = (float)0.25 * value; /* 0.25dB incr */
/* Check if Power Control Mode is 0 */
if (pwr_control_mode == 0) {
/* display the amount of power change requested */
proto_tree_add_float_format_value(pmc_rsp_tree, hf_pmc_rsp_power_adjust, tvb, offset, 1, power_change, " %.2f dB", power_change);
} else {
/* display the amount of MS power change requested */
proto_tree_add_float_format_value(pmc_rsp_tree, hf_pmc_rsp_offset_BS_per_MS, tvb, offset, 1, power_change, " %.2f dB", power_change);
}
}
return tvb_captured_length(tvb);
}
void
proto_reg_handoff_mac_mgmt_msg_pmc(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_PMC_REQ, pmc_req_handle);
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_PMC_RSP, pmc_rsp_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_prc_lt_ctrl.c | /* msg_prc_lt_ctrl.c
* WiMax MAC Management PRC-LT-CTRL Message decoders
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: John R. Underwood <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_mac.h"
void proto_register_mac_mgmt_msg_prc_lt_ctrl(void);
void proto_reg_handoff_mac_mgmt_msg_prc_lt_ctrl(void);
static dissector_handle_t prc_handle;
static gint proto_mac_mgmt_msg_prc_lt_ctrl_decoder = -1;
static gint ett_mac_mgmt_msg_prc_lt_ctrl_decoder = -1;
/* PRC-LT-CTRL fields */
static gint hf_prc_lt_ctrl_precoding = -1;
static gint hf_prc_lt_ctrl_precoding_delay = -1;
/* static gint hf_prc_lt_ctrl_invalid_tlv = -1; */
static const value_string vals_turn_on[] = {
{0, "Turn off"},
{1, "Turn on"},
{0, NULL}
};
/* Decode PRC-LT-CTRL messages. */
static int dissect_mac_mgmt_msg_prc_lt_ctrl_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
guint offset = 0;
proto_item *prc_lt_ctrl_item;
proto_tree *prc_lt_ctrl_tree;
{ /* we are being asked for details */
/* 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, -1, "MAC Management Message, PRC-LT-CTRL");
/* 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 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, ENC_BIG_ENDIAN);
/* display the Precoding Delay */
proto_tree_add_item(prc_lt_ctrl_tree, hf_prc_lt_ctrl_precoding_delay, tvb, offset, 1, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_prc_lt_ctrl(void)
{
/* PRC-LT-CTRL fields display */
static hf_register_info hf[] =
{
#if 0
{
&hf_prc_lt_ctrl_invalid_tlv,
{
"Invalid TLV", "wmx.prc_lt_ctrl.invalid_tlv",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
}
},
#endif
{
&hf_prc_lt_ctrl_precoding,
{
"Setup/Tear-down long-term precoding with feedback",
"wmx.prc_lt_ctrl.precoding",
FT_UINT8, BASE_DEC, VALS(vals_turn_on), 0x80, NULL, HFILL
}
},
{
&hf_prc_lt_ctrl_precoding_delay,
{
"BS precoding application delay",
"wmx.prc_lt_ctrl.precoding_delay",
FT_UINT8, BASE_DEC, NULL, 0x60, NULL, HFILL
}
}
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_mgmt_msg_prc_lt_ctrl_decoder,
};
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_lt_ctrl" /* 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));
prc_handle = register_dissector("mac_mgmt_msg_prc_lt_ctrl_handler", dissect_mac_mgmt_msg_prc_lt_ctrl_decoder, proto_mac_mgmt_msg_prc_lt_ctrl_decoder);
}
void
proto_reg_handoff_mac_mgmt_msg_prc_lt_ctrl(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_PRC_LT_CTRL, prc_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_reg_req.c | /* msg_reg_req.c
* WiMax MAC Management REG-REQ Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: John R. Underwood <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#define WIMAX_16E_2005
#include <epan/packet.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
extern gboolean include_cor2_changes;
void proto_register_mac_mgmt_msg_reg_req(void);
void proto_reg_handoff_mac_mgmt_msg_reg_req(void);
static dissector_handle_t reg_req_handle;
static gint proto_mac_mgmt_msg_reg_req_decoder = -1;
static gint ett_mac_mgmt_msg_reg_req_decoder = -1;
/* REG-REQ fields */
static gint hf_reg_ss_mgmt_support = -1;
static gint hf_reg_ip_mgmt_mode = -1;
static gint hf_reg_ip_version = -1;
static gint hf_reg_req_secondary_mgmt_cid = -1;
static gint hf_reg_ul_cids = -1;
static gint hf_reg_max_classifiers = -1;
static gint hf_reg_phs = -1;
static gint hf_reg_arq = -1;
static gint hf_reg_dsx_flow_control = -1;
static gint hf_reg_mac_crc_support = -1;
static gint hf_reg_mca_flow_control = -1;
static gint hf_reg_mcast_polling_cids = -1;
static gint hf_reg_num_dl_trans_cid = -1;
static gint hf_reg_mac_address = -1;
static gint hf_reg_tlv_t_20_1_max_mac_level_data_per_dl_frame = -1;
static gint hf_reg_tlv_t_20_2_max_mac_level_data_per_ul_frame = -1;
static gint hf_reg_tlv_t_21_packing_support = -1;
static gint hf_reg_tlv_t_22_mac_extended_rtps_support = -1;
static gint hf_reg_tlv_t_23_max_num_bursts_concurrently_to_the_ms = -1;
static gint hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_dhcp = -1;
static gint hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_mobile_ipv4 = -1;
static gint hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_dhcpv6 = -1;
static gint hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_ipv6 = -1;
static gint hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_rsvd = -1;
static gint hf_reg_tlv_t_27_handover_fbss_mdho_ho_disable = -1;
static gint hf_reg_tlv_t_27_handover_fbss_mdho_dl_rf_monitoring_maps = -1;
static gint hf_reg_tlv_t_27_handover_mdho_dl_monitoring_single_map = -1;
static gint hf_reg_tlv_t_27_handover_mdho_dl_monitoring_maps = -1;
static gint hf_reg_tlv_t_27_handover_mdho_ul_multiple = -1;
static gint hf_reg_tlv_t_27_handover_reserved = -1;
static gint hf_reg_tlv_t_29_ho_process_opt_ms_timer = -1;
static gint hf_reg_tlv_t_31_mobility_handover = -1;
static gint hf_reg_tlv_t_31_mobility_sleep_mode = -1;
static gint hf_reg_tlv_t_31_mobility_idle_mode = -1;
static gint hf_reg_req_tlv_t_32_sleep_mode_recovery_time = -1;
static gint hf_ms_previous_ip_address_v4 = -1;
static gint hf_ms_previous_ip_address_v6 = -1;
static gint hf_idle_mode_timeout = -1;
static gint hf_reg_req_tlv_t_45_ms_periodic_ranging_timer = -1;
static gint hf_reg_tlv_t_40_arq_ack_type_selective_ack_entry = -1;
static gint hf_reg_tlv_t_40_arq_ack_type_cumulative_ack_entry = -1;
static gint hf_reg_tlv_t_40_arq_ack_type_cumulative_with_selective_ack_entry = -1;
static gint hf_reg_tlv_t_40_arq_ack_type_cumulative_ack_with_block_sequence_ack = -1;
static gint hf_reg_tlv_t_40_arq_ack_type_reserved = -1;
static gint hf_reg_tlv_t_41_ho_connections_param_processing_time = -1;
static gint hf_reg_tlv_t_42_ho_tek_processing_time = -1;
static gint hf_reg_tlv_t_43_bandwidth_request_ul_tx_power_report_header_support = -1;
static gint hf_reg_tlv_t_43_bandwidth_request_cinr_report_header_support = -1;
static gint hf_reg_tlv_t_43_cqich_allocation_request_header_support = -1;
static gint hf_reg_tlv_t_43_phy_channel_report_header_support = -1;
static gint hf_reg_tlv_t_43_bandwidth_request_ul_sleep_control_header_support = -1;
static gint hf_reg_tlv_t_43_sn_report_header_support = -1;
static gint hf_reg_tlv_t_43_feedback_header_support = -1;
static gint hf_reg_tlv_t_43_sdu_sn_extended_subheader_support_and_parameter = -1;
static gint hf_reg_tlv_t_43_sdu_sn_parameter = -1;
static gint hf_reg_tlv_t_43_dl_sleep_control_extended_subheader = -1;
static gint hf_reg_tlv_t_43_feedback_request_extended_subheader = -1;
static gint hf_reg_tlv_t_43_mimo_mode_feedback_extended_subheader = -1;
static gint hf_reg_tlv_t_43_ul_tx_power_report_extended_subheader = -1;
static gint hf_reg_tlv_t_43_mini_feedback_extended_subheader = -1;
static gint hf_reg_tlv_t_43_sn_request_extended_subheader = -1;
static gint hf_reg_tlv_t_43_pdu_sn_short_extended_subheader = -1;
static gint hf_reg_tlv_t_43_pdu_sn_long_extended_subheader = -1;
static gint hf_reg_tlv_t_43_reserved = -1;
static gint hf_reg_tlv_t_46_handover_indication_readiness_timer = -1;
static gint hf_reg_req_min_time_for_intra_fa = -1;
static gint hf_reg_req_min_time_for_inter_fa = -1;
static gint hf_reg_encap_atm_4 = -1;
static gint hf_reg_encap_ipv4_4 = -1;
static gint hf_reg_encap_ipv6_4 = -1;
static gint hf_reg_encap_802_3_4 = -1;
static gint hf_reg_encap_802_1q_4 = -1;
static gint hf_reg_encap_ipv4_802_3_4 = -1;
static gint hf_reg_encap_ipv6_802_3_4 = -1;
static gint hf_reg_encap_ipv4_802_1q_4 = -1;
static gint hf_reg_encap_ipv6_802_1q_4 = -1;
static gint hf_reg_encap_packet_8023_ethernet_and_rohc_header_compression_4 = -1;
static gint hf_reg_encap_packet_8023_ethernet_and_ecrtp_header_compression_4 = -1;
static gint hf_reg_encap_packet_ip_rohc_header_compression_4 = -1;
static gint hf_reg_encap_packet_ip_ecrtp_header_compression_4 = -1;
static gint hf_reg_encap_rsvd_4 = -1;
static gint hf_reg_encap_atm_2 = -1;
static gint hf_reg_encap_ipv4_2 = -1;
static gint hf_reg_encap_ipv6_2 = -1;
static gint hf_reg_encap_802_3_2 = -1;
static gint hf_reg_encap_802_1q_2 = -1;
static gint hf_reg_encap_ipv4_802_3_2 = -1;
static gint hf_reg_encap_ipv6_802_3_2 = -1;
static gint hf_reg_encap_ipv4_802_1q_2 = -1;
static gint hf_reg_encap_ipv6_802_1q_2 = -1;
static gint hf_reg_encap_packet_8023_ethernet_and_rohc_header_compression_2 = -1;
static gint hf_reg_encap_packet_8023_ethernet_and_ecrtp_header_compression_2 = -1;
static gint hf_reg_encap_packet_ip_rohc_header_compression_2 = -1;
static gint hf_reg_encap_packet_ip_ecrtp_header_compression_2 = -1;
static gint hf_reg_encap_rsvd_2 = -1;
static gint hf_tlv_type = -1;
static gint hf_reg_invalid_tlv = -1;
static gint hf_reg_power_saving_class_type_i = -1;
static gint hf_reg_power_saving_class_type_ii = -1;
static gint hf_reg_power_saving_class_type_iii = -1;
static gint hf_reg_multi_active_power_saving_classes = -1;
static gint hf_reg_total_power_saving_class_instances = -1;
static gint hf_reg_power_saving_class_reserved = -1;
static gint hf_reg_power_saving_class_capability = -1;
static gint hf_reg_ip_phs_sdu_encap = -1;
static gint hf_reg_tlv_t_26_method_alloc_ip_addr_secondary_mgmnt_conn = -1;
static gint hf_reg_tlv_t_27_handover_supported = -1;
static gint hf_reg_tlv_t_31_mobility_features_supported = -1;
static gint hf_reg_tlv_t_40_arq_ack_type = -1;
static gint hf_reg_tlv_t_43_mac_header_ext_header_support = -1;
static gint hf_reg_req_bs_switching_timer = -1;
/* STRING RESOURCES */
static const true_false_string tfs_reg_ip_mgmt_mode = {
"IP-managed mode",
"Unmanaged mode"
};
static const true_false_string tfs_reg_ss_mgmt_support = {
"secondary management connection",
"no secondary management connection"
};
#if 0
static const true_false_string tfs_arq_enable = {
"ARQ Requested/Accepted",
"ARQ Not Requested/Accepted"
};
#endif
#if 0
static const true_false_string tfs_arq_deliver_in_order = {
"Order of delivery is preserved",
"Order of delivery is not preserved"
};
#endif
static const true_false_string tfs_reg_fbss_mdho_ho_disable = {
"Disable",
"Enable"
};
static const value_string vals_reg_ip_version[] = {
{0x1, "IPv4"},
{0x2, "IPV6"},
{0, NULL}
};
static const value_string vals_reg_phs_support[] = {
{0, "no PHS support"},
{1, "ATM PHS"},
{2, "Packet PHS"},
{3, "ATM and Packet PHS"},
{0, NULL}
};
static const true_false_string tfs_supported = {
"supported",
"unsupported"
};
static const true_false_string tfs_mac_crc_support = {
"MAC CRC Support (Default)",
"No MAC CRC Support"
};
static const value_string tfs_support[] = {
{0, "not supported"},
{1, "supported"},
{0, NULL}
};
static const value_string unique_no_limit[] = {
{0, "no limit"},
{0, NULL}
};
/* Decode REG-REQ sub-TLV's. */
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)
{
proto_item *tlv_item;
proto_tree *tlv_tree;
guint tvb_len;
tlv_info_t tlv_info;
guint tlv_end;
guint length;
guint nblocks;
/* Get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* get the TLV information */
init_tlv_info(&tlv_info, tvb, offset);
#ifdef WIMAX_16E_2005
switch (tlv_type) {
case REG_ARQ_PARAMETERS:
/* display ARQ Service Flow Encodings info */
/* add subtree */
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, proto_registry, tvb, offset, tlv_len, "ARQ Service Flow Encodings");
/* decode and display the DL Service Flow Encodings */
wimax_service_flow_encodings_decoder(tvb_new_subset_length(tvb, tlv_offset, tlv_len), pinfo, tlv_tree);
break;
case REG_SS_MGMT_SUPPORT:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_ss_mgmt_support, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_IP_MGMT_MODE:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_ip_mgmt_mode, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_IP_VERSION:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_ip_version, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_UL_TRANSPORT_CIDS_SUPPORTED:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_ul_cids, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_POWER_SAVING_CLASS_CAPABILITY:
tlv_item = add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_power_saving_class_capability, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_reg_req_decoder);
proto_tree_add_item(tlv_tree, hf_reg_power_saving_class_type_i, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_power_saving_class_type_ii, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_power_saving_class_type_iii, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_multi_active_power_saving_classes, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_total_power_saving_class_instances, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_power_saving_class_reserved, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
break;
case REG_IP_PHS_SDU_ENCAP:
tlv_item = add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_ip_phs_sdu_encap, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_reg_req_decoder);
#ifdef WIMAX_16E_2005
if (tlv_len == 2){
proto_tree_add_item(tlv_tree, hf_reg_encap_atm_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_ipv4_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_ipv6_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_802_3_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_802_1q_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_ipv4_802_3_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_ipv6_802_3_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_ipv4_802_1q_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_ipv6_802_1q_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_packet_8023_ethernet_and_rohc_header_compression_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_packet_8023_ethernet_and_ecrtp_header_compression_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_packet_ip_rohc_header_compression_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_packet_ip_ecrtp_header_compression_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_rsvd_2, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
} else if(tlv_len == 4){
proto_tree_add_item(tlv_tree, hf_reg_encap_atm_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_ipv4_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_ipv6_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_802_3_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_802_1q_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_ipv4_802_3_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_ipv6_802_3_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_ipv4_802_1q_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_ipv6_802_1q_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_packet_8023_ethernet_and_rohc_header_compression_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_packet_8023_ethernet_and_ecrtp_header_compression_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_packet_ip_rohc_header_compression_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_packet_ip_ecrtp_header_compression_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_encap_rsvd_4, tvb, tlv_offset, tlv_len, ENC_BIG_ENDIAN);
}
#endif
break;
case REG_MAX_CLASSIFIERS_SUPPORTED:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_max_classifiers, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_PHS_SUPPORT:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_phs, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_ARQ_SUPPORT:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_arq, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_DSX_FLOW_CONTROL:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_dsx_flow_control, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_MAC_CRC_SUPPORT:
if (!include_cor2_changes) {
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_mac_crc_support, tvb, offset, ENC_NA);
} else {
/* Unknown TLV Type */
add_tlv_subtree(&tlv_info, reg_req_tree, hf_tlv_type, tvb, offset, ENC_NA);
}
break;
case REG_MCA_FLOW_CONTROL:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_mca_flow_control, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_MCAST_POLLING_CIDS:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_mcast_polling_cids, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_NUM_DL_TRANS_CID:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_num_dl_trans_cid, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_MAC_ADDRESS:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_mac_address, tvb, offset, ENC_NA);
break;
case REG_TLV_T_20_MAX_MAC_DATA_PER_FRAME_SUPPORT:
/* display Maximum MAC level data per frame info */
/* add subtree */
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_reg_req_decoder, reg_req_tree, proto_registry, tvb, offset, tlv_len, "Maximum MAC level data per frame");
/* decode and display Maximum MAC level data per frame for UL & DL */
/* Set endpoint of the subTLVs (tlv_offset + length) */
tlv_end = tlv_offset + tlv_len;
/* process subTLVs */
while ( tlv_offset < tlv_end )
{ /* get the TLV information */
init_tlv_info(&tlv_info, tvb, 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 */
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), ENC_NA);
break;
}
/* update the offset */
tlv_offset += get_tlv_value_offset(&tlv_info);
nblocks = tvb_get_ntohs(tvb, tlv_offset);
switch (tlv_type)
{
case REG_TLV_T_20_1_MAX_MAC_LEVEL_DATA_PER_DL_FRAME:
tlv_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_reg_tlv_t_20_1_max_mac_level_data_per_dl_frame, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
if ( nblocks == 0 )
{
proto_item_append_text(tlv_item, " (Unlimited bytes)");
} else {
proto_item_append_text(tlv_item, " (%d bytes)", 256 * nblocks);
}
break;
case REG_TLV_T_20_2_MAX_MAC_LEVEL_DATA_PER_UL_FRAME:
tlv_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_reg_tlv_t_20_2_max_mac_level_data_per_ul_frame, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
if ( nblocks == 0 )
{
proto_item_append_text(tlv_item, " (Unlimited bytes)");
} else {
proto_item_append_text(tlv_item, " (%d bytes)", 256 * nblocks);
}
break;
default:
add_tlv_subtree(&tlv_info, tlv_tree, hf_reg_invalid_tlv, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_NA);
break;
}
tlv_offset += length;
}
break;
case REG_TLV_T_21_PACKING_SUPPORT:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_tlv_t_21_packing_support, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_TLV_T_22_MAC_EXTENDED_RTPS_SUPPORT:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_tlv_t_22_mac_extended_rtps_support, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_TLV_T_23_MAX_NUM_BURSTS_TRANSMITTED_CONCURRENTLY_TO_THE_MS:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_tlv_t_23_max_num_bursts_concurrently_to_the_ms, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_TLV_T_26_METHOD_FOR_ALLOCATING_IP_ADDR_SECONDARY_MGMNT_CONNECTION:
tlv_item = add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_tlv_t_26_method_alloc_ip_addr_secondary_mgmnt_conn, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_reg_req_decoder);
proto_tree_add_item(tlv_tree, hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_dhcp, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_mobile_ipv4, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_dhcpv6, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_ipv6, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_rsvd, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case REG_TLV_T_27_HANDOVER_SUPPORTED:
tlv_item = add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_tlv_t_27_handover_supported, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_reg_req_decoder);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_27_handover_fbss_mdho_ho_disable, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_27_handover_fbss_mdho_dl_rf_monitoring_maps, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_27_handover_mdho_dl_monitoring_single_map, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_27_handover_mdho_dl_monitoring_maps, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_27_handover_mdho_ul_multiple, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_27_handover_reserved, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case REG_TLV_T_29_HO_PROCESS_OPTIMIZATION_MS_TIMER:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_tlv_t_29_ho_process_opt_ms_timer, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_TLV_T_31_MOBILITY_FEATURES_SUPPORTED:
tlv_item = add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_tlv_t_31_mobility_features_supported, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_reg_req_decoder);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_31_mobility_handover, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_31_mobility_sleep_mode, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_31_mobility_idle_mode, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case REG_TLV_T_40_ARQ_ACK_TYPE:
tlv_item = add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_tlv_t_40_arq_ack_type, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_reg_req_decoder);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_40_arq_ack_type_selective_ack_entry, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_40_arq_ack_type_cumulative_ack_entry, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_40_arq_ack_type_cumulative_with_selective_ack_entry, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_40_arq_ack_type_cumulative_ack_with_block_sequence_ack, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_40_arq_ack_type_reserved, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case REG_TLV_T_41_MS_HO_CONNECTIONS_PARAM_PROCESSING_TIME:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_tlv_t_41_ho_connections_param_processing_time, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_TLV_T_42_MS_HO_TEK_PROCESSING_TIME:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_tlv_t_42_ho_tek_processing_time, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_TLV_T_43_MAC_HEADER_AND_EXTENDED_SUBHEADER_SUPPORT:
tlv_item = add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_tlv_t_43_mac_header_ext_header_support, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_reg_req_decoder);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_bandwidth_request_ul_tx_power_report_header_support, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_bandwidth_request_cinr_report_header_support, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_cqich_allocation_request_header_support, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_phy_channel_report_header_support, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_bandwidth_request_ul_sleep_control_header_support, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_sn_report_header_support, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_feedback_header_support, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_sdu_sn_extended_subheader_support_and_parameter, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_sdu_sn_parameter, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_dl_sleep_control_extended_subheader, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_feedback_request_extended_subheader, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_mimo_mode_feedback_extended_subheader, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_ul_tx_power_report_extended_subheader, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_mini_feedback_extended_subheader, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_sn_request_extended_subheader, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_pdu_sn_short_extended_subheader, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_pdu_sn_long_extended_subheader, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_tlv_t_43_reserved, tvb, tlv_offset, 3, ENC_BIG_ENDIAN);
break;
case REG_REQ_BS_SWITCHING_TIMER:
tlv_item = add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_req_bs_switching_timer, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_reg_req_decoder);
proto_tree_add_item(tlv_tree, hf_reg_req_min_time_for_intra_fa, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_reg_req_min_time_for_inter_fa, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case VENDOR_SPECIFIC_INFO:
case VENDOR_ID_ENCODING:
case CURRENT_TX_POWER:
case MAC_VERSION_ENCODING:
case CMAC_TUPLE: /* Table 348b */
wimax_common_tlv_encoding_decoder(tvb_new_subset_remaining(tvb, offset), pinfo, reg_req_tree);
break;
default:
add_tlv_subtree(&tlv_info, reg_req_tree, proto_registry, tvb, offset, ENC_NA);
break;
}
#endif
}
/* Decode REG-REQ messages. */
static int dissect_mac_mgmt_msg_reg_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tlv_offset;
guint tvb_len;
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;
{ /* 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");
/* add MAC REG-REQ subtree */
reg_req_tree = proto_item_add_subtree(reg_req_item, ett_mac_mgmt_msg_reg_req_decoder);
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 */
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), ENC_NA);
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:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_req_secondary_mgmt_cid, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_REQ_TLV_T_32_SLEEP_MODE_RECOVERY_TIME:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_req_tlv_t_32_sleep_mode_recovery_time, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_REQ_TLV_T_33_MS_PREV_IP_ADDR:
if ( tlv_len == 4 ) {
add_tlv_subtree(&tlv_info, reg_req_tree, hf_ms_previous_ip_address_v4, tvb, offset, ENC_BIG_ENDIAN);
} else if ( tlv_len == 16 ) {
add_tlv_subtree(&tlv_info, reg_req_tree, hf_ms_previous_ip_address_v6, tvb, offset, ENC_NA);
}
break;
case REG_TLV_T_37_IDLE_MODE_TIMEOUT:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_idle_mode_timeout, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_REQ_TLV_T_45_MS_PERIODIC_RANGING_TIMER_INFO:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_req_tlv_t_45_ms_periodic_ranging_timer, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_HANDOVER_INDICATION_READINESS_TIMER:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_reg_tlv_t_46_handover_indication_readiness_timer, tvb, offset, ENC_BIG_ENDIAN);
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, offset, tlv_len, "Uplink Service Flow Encodings");
/* decode and display the DL Service Flow Encodings */
wimax_service_flow_encodings_decoder(tvb_new_subset_length(tvb, tlv_offset, 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, offset, tlv_len, "Downlink Service Flow Encodings");
/* decode and display the DL Service Flow Encodings */
wimax_service_flow_encodings_decoder(tvb_new_subset_length(tvb, tlv_offset, 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, offset, tlv_len, "HMAC Tuple");
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, offset, tlv_len, "CMAC Tuple");
wimax_cmac_tuple_decoder(tlv_tree, tvb, tlv_offset, tlv_len);
break;
default:
add_tlv_subtree(&tlv_info, reg_req_tree, hf_tlv_type, tvb, offset, ENC_NA);
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 !)");
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_reg_req(void)
{
/* REG-REQ fields display */
static hf_register_info hf[] =
{
{
&hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_dhcp,
{
"DHCP", "wmx.reg.alloc_sec_mgmt_dhcp",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x01, NULL, HFILL
}
},
{
&hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_dhcpv6,
{
"DHCPv6", "wmx.reg.alloc_sec_mgmt_dhcpv6",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x04, NULL, HFILL
}
},
{
&hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_ipv6,
{
"IPv6 Stateless Address Autoconfiguration", "wmx.reg.alloc_sec_mgmt_ipv6",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x08, NULL, HFILL
}
},
{
&hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_mobile_ipv4,
{
"Mobile IPv4", "wmx.reg.alloc_sec_mgmt_mobile_ipv4",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x02, NULL, HFILL
}
},
{
&hf_reg_method_for_allocating_ip_addr_sec_mgmt_conn_rsvd,
{
"Reserved", "wmx.reg.alloc_sec_mgmt_rsvd",
FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL
}
},
{
&hf_reg_arq,
{
"ARQ support", "wmx.reg.arq",
FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported), 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_40_arq_ack_type_cumulative_ack_entry,
{
"Cumulative ACK entry", "wmx.reg.arq_ack_type_cumulative_ack_entry",
FT_UINT8, BASE_DEC, NULL, 0x2, NULL, HFILL
}
},
{
&hf_reg_tlv_t_40_arq_ack_type_cumulative_ack_with_block_sequence_ack,
{
"Cumulative ACK with Block Sequence ACK", "wmx.reg.arq_ack_type_cumulative_ack_with_block_sequence_ack",
FT_UINT8, BASE_DEC, NULL, 0x8, NULL, HFILL
}
},
{
&hf_reg_tlv_t_40_arq_ack_type_cumulative_with_selective_ack_entry,
{
"Cumulative with Selective ACK entry", "wmx.reg.arq_ack_type_cumulative_with_selective_ack_entry",
FT_UINT8, BASE_DEC, NULL, 0x4, NULL, HFILL
}
},
{
&hf_reg_tlv_t_40_arq_ack_type_reserved,
{
"Reserved", "wmx.reg.arq_ack_type_reserved",
FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_40_arq_ack_type_selective_ack_entry,
{
"Selective ACK entry", "wmx.reg.arq_ack_type_selective_ack_entry",
FT_UINT8, BASE_DEC, NULL, 0x1, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_bandwidth_request_cinr_report_header_support,
{
"Bandwidth request and CINR report header support", "wmx.reg.bandwidth_request_cinr_report_header_support",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x2, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_bandwidth_request_ul_sleep_control_header_support,
{
"Bandwidth request and uplink sleep control header support", "wmx.reg.bandwidth_request_ul_sleep_control_header_support",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x10, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_cqich_allocation_request_header_support,
{
"CQICH Allocation Request header support", "wmx.reg.cqich_allocation_request_header_support",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x4, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_dl_sleep_control_extended_subheader,
{
"Downlink sleep control extended subheader", "wmx.reg.dl_sleep_control_extended_subheader",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x800, NULL, HFILL
}
},
{
&hf_reg_dsx_flow_control,
{
"DSx flow control", "wmx.reg.dsx_flow_control",
FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(unique_no_limit), 0x0, NULL, HFILL
}
},
/* When REG-REQ TLV 7 is length 2 */
{
&hf_reg_encap_802_1q_2,
{
"Packet, 802.1Q VLAN", "wmx.reg.encap_802_1q",
FT_UINT16, BASE_HEX, NULL, 0x0010, NULL, HFILL
}
},
{
&hf_reg_encap_802_3_2,
{
"Packet, 802.3/Ethernet", "wmx.reg.encap_802_3",
FT_UINT16, BASE_HEX, NULL, 0x00000008, NULL, HFILL
}
},
{
&hf_reg_encap_atm_2,
{
"ATM", "wmx.reg.encap_atm",
FT_UINT16, BASE_HEX, NULL, 0x00000001, NULL, HFILL
}
},
{
&hf_reg_encap_ipv4_2,
{
"Packet, IPv4", "wmx.reg.encap_ipv4",
FT_UINT16, BASE_HEX, NULL, 0x00000002, NULL, HFILL
}
},
{
&hf_reg_encap_ipv6_2,
{
"Packet, IPv6", "wmx.reg.encap_ipv6",
FT_UINT16, BASE_HEX, NULL, 0x00000004, NULL, HFILL
}
},
{
&hf_reg_encap_ipv4_802_1q_2,
{
"Packet, IPv4 over 802.1Q VLAN", "wmx.reg.encap_ipv4_802_1q",
FT_UINT16, BASE_HEX, NULL, 0x00000080, NULL, HFILL
}
},
{
&hf_reg_encap_ipv4_802_3_2,
{
"Packet, IPv4 over 802.3/Ethernet", "wmx.reg.encap_ipv4_802_3",
FT_UINT16, BASE_HEX, NULL, 0x00000020, NULL, HFILL
}
},
{
&hf_reg_encap_ipv6_802_1q_2,
{
"Packet, IPv6 over 802.1Q VLAN", "wmx.reg.encap_ipv6_802_1q",
FT_UINT16, BASE_HEX, NULL, 0x00000100, NULL, HFILL
}
},
{
&hf_reg_encap_ipv6_802_3_2,
{
"Packet, IPv6 over 802.3/Ethernet", "wmx.reg.encap_ipv6_802_3",
FT_UINT16, BASE_HEX, NULL, 0x00000040, NULL, HFILL
}
},
{
&hf_reg_encap_packet_8023_ethernet_and_ecrtp_header_compression_2,
{
"Packet, 802.3/Ethernet (with optional 802.1Q VLAN tags) and ECRTP header compression", "wmx.reg.encap_packet_802_3_ethernet_and_ecrtp_header_compression",
FT_UINT16, BASE_HEX, NULL, 0x00000400, NULL, HFILL
}
},
{
&hf_reg_encap_packet_8023_ethernet_and_rohc_header_compression_2,
{
"Packet, 802.3/Ethernet (with optional 802.1Q VLAN tags) and ROHC header compression", "wmx.reg.encap_packet_802_3_ethernet_and_rohc_header_compression",
FT_UINT16, BASE_HEX, NULL, 0x00000200, NULL, HFILL
}
},
{
&hf_reg_encap_packet_ip_ecrtp_header_compression_2,
{
"Packet, IP (v4 or v6) with ECRTP header compression", "wmx.reg.encap_packet_ip_ecrtp_header_compression",
FT_UINT16, BASE_HEX, NULL, 0x00001000, NULL, HFILL
}
},
{
&hf_reg_encap_packet_ip_rohc_header_compression_2,
{
"Packet, IP (v4 or v6) with ROHC header compression", "wmx.reg.encap_packet_ip_rohc_header_compression",
FT_UINT16, BASE_HEX, NULL, 0x00000800, NULL, HFILL
}
},
{
&hf_reg_encap_rsvd_2,
{
"Reserved", "wmx.reg.encap_rsvd",
FT_UINT16, BASE_HEX, NULL, 0x0000E000, NULL, HFILL
}
},
/* When REG-REQ TLV 7 is length 4 */
{
&hf_reg_encap_802_1q_4,
{
"Packet, 802.1Q VLAN", "wmx.reg.encap_802_1q",
FT_UINT32, BASE_HEX, NULL, 0x0010, NULL, HFILL
}
},
{
&hf_reg_encap_802_3_4,
{
"Packet, 802.3/Ethernet", "wmx.reg.encap_802_3",
FT_UINT32, BASE_HEX, NULL, 0x00000008, NULL, HFILL
}
},
{
&hf_reg_encap_atm_4,
{
"ATM", "wmx.reg.encap_atm",
FT_UINT32, BASE_HEX, NULL, 0x00000001, NULL, HFILL
}
},
{
&hf_reg_encap_ipv4_4,
{
"Packet, IPv4", "wmx.reg.encap_ipv4",
FT_UINT32, BASE_HEX, NULL, 0x00000002, NULL, HFILL
}
},
{
&hf_reg_encap_ipv4_802_1q_4,
{
"Packet, IPv4 over 802.1Q VLAN", "wmx.reg.encap_ipv4_802_1q",
FT_UINT32, BASE_HEX, NULL, 0x00000080, NULL, HFILL
}
},
{
&hf_reg_encap_ipv4_802_3_4,
{
"Packet, IPv4 over 802.3/Ethernet", "wmx.reg.encap_ipv4_802_3",
FT_UINT32, BASE_HEX, NULL, 0x00000020, NULL, HFILL
}
},
{
&hf_reg_encap_ipv6_4,
{
"Packet, IPv6", "wmx.reg.encap_ipv6",
FT_UINT32, BASE_HEX, NULL, 0x00000004, NULL, HFILL
}
},
{
&hf_reg_encap_ipv6_802_1q_4,
{
"Packet, IPv6 over 802.1Q VLAN", "wmx.reg.encap_ipv6_802_1q",
FT_UINT32, BASE_HEX, NULL, 0x00000100, NULL, HFILL
}
},
{
&hf_reg_encap_ipv6_802_3_4,
{
"Packet, IPv6 over 802.3/Ethernet", "wmx.reg.encap_ipv6_802_3",
FT_UINT32, BASE_HEX, NULL, 0x00000040, NULL, HFILL
}
},
{
&hf_reg_encap_packet_8023_ethernet_and_ecrtp_header_compression_4,
{
"Packet, 802.3/Ethernet (with optional 802.1Q VLAN tags) and ECRTP header compression", "wmx.reg.encap_packet_802_3_ethernet_and_ecrtp_header_compression",
FT_UINT32, BASE_HEX, NULL, 0x00000400, NULL, HFILL
}
},
{
&hf_reg_encap_packet_8023_ethernet_and_rohc_header_compression_4,
{
"Packet, 802.3/Ethernet (with optional 802.1Q VLAN tags) and ROHC header compression", "wmx.reg.encap_packet_802_3_ethernet_and_rohc_header_compression",
FT_UINT32, BASE_HEX, NULL, 0x00000200, NULL, HFILL
}
},
{
&hf_reg_encap_packet_ip_ecrtp_header_compression_4,
{
"Packet, IP (v4 or v6) with ECRTP header compression", "wmx.reg.encap_packet_ip_ecrtp_header_compression",
FT_UINT32, BASE_HEX, NULL, 0x00001000, NULL, HFILL
}
},
{
&hf_reg_encap_packet_ip_rohc_header_compression_4,
{
"Packet, IP (v4 or v6) with ROHC header compression", "wmx.reg.encap_packet_ip_rohc_header_compression",
FT_UINT32, BASE_HEX, NULL, 0x00000800, NULL, HFILL
}
},
{
&hf_reg_encap_rsvd_4,
{
"Reserved", "wmx.reg.encap_rsvd",
FT_UINT32, BASE_HEX, NULL, 0xFFFFE000, NULL, HFILL
}
},
{
&hf_reg_tlv_t_22_mac_extended_rtps_support,
{
"MAC extended rtPS support", "wmx.reg.ext_rtps_support",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x01, NULL, HFILL
}
},
{
&hf_reg_tlv_t_27_handover_fbss_mdho_dl_rf_monitoring_maps,
{
"FBSS/MDHO DL RF Combining with monitoring MAPs from active BSs", "wmx.reg.fbss_mdho_dl_rf_combining",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x02, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_bandwidth_request_ul_tx_power_report_header_support,
{
"Bandwidth request and UL Tx Power Report header support",
"wmx.reg.bandwidth_request_ul_tx_pwr_report_header_support",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x1, NULL, HFILL
}
},
{
&hf_reg_tlv_t_27_handover_fbss_mdho_ho_disable,
{
"MDHO/FBSS HO. BS ignore all other bits when set to 1", "wmx.reg.fbss_mdho_ho_disable",
FT_BOOLEAN, 8, TFS(&tfs_reg_fbss_mdho_ho_disable), 0x01, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_feedback_header_support,
{
"Feedback header support", "wmx.reg.feedback_header_support",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x40, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_feedback_request_extended_subheader,
{
"Feedback request extended subheader", "wmx.reg.feedback_request_extended_subheader",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x1000, NULL, HFILL
}
},
{
&hf_reg_tlv_t_46_handover_indication_readiness_timer,
{
"Handover indication readiness timer", "wmx.reg.handover_indication_readiness_timer",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_27_handover_reserved,
{
"Reserved", "wmx.reg.handover_reserved",
FT_UINT8, BASE_DEC, NULL, 0xE0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_41_ho_connections_param_processing_time,
{
"MS HO connections parameters processing time", "wmx.reg.ho_connections_param_processing_time",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_29_ho_process_opt_ms_timer,
{
"HO Process Optimization MS Timer", "wmx.reg.ho_process_opt_ms_timer",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_42_ho_tek_processing_time,
{
"MS HO TEK processing time", "wmx.reg.ho_tek_processing_time",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_idle_mode_timeout,
{
"Idle Mode Timeout", "wmx.reg.idle_mode_timeout",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_ip_mgmt_mode,
{
"IP management mode", "wmx.reg.ip_mgmt_mode",
FT_BOOLEAN, BASE_NONE, TFS(&tfs_reg_ip_mgmt_mode), 0x0, NULL, HFILL
}
},
{
&hf_reg_ip_version,
{
"IP version", "wmx.reg.ip_version",
FT_UINT8, BASE_HEX, VALS(vals_reg_ip_version), 0x0, NULL, HFILL
}
},
{
&hf_reg_mac_address,
{
"MAC Address of the SS", "wmx.reg.mac_address",
FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_mac_crc_support,
{
"MAC CRC", "wmx.reg.mac_crc_support",
FT_BOOLEAN, BASE_NONE, TFS(&tfs_mac_crc_support), 0x0, NULL, HFILL
}
},
{
&hf_reg_max_classifiers,
{
"Maximum number of classification rules", "wmx.reg.max_classifiers",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_23_max_num_bursts_concurrently_to_the_ms,
{
"Maximum number of bursts transmitted concurrently to the MS", "wmx.reg.max_num_bursts_to_ms",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_mca_flow_control,
{
"MCA flow control", "wmx.reg.mca_flow_control",
FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(unique_no_limit), 0x0, NULL, HFILL
}
},
{
&hf_reg_mcast_polling_cids,
{
"Multicast polling group CID support", "wmx.reg.mcast_polling_cids",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_27_handover_mdho_ul_multiple,
{
"MDHO UL Multiple transmission", "wmx.reg.mdh_ul_multiple",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_reg_tlv_t_27_handover_mdho_dl_monitoring_maps,
{
"MDHO DL soft combining with monitoring MAPs from active BSs", "wmx.reg.mdho_dl_monitor_maps",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x08, NULL, HFILL
}
},
{
&hf_reg_tlv_t_27_handover_mdho_dl_monitoring_single_map,
{
"MDHO DL soft Combining with monitoring single MAP from anchor BS", "wmx.reg.mdho_dl_monitor_single_map",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x04, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_mimo_mode_feedback_extended_subheader,
{
"MIMO mode feedback request extended subheader", "wmx.reg.mimo_mode_feedback_request_extended_subheader",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x2000, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_mini_feedback_extended_subheader,
{
"Mini-feedback extended subheader", "wmx.reg.mini_feedback_extended_subheader",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x8000, NULL, HFILL
}
},
{
&hf_reg_tlv_t_31_mobility_handover,
{
"Mobility (handover)", "wmx.reg.mobility_handover",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x01, NULL, HFILL
}
},
{
&hf_reg_tlv_t_31_mobility_idle_mode,
{
"Idle mode", "wmx.reg.mobility_idle_mode",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x04, NULL, HFILL
}
},
{
&hf_reg_tlv_t_31_mobility_sleep_mode,
{
"Sleep mode", "wmx.reg.mobility_sleep_mode",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x02, NULL, HFILL
}
},
{
&hf_reg_num_dl_trans_cid,
{
"Number of Downlink transport CIDs the SS can support", "wmx.reg.dl_cids_supported",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_21_packing_support,
{
"Packing support", "wmx.reg.packing.support",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x01, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_pdu_sn_long_extended_subheader,
{
"PDU SN (long) extended subheader", "wmx.reg.pdu_sn_long_extended_subheader",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x40000, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_pdu_sn_short_extended_subheader,
{
"PDU SN (short) extended subheader", "wmx.reg.pdu_sn_short_extended_subheader",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x20000, NULL, HFILL
}
},
{
&hf_reg_phs,
{
"PHS support", "wmx.reg.phs",
FT_UINT8, BASE_DEC, VALS(vals_reg_phs_support), 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_phy_channel_report_header_support,
{
"PHY channel report header support", "wmx.reg.phy_channel_report_header_support",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x8, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_reserved,
{
"Reserved", "wmx.reg.reserved",
FT_UINT24, BASE_DEC, NULL, 0xf80000, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_sdu_sn_extended_subheader_support_and_parameter,
{
"SDU_SN extended subheader support", "wmx.reg.sdu_sn_extended_subheader_support",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x80, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_sdu_sn_parameter,
{
"SDU_SN parameter", "wmx.reg.sdu_sn_parameter",
FT_UINT24, BASE_DEC, NULL, 0x700, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_sn_report_header_support,
{
"SN report header support", "wmx.reg.sn_report_header_support",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x20, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_sn_request_extended_subheader,
{
"SN request extended subheader", "wmx.reg.sn_request_extended_subheader",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x10000, NULL, HFILL
}
},
{
&hf_reg_ss_mgmt_support,
{
"SS management support", "wmx.reg.ss_mgmt_support",
FT_BOOLEAN, BASE_NONE, TFS(&tfs_reg_ss_mgmt_support), 0x0, NULL, HFILL
}
},
{
&hf_reg_ul_cids,
{
"Number of Uplink transport CIDs the SS can support", "wmx.reg.ul_cids_supported",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_ul_tx_power_report_extended_subheader,
{
"UL Tx power report extended subheader", "wmx.reg.ul_tx_power_report_extended_subheader",
FT_UINT24, BASE_DEC, VALS(tfs_support), 0x4000, NULL, HFILL
}
},
{
&hf_tlv_type,
{
"Unknown TLV Type", "wmx.reg.unknown_tlv_type",
FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
{
&hf_reg_invalid_tlv,
{
"Invalid TLV", "wmx.reg_req.invalid_tlv",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_20_1_max_mac_level_data_per_dl_frame,
{
"Maximum MAC level DL data per frame", "wmx.reg_req.max_mac_dl_data",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_20_2_max_mac_level_data_per_ul_frame,
{
"Maximum MAC level UL data per frame", "wmx.reg_req.max_mac_ul_data",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_req_min_time_for_inter_fa,
{
"Minimum time for inter-FA HO, default=3", "wmx.reg_req.min_time_for_inter_fa",
FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL
}
},
{
&hf_reg_req_min_time_for_intra_fa,
{
"Minimum time for intra-FA HO, default=2", "wmx.reg_req.min_time_for_intra_fa",
FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL
}
},
{
&hf_reg_req_tlv_t_45_ms_periodic_ranging_timer,
{
"MS periodic ranging timer information", "wmx.reg_req.ms_periodic_ranging_timer_info",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{ /* IPv4 Mask */
&hf_ms_previous_ip_address_v4,
{
"MS Previous IP address", "wmx.reg_req.ms_prev_ip_addr_v4",
FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* IPv6 Source Address */
&hf_ms_previous_ip_address_v6,
{
"MS Previous IP address", "wmx.reg_req.ms_prev_ip_addr_v6",
FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_req_secondary_mgmt_cid,
{
"Secondary Management CID", "wmx.reg_req.secondary_mgmt_cid",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_req_tlv_t_32_sleep_mode_recovery_time,
{
"Frames required for the MS to switch from sleep to awake-mode", "wmx.reg_req.sleep_recovery",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_power_saving_class_type_i,
{
"Power saving class type I supported", "wmx.reg.power_saving_class_type_i",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x01, NULL, HFILL
}
},
{
&hf_reg_power_saving_class_type_ii,
{
"Power saving class type II supported", "wmx.reg.power_saving_class_type_ii",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x02, NULL, HFILL
}
},
{
&hf_reg_power_saving_class_type_iii,
{
"Power saving class type III supported", "wmx.reg.power_saving_class_type_iii",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x04, NULL, HFILL
}
},
{
&hf_reg_multi_active_power_saving_classes,
{
"Multiple active power saving classes supported", "wmx.reg.multi_active_power_saving_classes",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x08, NULL, HFILL
}
},
{
&hf_reg_total_power_saving_class_instances,
{
"Total number of power saving class instances of all", "wmx.reg_req.total_power_saving_class_instances",
FT_UINT16, BASE_DEC, NULL, 0x1F0, NULL, HFILL
}
},
{
&hf_reg_power_saving_class_reserved,
{
"Reserved", "wmx.reg.reserved",
FT_UINT16, BASE_DEC, NULL, 0xFE00, NULL, HFILL
}
},
{
&hf_reg_power_saving_class_capability,
{
"Power saving class capability", "wmx.reg.power_saving_class_capability",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_ip_phs_sdu_encap,
{
"Classification/PHS options and SDU encapsulation support", "wmx.reg.ip_phs_sdu_encap",
FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_26_method_alloc_ip_addr_secondary_mgmnt_conn,
{
"Method for allocating IP address for the secondary management connection", "wmx.reg.method_alloc_ip_addr_secondary_mgmnt_conn",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_27_handover_supported,
{
"Handover Support", "wmx.reg.handover_supported",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_31_mobility_features_supported,
{
"Mobility Features Supported", "wmx.reg.mobility_features_supported",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_40_arq_ack_type,
{
"ARQ ACK Type", "wmx.reg.arq_ack_type",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_tlv_t_43_mac_header_ext_header_support,
{
"MAC header and extended subheader support", "wmx.reg.mac_header_ext_header_support",
FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_reg_req_bs_switching_timer,
{
"BS switching timer", "wmx.reg.bs_switching_timer",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_mgmt_msg_reg_req_decoder
};
proto_mac_mgmt_msg_reg_req_decoder = proto_register_protocol (
"WiMax REG-REQ Messages", /* name */
"WiMax REG-REQ", /* short name */
"wmx.reg_req" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_reg_req_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
reg_req_handle = register_dissector("mac_mgmt_msg_reg_req_handler", dissect_mac_mgmt_msg_reg_req_decoder, proto_mac_mgmt_msg_reg_req_decoder);
}
void proto_reg_handoff_mac_mgmt_msg_reg_req(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_REG_REQ, reg_req_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_reg_rsp.c | /* msg_reg_rsp.c
* WiMax MAC Management REG-RSP Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: John R. Underwood <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#define WIMAX_16E_2005
#define FRAG_LAST 0x1
#include <epan/packet.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
void proto_register_mac_mgmt_msg_reg_rsp(void);
void proto_reg_handoff_mac_mgmt_msg_reg_rsp(void);
static dissector_handle_t reg_rsp_handle;
extern gboolean include_cor2_changes;
static dissector_handle_t dsc_rsp_handle = NULL;
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;
/* NCT messages */
/* REG-RSP fields */
static gint hf_reg_rsp_status = -1;
static gint hf_tlv_type = -1;
/* static gint hf_tlv_value = -1; */
static gint hf_reg_rsp_secondary_mgmt_cid = -1;
static gint hf_reg_invalid_tlv = -1;
static gint hf_reg_rsp_new_cid_after_ho = -1;
static gint hf_reg_rsp_service_flow_id = -1;
static gint hf_reg_rsp_system_resource_retain_time = -1;
static gint hf_reg_total_provisioned_sf = -1;
/* STRING RESOURCES */
static const value_string vals_reg_rsp_status [] = {
{0, "OK"},
{1, "Message authentication failure"},
{0, NULL}
};
/* Decode REG-RSP messages. */
static int dissect_mac_mgmt_msg_reg_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tlv_offset;
guint tvb_len;
proto_item *reg_rsp_item;
proto_tree *reg_rsp_tree;
proto_item *tlv_item = NULL;
proto_tree *tlv_tree = NULL;
proto_tree *sub_tree = NULL;
gboolean hmac_found = FALSE;
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;
{ /* we are being asked for details */
/* Get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* display MAC payload type REG-RSP */
reg_rsp_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_reg_rsp_decoder, tvb, offset, tvb_len, "MAC Management Message, REG-RSP");
/* add MAC REG-RSP subtree */
reg_rsp_tree = proto_item_add_subtree(reg_rsp_item, ett_mac_mgmt_msg_reg_rsp_decoder);
proto_tree_add_item(reg_rsp_tree, hf_reg_rsp_status, tvb, offset, 1, ENC_BIG_ENDIAN);
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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "REG-RSP TLV error");
proto_tree_add_item(reg_rsp_tree, hf_reg_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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_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_POWER_SAVING_CLASS_CAPABILITY:
#endif
dissect_extended_tlv(reg_rsp_tree, tlv_type, tvb, tlv_offset, tlv_len, pinfo, offset, proto_mac_mgmt_msg_reg_rsp_decoder);
break;
case REG_RSP_SECONDARY_MGMT_CID:
add_tlv_subtree(&tlv_info, reg_rsp_tree, hf_reg_rsp_secondary_mgmt_cid, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_RSP_TLV_T_36_TOTAL_PROVISIONED_SERVICE_FLOW_DSAs:
add_tlv_subtree(&tlv_info, reg_rsp_tree, hf_reg_total_provisioned_sf, tvb, offset, ENC_BIG_ENDIAN);
break;
case REG_RSP_TLV_T_24_CID_UPDATE_ENCODINGS:
/* Display CID update encodings */
/* add subtree */
sub_tree = add_protocol_subtree(&tlv_info, ett_reg_rsp_message_tree, reg_rsp_tree, proto_mac_mgmt_msg_reg_rsp_decoder, tvb, offset, tlv_len, "CID update encodings");
/* 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 (sub_tlv_type == -1 || sub_tlv_len > MAX_TLV_LEN || sub_tlv_len < 1)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "REG-RSP TLV error");
proto_tree_add_item(reg_rsp_tree, hf_reg_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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 REG_RSP_TLV_T_24_1_CID_UPDATE_ENCODINGS_NEW_CID:
add_tlv_subtree(&sub_tlv_info, sub_tree, hf_reg_rsp_new_cid_after_ho, tvb, this_offset, ENC_BIG_ENDIAN);
break;
case REG_RSP_TLV_T_24_2_CID_UPDATE_ENCODINGS_SFID:
add_tlv_subtree(&sub_tlv_info, sub_tree, hf_reg_rsp_service_flow_id, tvb, this_offset, ENC_BIG_ENDIAN);
break;
case REG_RSP_TLV_T_24_3_CID_UPDATE_ENCODINGS_CONNECTION_INFO:
tlv_tree = add_protocol_subtree(&sub_tlv_info, ett_reg_rsp_message_tree, sub_tree, proto_mac_mgmt_msg_reg_rsp_decoder, tvb, this_offset, sub_tlv_len, "CID Update Encodings Connection Info");
/* Decode the DSC_RSP subTLV's */
call_dissector(dsc_rsp_handle, tvb_new_subset_length(tvb, sub_tlv_offset, sub_tlv_len), pinfo, tlv_tree);
break;
default:
add_tlv_subtree(&sub_tlv_info, sub_tree, hf_tlv_type, tvb, this_offset, ENC_NA);
break;
}
this_offset = sub_tlv_len + sub_tlv_offset;
}
break;
case REG_RSP_TLV_T_28_HO_SYSTEM_RESOURCE_RETAIN_TIME:
tlv_item = add_tlv_subtree(&tlv_info, reg_rsp_tree, hf_reg_rsp_system_resource_retain_time, tvb, offset, ENC_BIG_ENDIAN);
if (include_cor2_changes) {
proto_item_append_text(tlv_item, " (in units of 100 milliseconds)");
} else {
proto_item_append_text(tlv_item, " (multiple of 100 milliseconds)");
}
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_rsp_decoder, reg_rsp_tree, proto_mac_mgmt_msg_reg_rsp_decoder, tvb, offset, tlv_len, "Uplink Service Flow Encodings");
/* decode and display the DL Service Flow Encodings */
wimax_service_flow_encodings_decoder(tvb_new_subset_length(tvb, tlv_offset, 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_rsp_decoder, reg_rsp_tree, proto_mac_mgmt_msg_reg_rsp_decoder, tvb, offset, tlv_len, "Downlink Service Flow Encodings");
/* decode and display the DL Service Flow Encodings */
wimax_service_flow_encodings_decoder(tvb_new_subset_length(tvb, tlv_offset, 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_rsp_decoder, reg_rsp_tree, proto_mac_mgmt_msg_reg_rsp_decoder, tvb, offset, tlv_len, "HMAC Tuple");
wimax_hmac_tuple_decoder(tlv_tree, tvb, offset+2, 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_rsp_decoder, reg_rsp_tree, proto_mac_mgmt_msg_reg_rsp_decoder, tvb, offset, tlv_len, "CMAC Tuple");
wimax_cmac_tuple_decoder(tlv_tree, tvb, offset+2, tlv_len);
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_reg_rsp_decoder, reg_rsp_tree, proto_mac_mgmt_msg_reg_rsp_decoder, tvb, offset, tlv_len, "Short HMAC Tuple");
wimax_short_hmac_tuple_decoder(tlv_tree, tvb, tlv_offset, tlv_len);
} else {
/* Unknown TLV Type */
add_tlv_subtree(&tlv_info, reg_rsp_tree, hf_tlv_type, tvb, offset, ENC_NA);
}
break;
case VENDOR_SPECIFIC_INFO:
case VENDOR_ID_ENCODING:
case MAC_VERSION_ENCODING:
wimax_common_tlv_encoding_decoder(tvb_new_subset_length(tvb, offset, (tvb_len - offset)), pinfo, reg_rsp_tree);
break;
default:
add_tlv_subtree(&tlv_info, reg_rsp_tree, hf_tlv_type, tvb, offset, ENC_NA);
break;
}
offset = tlv_len + tlv_offset;
} /* end of TLV process while loop */
if (!hmac_found)
proto_item_append_text(reg_rsp_tree, " (HMAC Tuple is missing !)");
}
return tvb_captured_length(tvb);
}
/* 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_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
}
},
#if 0
{
&hf_tlv_value,
{
"Value", "wmx.reg_rsp.tlv_value",
FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL
}
}
#endif
};
/* 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_register_protocol (
"WiMax REG-RSP Messages", /* name */
"WiMax REG-RSP", /* short name */
"wmx.reg_rsp" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_reg_rsp_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
reg_rsp_handle = register_dissector("mac_mgmt_msg_reg_rsp_handler", dissect_mac_mgmt_msg_reg_rsp_decoder, proto_mac_mgmt_msg_reg_rsp_decoder);
}
void proto_reg_handoff_mac_mgmt_msg_reg_rsp(void)
{
dsc_rsp_handle = find_dissector("mac_mgmt_msg_dsc_rsp_handler");
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_REG_RSP, reg_rsp_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_rep.c | /* msg_rep.c
* WiMax MAC Management REP-REQ/RSP Messages decoders
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#if 0
#define DEBUG /* for debug only*/
#endif
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
void proto_register_mac_mgmt_msg_rep(void);
void proto_reg_handoff_mac_mgmt_msg_rep(void);
static dissector_handle_t rep_req_handle;
static dissector_handle_t rep_rsp_handle;
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;
static const value_string vals_channel_types[] =
{
{ 0, "Normal Subchannel"},
{ 1, "Band AMC Channel"},
{ 2, "Safety Channel"},
{ 3, "Sounding"},
{ 0, NULL}
};
static const value_string vals_type_of_zones[] =
{
{ 0, "PUSC Zone with 'use all SC=0'"},
{ 1, "PUSC Zone with 'use all SC=1'/PUSC AAS Zone"},
{ 2, "FUSC Zone"},
{ 3, "Optional FUSC Zone"},
{ 4, "Safety Channel Region"},
{ 5, "AMC Zone (only applicable to AAS zone)"},
{ 6, "Reserved"},
{ 7, "Reserved"},
{ 0, NULL}
};
static const value_string vals_data_cinr_measurements[] =
{
{ 0, "From Pilot Subcarriers"},
{ 1, "From Data Subcarriers"},
{ 0, NULL}
};
static const value_string vals_cinr_report_types[] =
{
{ 0, "Mean Of CINR Only"},
{ 1, "Both Mean And Standard Deviation Of CINR"},
{ 0, NULL}
};
static const value_string vals_type_of_measurements[] =
{
{ 0, "From Preamble For Frequency Reuse Configuration 1"},
{ 1, "From Preamble For Frequency Reuse Configuration 3"},
{ 2, "From Preamble For Band AMC"},
{ 3, "Reserved"},
{ 0, NULL}
};
/* fix fields */
static gint hf_rep_unknown_type = -1;
static gint hf_rep_invalid_tlv = -1;
static gint hf_rep_req_report_request = -1;
static gint hf_rep_req_report_type = -1;
static gint hf_rep_req_rep_type_bit0 = -1;
static gint hf_rep_req_rep_type_bit1 = -1;
static gint hf_rep_req_rep_type_bit2 = -1;
static gint hf_rep_req_rep_type_bit3_6 = -1;
static gint hf_rep_req_rep_type_bit7 = -1;
static gint hf_rep_req_channel_number = -1;
static gint hf_rep_req_channel_type = -1;
static gint hf_rep_req_channel_type_request = -1;
static gint hf_rep_req_channel_type_reserved = -1;
static gint hf_rep_req_zone_spec_phy_cinr_request = -1;
static gint hf_rep_req_preamble_phy_cinr_request = -1;
static gint hf_rep_req_zone_spec_effective_cinr_request = -1;
static gint hf_rep_req_preamble_effective_cinr_request = -1;
static gint hf_rep_req_channel_selectivity_report = -1;
static gint hf_rep_req_zone_spec_phy_cinr_req_bit0_2 = -1;
static gint hf_rep_req_zone_spec_phy_cinr_req_bit3 = -1;
static gint hf_rep_req_zone_spec_phy_cinr_req_bit4 = -1;
static gint hf_rep_req_zone_spec_phy_cinr_req_bit5_6 = -1;
static gint hf_rep_req_zone_spec_phy_cinr_req_bit7 = -1;
static gint hf_rep_req_zone_spec_phy_cinr_req_bit8_13 = -1;
static gint hf_rep_req_zone_spec_phy_cinr_req_bit14_17 = -1;
static gint hf_rep_req_zone_spec_phy_cinr_req_bit18 = -1;
static gint hf_rep_req_zone_spec_phy_cinr_req_bit19_23 = -1;
static gint hf_rep_req_zone_spec_effective_cinr_req_bit0_2 = -1;
static gint hf_rep_req_zone_spec_effective_cinr_req_bit3 = -1;
static gint hf_rep_req_zone_spec_effective_cinr_req_bit4 = -1;
static gint hf_rep_req_zone_spec_effective_cinr_req_bit5_6 = -1;
static gint hf_rep_req_zone_spec_effective_cinr_req_bit7 = -1;
static gint hf_rep_req_zone_spec_effective_cinr_req_bit8_13 = -1;
static gint hf_rep_req_zone_spec_effective_cinr_req_bit14_15 = -1;
static gint hf_rep_req_preamble_phy_cinr_req_bit0_1 = -1;
static gint hf_rep_req_preamble_phy_cinr_req_bit2_5 = -1;
static gint hf_rep_req_preamble_phy_cinr_req_bit6 = -1;
static gint hf_rep_req_preamble_phy_cinr_req_bit7 = -1;
static gint hf_rep_req_preamble_effective_cinr_req_bit0_1 = -1;
static gint hf_rep_req_preamble_effective_cinr_req_bit2_7 = -1;
static gint hf_rep_req_channel_selectivity_rep_bit0 = -1;
static gint hf_rep_req_channel_selectivity_rep_bit1_7 = -1;
static gint hf_rep_rsp_report_type = -1;
static gint hf_rep_rsp_report_type_channel_number = -1;
static gint hf_rep_rsp_report_type_frame_number = -1;
static gint hf_rep_rsp_report_type_duration = -1;
static gint hf_rep_rsp_report_type_basic_report = -1;
static gint hf_rep_rsp_report_type_basic_report_bit0 = -1;
static gint hf_rep_rsp_report_type_basic_report_bit1 = -1;
static gint hf_rep_rsp_report_type_basic_report_bit2 = -1;
static gint hf_rep_rsp_report_type_basic_report_bit3 = -1;
static gint hf_rep_rsp_report_type_basic_report_reserved = -1;
static gint hf_rep_rsp_report_type_cinr_report = -1;
static gint hf_rep_rsp_report_type_cinr_report_mean = -1;
static gint hf_rep_rsp_report_type_cinr_report_deviation = -1;
static gint hf_rep_rsp_report_type_rssi_report = -1;
static gint hf_rep_rsp_report_type_rssi_report_mean = -1;
static gint hf_rep_rsp_report_type_rssi_report_deviation = -1;
static gint hf_rep_rsp_current_transmitted_power = -1;
static gint hf_rep_rsp_channel_type_report = -1;
static gint hf_rep_rsp_channel_type_subchannel = -1;
static gint hf_rep_rsp_channel_type_band_amc = -1;
static gint hf_rep_rsp_channel_type_safety_channel = -1;
static gint hf_rep_rsp_channel_type_enhanced_band_amc = -1;
static gint hf_rep_rsp_channel_type_sounding = -1;
static gint hf_rep_rsp_zone_spec_phy_cinr_report = -1;
static gint hf_rep_rsp_zone_spec_phy_cinr_rep_mean = -1;
static gint hf_rep_rsp_zone_spec_phy_cinr_rep_report_type = -1;
static gint hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1 = -1;
static gint hf_rep_rsp_zone_spec_phy_cinr_rep_deviation = -1;
static gint hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2 = -1;
static gint hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc0 = -1;
static gint hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc1 = -1;
static gint hf_rep_rsp_zone_spec_phy_cinr_rep_fusc = -1;
static gint hf_rep_rsp_zone_spec_phy_cinr_rep_optional_fusc = -1;
static gint hf_rep_rsp_zone_spec_phy_cinr_rep_safety_channel = -1;
static gint hf_rep_rsp_zone_spec_phy_cinr_rep_amc = -1;
static gint hf_rep_rsp_preamble_phy_cinr_report = -1;
static gint hf_rep_rsp_preamble_phy_cinr_rep_configuration_1 = -1;
static gint hf_rep_rsp_preamble_phy_cinr_rep_configuration_3 = -1;
static gint hf_rep_rsp_preamble_phy_cinr_rep_band_amc_zone = -1;
static gint hf_rep_rsp_zone_spec_effective_cinr_report = -1;
static gint hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr = -1;
static gint hf_rep_rsp_zone_spec_effective_cinr_rep_report_type = -1;
static gint hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id = -1;
static gint hf_rep_rsp_preamble_effective_cinr_report = -1;
static gint hf_rep_rsp_preamble_effective_cinr_rep_cqich_id = -1;
static gint hf_rep_rsp_channel_selectivity_report = -1;
static gint hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc0 = -1;
static gint hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc1 = -1;
static gint hf_rep_rsp_zone_spec_effective_cinr_rep_fusc = -1;
static gint hf_rep_rsp_zone_spec_effective_cinr_rep_optional_fusc = -1;
static gint hf_rep_rsp_zone_spec_effective_cinr_rep_amc_aas = -1;
static gint hf_rep_rsp_preamble_effective_cinr_rep_configuration_1 = -1;
static gint hf_rep_rsp_preamble_effective_cinr_rep_configuration_3 = -1;
static gint hf_rep_rsp_channel_selectivity_rep_frequency_a = -1;
static gint hf_rep_rsp_channel_selectivity_rep_frequency_b = -1;
static gint hf_rep_rsp_channel_selectivity_rep_frequency_c = -1;
/* bit masks */
#define REP_REQ_REPORT_TYPE_BIT0 0x01
#define REP_REQ_REPORT_TYPE_BIT1 0x02
#define REP_REQ_REPORT_TYPE_BIT2 0x04
#define REP_REQ_REPORT_TYPE_BIT3_6 0x78
#define REP_REQ_REPORT_TYPE_BIT7 0x80
#define REP_REQ_CHANNEL_TYPE_REQUEST 0x03
#define REP_REQ_CHANNEL_TYPE_RESERVED 0xFC
#define REP_REQ_TYPE_OF_ZONE_REQUEST_BIT0_2 0x000007
#define REP_REQ_TYPE_OF_ZONE_REQUEST_BIT3 0x000008
#define REP_REQ_TYPE_OF_ZONE_REQUEST_BIT4 0x000010
#define REP_REQ_TYPE_OF_ZONE_REQUEST_BIT5_6 0x000060
#define REP_REQ_TYPE_OF_ZONE_REQUEST_BIT7 0x000080
#define REP_REQ_TYPE_OF_ZONE_REQUEST_BIT8_13 0x003F00
#define REP_REQ_TYPE_OF_ZONE_REQUEST_BIT14_17 0x03C000
#define REP_REQ_TYPE_OF_ZONE_REQUEST_BIT18 0x040000
#define REP_REQ_TYPE_OF_ZONE_REQUEST_BIT19_23 0xF80000
#define REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT0_2 0x0007
#define REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT3 0x0008
#define REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT4 0x0010
#define REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT5_6 0x0060
#define REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT7 0x0080
#define REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT8_13 0x3F00
#define REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT14_15 0xC000
#define REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT0_1 0x03
#define REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT2_5 0x3C
#define REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT6 0x40
#define REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT7 0x80
#define REP_REQ_PREAMBLE_EFFECTIVE_CINR_REQUEST_BIT0_1 0x03
#define REP_REQ_PREAMBLE_EFFECTIVE_CINR_REQUEST_BIT2_7 0xFC
#define REP_REQ_CHANNEL_SELECTIVITY_REPORT_BIT0 0x01
#define REP_REQ_CHANNEL_SELECTIVITY_REPORT_BIT1_7 0xFE
#define REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT0 0x01
#define REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT1 0x02
#define REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT2 0x04
#define REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT3 0x08
#define REP_RSP_REPORT_TYPE_BASIC_REPORT_RSV 0xF0
#define REP_RSP_ZONE_SPEC_PHY_CINR_MEAN_MASK 0x1F
#define REP_RSP_ZONE_SPEC_PHY_CINR_REP_TYPE_MASK 0x20
#define REP_RSP_ZONE_SPEC_PHY_CINR_RSV1_MASK 0xC0
#define REP_RSP_ZONE_SPEC_PHY_CINR_DEVIATION_MASK 0x1F
#define REP_RSP_ZONE_SPEC_PHY_CINR_RSV2_MASK 0xE0
#define REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_EFFECTIVE_CINR_MASK 0x0F
#define REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_REPORT_TYPE_MASK 0x10
#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 */
static int dissect_mac_mgmt_msg_rep_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tvb_len;
gint tlv_type, tlv_len, tlv_value_offset, length, tlv_offset;
proto_item *rep_item, *tlv_item, *ti_item;
proto_tree *rep_tree, *tlv_tree, *ti_tree;
tlv_info_t tlv_info;
{ /* 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, -1, "Report Request (REP-REQ)");
/* add MAC REP-REQ subtree */
rep_tree = proto_item_add_subtree(rep_item, ett_mac_mgmt_msg_rep_req_decoder);
/* 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 */
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), ENC_NA);
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_item = add_tlv_subtree(&tlv_info, rep_tree, hf_rep_req_report_request, tvb, offset-tlv_value_offset, FALSE);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rep_req_decoder);
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 */
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), ENC_NA);
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_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_req_report_type, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_req_decoder);
proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit0, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit1, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit2, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit3_6, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
/* proto_item_append_text(ti, " dB");*/
proto_tree_add_item(ti_tree, hf_rep_req_rep_type_bit7, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_REQ_CHANNEL_NUMBER:
/* decode and display the Channel Number */
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_req_channel_number, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case REP_REQ_CHANNEL_TYPE:
/* decode and display the Channel Type */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_req_channel_type, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_req_decoder);
proto_tree_add_item(ti_tree, hf_rep_req_channel_type_request, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_channel_type_reserved, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_REQ_ZONE_SPEC_PHY_CINR_REQ:
/* decode and display the zone specific physical cinr request */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_req_zone_spec_phy_cinr_request, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_req_decoder);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit0_2, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit3, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit4, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit5_6, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit7, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit8_13, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit14_17, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit18, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_phy_cinr_req_bit19_23, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_REQ_PREAMBLE_PHY_CINR_REQ:
/* decode and display the preamble phy cinr request */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_req_preamble_phy_cinr_request, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_req_decoder);
proto_tree_add_item(ti_tree, hf_rep_req_preamble_phy_cinr_req_bit0_1, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_preamble_phy_cinr_req_bit2_5, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_preamble_phy_cinr_req_bit6, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_preamble_phy_cinr_req_bit7, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_REQ_ZONE_SPEC_EFF_CINR_REQ:
/* decode and display the zone specific effective cinr request */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_req_zone_spec_effective_cinr_request, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_req_decoder);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit0_2, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit3, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit4, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit5_6, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit8_13, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_zone_spec_effective_cinr_req_bit14_15, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_REQ_PREAMBLE_EFF_CINR_REQ:
/* decode and display the preamble effective cinr request */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_req_preamble_effective_cinr_request, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_req_decoder);
proto_tree_add_item(ti_tree, hf_rep_req_preamble_effective_cinr_req_bit0_1, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_preamble_effective_cinr_req_bit2_7, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_REQ_CHANNEL_SELECTIVITY_REPORT:
/* decode and display the channel selectivity report */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_req_channel_selectivity_report, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_req_decoder);
proto_tree_add_item(ti_tree, hf_rep_req_channel_selectivity_rep_bit0, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_req_channel_selectivity_rep_bit1_7, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
default:
/* display the unknown tlv in hex */
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), ENC_NA);
break;
}
tlv_offset += length;
} /* end of TLV process for loop */
break;
default:
/* display the unknown tlv in hex */
add_tlv_subtree(&tlv_info, rep_tree, hf_rep_unknown_type, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
offset += tlv_len;
} /* end of TLV process while loop */
}
return tvb_captured_length(tvb);
}
/* Wimax Mac REP-RSP Message Dissector */
static int dissect_mac_mgmt_msg_rep_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tvb_len, length, value;
gint tlv_type, tlv_len, tlv_value_offset, tlv_offset;
gint db_val;
proto_item *rep_item, *tlv_item, *ti, *ti_item;
proto_tree *rep_tree, *tlv_tree, *ti_tree;
tlv_info_t tlv_info;
gfloat current_power;
{ /* 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, -1, "Report Response (REP-RSP)");
/* 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) */
/* 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 */
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), ENC_NA);
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_item = add_tlv_subtree(&tlv_info, rep_tree, hf_rep_rsp_report_type, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rep_rsp_decoder);
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 */
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), ENC_NA);
break;
}
/* update the offset */
tlv_offset += get_tlv_value_offset(&tlv_info);
switch (tlv_type)
{
case REP_RSP_REPORT_CHANNEL_NUMBER:
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_report_type_channel_number, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case REP_RSP_REPORT_START_FRAME:
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_report_type_frame_number, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case REP_RSP_REPORT_DURATION:
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_report_type_duration, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case REP_RSP_REPORT_BASIC_REPORT:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_report_type_basic_report, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_bit0, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_bit1, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_bit2, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_bit3, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_basic_report_reserved, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_RSP_REPORT_CINR_REPORT:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_report_type_cinr_report, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
db_val = tvb_get_guint8(tvb, offset + tlv_offset) - 20;
if (db_val > 37)
db_val = 37;
proto_item_append_text(ti_item, " (%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, ENC_BIG_ENDIAN);
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_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_report_type_rssi_report, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
ti = proto_tree_add_item(ti_tree, hf_rep_rsp_report_type_rssi_report_mean, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
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 */
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
break;
}
tlv_offset += length;
}
break;
case REP_RSP_CHANNEL_TYPE:
/* decode and display the Channel Type */
tlv_item = add_tlv_subtree(&tlv_info, rep_tree, hf_rep_rsp_channel_type_report, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rep_rsp_decoder);
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 */
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), ENC_NA);
break;
}
switch (tlv_type)
{
case REP_RSP_CHANNEL_TYPE_SUBCHANNEL:
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_channel_type_subchannel, tvb, (offset + tlv_offset), ENC_BIG_ENDIAN);
break;
case REP_RSP_CHANNEL_TYPE_BAND_AMC:
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_channel_type_band_amc, tvb, (offset + tlv_offset), ENC_BIG_ENDIAN);
break;
case REP_RSP_CHANNEL_TYPE_SAFETY_CHANNEL:
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_channel_type_safety_channel, tvb, (offset + tlv_offset), ENC_NA);
break;
case REP_RSP_CHANNEL_TYPE_ENHANCED_BAND_AMC:
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_channel_type_enhanced_band_amc, tvb, (offset + tlv_offset), ENC_NA);
break;
case REP_RSP_CHANNEL_TYPE_SOUNDING:
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_channel_type_sounding, tvb, (offset + tlv_offset), ENC_BIG_ENDIAN);
break;
default:
/* display the unknown tlv in hex */
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), ENC_NA);
break;
}
tlv_offset += (length + get_tlv_value_offset(&tlv_info));
}
break;
case REP_RSP_ZONE_SPECIFIC_PHY_CINR:
/* decode and display the zone-specific physical CINR report type */
tlv_item = add_tlv_subtree(&tlv_info, rep_tree, hf_rep_rsp_zone_spec_phy_cinr_report, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rep_rsp_decoder);
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 */
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), ENC_NA);
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_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc0, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
if (length == 2)
{
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, ENC_BIG_ENDIAN);
}
break;
case REP_RSP_ZONE_SPECIFIC_PHY_CINR_PUSC_SC1:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc1, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
if (length == 2)
{
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, ENC_BIG_ENDIAN);
}
break;
case REP_RSP_ZONE_SPECIFIC_PHY_CINR_FUSC:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_fusc, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
if (length == 2)
{
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, ENC_BIG_ENDIAN);
}
break;
case REP_RSP_ZONE_SPECIFIC_PHY_CINR_OPTIONAL_FUSC:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_optional_fusc, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
if (length == 2)
{
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, ENC_BIG_ENDIAN);
}
break;
case REP_RSP_ZONE_SPECIFIC_PHY_CINR_SAFETY_CHANNEL:
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_safety_channel, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
break;
case REP_RSP_ZONE_SPECIFIC_PHY_CINR_AMC:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_amc, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_mean, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_report_type, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
if (length == 2)
{
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2, tvb, (offset + tlv_offset + 1), 1, ENC_BIG_ENDIAN);
}
break;
default:
/* display the unknown tlv in hex */
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
break;
}
tlv_offset += length;
}
break;
case REP_RSP_PREAMBLE_PHY_CINR:
/* decode and display the preamble physical CINR report type */
tlv_item = add_tlv_subtree(&tlv_info, rep_tree, hf_rep_rsp_preamble_phy_cinr_report, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rep_rsp_decoder);
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 */
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), ENC_NA);
break;
}
switch (tlv_type)
{
case REP_RSP_PREAMBLE_PHY_CINR_CONFIGURATION1:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_preamble_phy_cinr_rep_configuration_1, tvb, (offset + tlv_offset), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
if (length == 2)
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1)+get_tlv_value_offset(&tlv_info), 1, ENC_BIG_ENDIAN);
break;
case REP_RSP_PREAMBLE_PHY_CINR_CONFIGURATION3:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_preamble_phy_cinr_rep_configuration_3, tvb, (offset + tlv_offset), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
if (length == 2)
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_phy_cinr_rep_deviation, tvb, (offset + tlv_offset + 1)+get_tlv_value_offset(&tlv_info), 1, ENC_BIG_ENDIAN);
break;
case REP_RSP_PREAMBLE_PHY_CINR_BAND_AMC:
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_preamble_phy_cinr_rep_band_amc_zone, tvb, (offset + tlv_offset), ENC_NA);
break;
default:
/* display the unknown tlv in hex */
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset), ENC_NA);
break;
}
tlv_offset += (length+get_tlv_value_offset(&tlv_info));
}
break;
case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR:
/* decode and display the zone-specific effective CINR report type */
tlv_item = add_tlv_subtree(&tlv_info, rep_tree, hf_rep_rsp_zone_spec_effective_cinr_report, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rep_rsp_decoder);
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 */
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), ENC_NA);
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_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc0, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_PUSC_SC1:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc1, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_FUSC:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_fusc, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_OPTIONAL_FUSC:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_optional_fusc, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_AMC_AAS:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_amc_aas, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_report_type, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
default:
/* display the unknown tlv in hex */
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
break;
}
tlv_offset += length;
}
break;
case REP_RSP_PREAMBLE_EFFECTIVE_CINR:
/* decode and display the preamble effective CINR report type */
tlv_item = add_tlv_subtree(&tlv_info, rep_tree, hf_rep_rsp_preamble_effective_cinr_report, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rep_rsp_decoder);
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 */
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), ENC_NA);
break;
}
/* update the offset */
tlv_offset += get_tlv_value_offset(&tlv_info);
switch (tlv_type)
{
case REP_RSP_PREAMBLE_EFFECTIVE_CINR_CONFIGURATION1:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_preamble_effective_cinr_rep_configuration_1, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_preamble_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_RSP_PREAMBLE_EFFECTIVE_CINR_CONFIGURATION3:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_rsp_preamble_effective_cinr_rep_configuration_3, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_preamble_effective_cinr_rep_cqich_id, tvb, (offset + tlv_offset), length, ENC_BIG_ENDIAN);
break;
case REP_RSP_CHANNEL_SELECTIVITY:
/* decode and display the channel selectivity report type */
ti_item = add_tlv_subtree(&tlv_info, rep_tree, hf_rep_rsp_channel_selectivity_report, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_mac_mgmt_msg_rep_rsp_decoder);
proto_tree_add_item(ti_tree, hf_rep_rsp_channel_selectivity_rep_frequency_a, tvb, (offset + tlv_offset + 2), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_channel_selectivity_rep_frequency_b, tvb, (offset + tlv_offset + 1), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_rep_rsp_channel_selectivity_rep_frequency_c, tvb, (offset + tlv_offset), 1, ENC_BIG_ENDIAN);
break;
default:
/* display the unknown tlv in hex */
add_tlv_subtree(&tlv_info, tlv_tree, hf_rep_unknown_type, tvb, (offset + tlv_offset)-get_tlv_value_offset(&tlv_info), ENC_NA);
break;
}
tlv_offset += length;
}
break;
case CURRENT_TX_POWER:
tlv_item = add_tlv_subtree(&tlv_info, rep_tree, hf_rep_rsp_current_transmitted_power, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
value = tvb_get_guint8(tvb, offset);
current_power = ((gfloat)value - 128) / 2;
proto_item_append_text(tlv_item, " (%.1f dBm)", current_power);
break;
default:
/* display the unknown tlv in hex */
add_tlv_subtree(&tlv_info, rep_tree, hf_rep_unknown_type, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
offset += tlv_len;
} /* end of TLV process while loop */
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac REP-REQ Messages Dissectors */
void proto_register_mac_mgmt_msg_rep(void)
{
/* report display */
static hf_register_info hf_rep[] =
{
{
&hf_rep_invalid_tlv,
{
"Invalid TLV", "wmx.rep.invalid_tlv",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
}
},
{ /* type 1.2 */
&hf_rep_req_channel_number,
{
"Channel Number", "wmx.rep_req.channel_number",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{ /* type 1.8 */
&hf_rep_req_channel_selectivity_report,
{
"Channel Selectivity Report", "wmx.rep_req.channel_selectivity_report",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_req_channel_selectivity_rep_bit0,
{
"Include Frequency Selectivity Report", "wmx.rep_req.channel_selectivity_report.bit0",
FT_BOOLEAN, 8, NULL, REP_REQ_CHANNEL_SELECTIVITY_REPORT_BIT0, NULL, HFILL
}
},
{
&hf_rep_req_channel_selectivity_rep_bit1_7,
{
"Reserved", "wmx.rep_req.channel_selectivity_report.bit1_7",
FT_UINT8, BASE_HEX, NULL, REP_REQ_CHANNEL_SELECTIVITY_REPORT_BIT1_7, NULL, HFILL
}
},
{ /* type 1.3 */
&hf_rep_req_channel_type,
{
"Channel Type", "wmx.rep_req.channel_type",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_req_channel_type_request,
{
"Channel Type Request", "wmx.rep_req.channel_type.request",
FT_UINT8, BASE_DEC, VALS(vals_channel_types), 0x03, NULL, HFILL
}
},
{
&hf_rep_req_channel_type_reserved,
{
"Reserved", "wmx.rep_req.channel_type.reserved",
FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL
}
},
{ /* type 1.7 */
&hf_rep_req_preamble_effective_cinr_request,
{
"Preamble Effective CINR Request", "wmx.rep_req.preamble_effective_cinr_request",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_req_preamble_effective_cinr_req_bit0_1,
{
"Type Of Preamble Physical CINR Measurement", "wmx.rep_req.preamble_effective_cinr_request.bit0_1",
FT_UINT8, BASE_DEC, VALS(vals_type_of_measurements), REP_REQ_PREAMBLE_EFFECTIVE_CINR_REQUEST_BIT0_1, NULL, HFILL
}
},
{
&hf_rep_req_preamble_effective_cinr_req_bit2_7,
{
"Reserved", "wmx.rep_req.preamble_effective_cinr_request.bit2_7",
FT_UINT8, BASE_HEX, NULL, REP_REQ_PREAMBLE_EFFECTIVE_CINR_REQUEST_BIT2_7, NULL, HFILL
}
},
{ /* type 1.5 */
&hf_rep_req_preamble_phy_cinr_request,
{
"Preamble Physical CINR Request", "wmx.rep_req.preamble_phy_cinr_request",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_req_preamble_phy_cinr_req_bit0_1,
{
"Type Of Preamble Physical CINR Measurement", "wmx.rep_req.preamble_phy_cinr_request.bit0_1",
FT_UINT8, BASE_DEC, VALS(vals_type_of_measurements), REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT0_1, NULL, HFILL
}
},
{
&hf_rep_req_preamble_phy_cinr_req_bit2_5,
{
"Alpha (ave) in multiples of 1/16", "wmx.rep_req.preamble_phy_cinr_request.bit2_5",
FT_UINT8, BASE_DEC, NULL, REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT2_5, NULL, HFILL
}
},
{
&hf_rep_req_preamble_phy_cinr_req_bit6,
{
"CINR Report Type", "wmx.rep_req.preamble_phy_cinr_request.bit6",
FT_UINT8, BASE_DEC, VALS(vals_cinr_report_types), REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT6, NULL, HFILL
}
},
{
&hf_rep_req_preamble_phy_cinr_req_bit7,
{
"Reserved", "wmx.rep_req.preamble_phy_cinr_request.bit7",
FT_UINT8, BASE_HEX, NULL, REP_REQ_PREAMBLE_PHY_CINR_REQUEST_BIT7, NULL, HFILL
}
},
{ /* report request */
&hf_rep_req_report_request,
{
"Report Request", "wmx.rep_req.report_request",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* type 1.1 */
&hf_rep_req_report_type,
{
"Report Type", "wmx.rep_req.report_type",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_req_rep_type_bit0,
{
"Include DFS Basic Report", "wmx.rep_req.report_type.bit0",
FT_BOOLEAN, 8, NULL, REP_REQ_REPORT_TYPE_BIT0, NULL, HFILL
}
},
{
&hf_rep_req_rep_type_bit1,
{
"Include CINR Report", "wmx.rep_req.report_type.bit1",
FT_BOOLEAN, 8, NULL, REP_REQ_REPORT_TYPE_BIT1, NULL, HFILL
}
},
{
&hf_rep_req_rep_type_bit2,
{
"Include RSSI Report", "wmx.rep_req.report_type.bit2",
FT_BOOLEAN, 8, NULL, REP_REQ_REPORT_TYPE_BIT2, NULL, HFILL
}
},
{
&hf_rep_req_rep_type_bit3_6,
{
"Alpha (ave) in multiples of 1/32", "wmx.rep_req.report_type.bit3_6",
FT_UINT8, BASE_DEC, NULL, REP_REQ_REPORT_TYPE_BIT3_6, NULL, HFILL
}
},
{
&hf_rep_req_rep_type_bit7,
{
"Include Current Transmit Power Report", "wmx.rep_req.report_type.bit7",
FT_BOOLEAN, 8, NULL, REP_REQ_REPORT_TYPE_BIT7, NULL, HFILL
}
},
{
&hf_rep_rsp_preamble_effective_cinr_rep_cqich_id,
{
"The 4 least significant bits of CQICH_ID", "wmx.rep_req.zone_spec_effective_cinr_report.cqich_id_4",
FT_UINT8, BASE_HEX, NULL, REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_CQICH_ID_4_MASK, NULL, HFILL
}
},
{
&hf_rep_rsp_zone_spec_effective_cinr_rep_cqich_id,
{
"The 3 least significant bits of CQICH_ID", "wmx.rep_req.zone_spec_effective_cinr_report.cqich_id",
FT_UINT8, BASE_HEX, NULL, REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_CQICH_ID_MASK, NULL, HFILL
}
},
{
&hf_rep_rsp_zone_spec_effective_cinr_rep_effective_cinr,
{
"Effective CINR", "wmx.rep_req.zone_spec_effective_cinr_report.effective_cinr",
FT_UINT8, BASE_DEC, NULL, REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_EFFECTIVE_CINR_MASK, NULL, HFILL
}
},
{
&hf_rep_rsp_zone_spec_effective_cinr_rep_report_type,
{
"Effective CINR Report", "wmx.rep_req.zone_spec_effective_cinr_report.report_type",
FT_UINT8, BASE_DEC, VALS(vals_data_cinr_measurements), REP_RSP_ZONE_SPEC_EFFECTIVE_CINR_REPORT_TYPE_MASK, NULL, HFILL
}
},
{ /* type 1.6 */
&hf_rep_req_zone_spec_effective_cinr_request,
{
"Zone-specific Effective CINR Request", "wmx.rep_req.zone_spec_effective_cinr_request",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_effective_cinr_req_bit0_2,
{
"Type Of Zone On Which CINR Is To Be Reported", "wmx.rep_req.zone_spec_effective_cinr_request.bit0_2",
FT_UINT16, BASE_HEX, VALS(vals_type_of_zones), REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT0_2, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_effective_cinr_req_bit3,
{
"STC Zone", "wmx.rep_req.zone_spec_effective_cinr_request.bit3",
FT_BOOLEAN, 16, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT3, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_effective_cinr_req_bit4,
{
"AAS Zone", "wmx.rep_req.zone_spec_effective_cinr_request.bit4",
FT_BOOLEAN, 16, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT4, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_effective_cinr_req_bit5_6,
{
"PRBS ID", "wmx.rep_req.zone_spec_effective_cinr_request.bit5_6",
FT_UINT16, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT5_6, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_effective_cinr_req_bit7,
{
"CINR Measurement Report", "wmx.rep_req.zone_spec_effective_cinr_request.bit7",
FT_UINT16, BASE_HEX, VALS(vals_data_cinr_measurements), REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT7, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_effective_cinr_req_bit8_13,
{
"PUSC Major Group Map", "wmx.rep_req.zone_spec_effective_cinr_request.bit8_13",
FT_UINT16, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT8_13, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_effective_cinr_req_bit14_15,
{
"Reserved", "wmx.rep_req.zone_spec_effective_cinr_request.bit14_15",
FT_UINT16, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_16_BIT14_15, NULL, HFILL
}
},
{ /* second byte */
&hf_rep_rsp_zone_spec_phy_cinr_rep_deviation,
{
"Standard Deviation of CINR", "wmx.rep_req.zone_spec_phy_cinr_report.deviation",
FT_UINT8, BASE_DEC, NULL, REP_RSP_ZONE_SPEC_PHY_CINR_DEVIATION_MASK, NULL, HFILL
}
},
{ /* first byte */
&hf_rep_rsp_zone_spec_phy_cinr_rep_mean,
{
"Mean of Physical CINR", "wmx.rep_req.zone_spec_phy_cinr_report.mean",
FT_UINT8, BASE_DEC, NULL, REP_RSP_ZONE_SPEC_PHY_CINR_MEAN_MASK, NULL, HFILL
}
},
{
&hf_rep_rsp_zone_spec_phy_cinr_rep_report_type,
{
"CINR Report Type", "wmx.rep_req.zone_spec_phy_cinr_report.report_type",
FT_UINT8, BASE_DEC, VALS(vals_data_cinr_measurements), REP_RSP_ZONE_SPEC_PHY_CINR_REP_TYPE_MASK, NULL, HFILL
}
},
{
&hf_rep_rsp_zone_spec_phy_cinr_rep_reserved1,
{
"Reserved", "wmx.rep_req.zone_spec_phy_cinr_report.reserved1",
FT_UINT8, BASE_HEX, NULL, REP_RSP_ZONE_SPEC_PHY_CINR_RSV1_MASK, NULL, HFILL
}
},
{
&hf_rep_rsp_zone_spec_phy_cinr_rep_reserved2,
{
"Reserved", "wmx.rep_req.zone_spec_phy_cinr_report.reserved2",
FT_UINT8, BASE_HEX, NULL, REP_RSP_ZONE_SPEC_PHY_CINR_RSV2_MASK, NULL, HFILL
}
},
{ /* type 1.4 */
&hf_rep_req_zone_spec_phy_cinr_request,
{
"Zone-specific Physical CINR Request", "wmx.rep_req.zone_spec_phy_cinr_request",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_phy_cinr_req_bit0_2,
{
"Type Of Zone On Which CINR Is To Be Reported", "wmx.rep_req.zone_spec_phy_cinr_request.bit0_2",
FT_UINT24, BASE_HEX, VALS(vals_type_of_zones), REP_REQ_TYPE_OF_ZONE_REQUEST_BIT0_2, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_phy_cinr_req_bit3,
{
"STC Zone", "wmx.rep_req.zone_spec_phy_cinr_request.bit3",
FT_BOOLEAN, 24, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT3, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_phy_cinr_req_bit4,
{
"AAS Zone", "wmx.rep_req.zone_spec_phy_cinr_request.bit4",
FT_BOOLEAN, 24, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT4, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_phy_cinr_req_bit5_6,
{
"PRBS ID", "wmx.rep_req.zone_spec_phy_cinr_request.bit5_6",
FT_UINT24, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT5_6, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_phy_cinr_req_bit7,
{
"CINR Measurement Report", "wmx.rep_req.zone_spec_phy_cinr_request.bit7",
FT_UINT24, BASE_HEX, VALS(vals_data_cinr_measurements), REP_REQ_TYPE_OF_ZONE_REQUEST_BIT7, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_phy_cinr_req_bit8_13,
{
"PUSC Major Group Map", "wmx.rep_req.zone_spec_phy_cinr_request.bit8_13",
FT_UINT24, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT8_13, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_phy_cinr_req_bit14_17,
{
"Alpha (ave) in multiples of 1/16", "wmx.rep_req.zone_spec_phy_cinr_request.bit14_17",
FT_UINT24, BASE_DEC, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT14_17, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_phy_cinr_req_bit18,
{
"CINR Report Type", "wmx.rep_req.zone_spec_phy_cinr_request.bit18",
FT_UINT24, BASE_HEX, VALS(vals_cinr_report_types), REP_REQ_TYPE_OF_ZONE_REQUEST_BIT18, NULL, HFILL
}
},
{
&hf_rep_req_zone_spec_phy_cinr_req_bit19_23,
{
"Reserved", "wmx.rep_req.zone_spec_phy_cinr_request.bit19_23",
FT_UINT24, BASE_HEX, NULL, REP_REQ_TYPE_OF_ZONE_REQUEST_BIT19_23, NULL, HFILL
}
},
{ /* 6.3 */
&hf_rep_rsp_channel_selectivity_report,
{
"Channel Selectivity Report", "wmx.rep_rsp.channel_selectivity_report",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_channel_selectivity_rep_frequency_a,
{
"Frequency Selectivity Report a", "wmx.rep_rsp.channel_selectivity_report.frequency_a",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_channel_selectivity_rep_frequency_b,
{
"Frequency Selectivity Report b", "wmx.rep_rsp.channel_selectivity_report.frequency_b",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_channel_selectivity_rep_frequency_c,
{
"Frequency Selectivity Report c", "wmx.rep_rsp.channel_selectivity_report.frequency_c",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_channel_type_report,
{
"Channel Type Report", "wmx.rep_rsp.channel_type_report",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_channel_type_band_amc,
{
"Band AMC", "wmx.rep_rsp.channel_type_report.band_amc",
FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_channel_type_enhanced_band_amc,
{
"Enhanced Band AMC", "wmx.rep_rsp.channel_type_report.enhanced_band_amc",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_channel_type_safety_channel,
{
"Safety Channel", "wmx.rep_rsp.channel_type_report.safety_channel",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_channel_type_sounding,
{
"Sounding", "wmx.rep_rsp.channel_type_report.sounding",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_channel_type_subchannel,
{
"Normal Subchannel", "wmx.rep_rsp.channel_type_report.subchannel",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_preamble_effective_cinr_report,
{
"Preamble Effective CINR Report", "wmx.rep_rsp.preamble_effective_cinr_report",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 6.1 */
&hf_rep_rsp_preamble_effective_cinr_rep_configuration_1,
{
"The Estimation Of Effective CINR Measured From Preamble For Frequency Reuse Configuration=1", "wmx.rep_rsp.preamble_effective_cinr_report.configuration_1",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 6.2 */
&hf_rep_rsp_preamble_effective_cinr_rep_configuration_3,
{
"The Estimation Of Effective CINR Measured From Preamble For Frequency Reuse Configuration=3", "wmx.rep_rsp.preamble_effective_cinr_report.configuration_3",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_preamble_phy_cinr_report,
{
"Preamble Physical CINR Report", "wmx.rep_rsp.preamble_phy_cinr_report",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 4.3 */
&hf_rep_rsp_preamble_phy_cinr_rep_band_amc_zone,
{
"The Estimation Of Physical CINR Measured From Preamble For Band AMC Zone", "wmx.rep_rsp.preamble_phy_cinr_report.band_amc_zone",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 4.1 */
&hf_rep_rsp_preamble_phy_cinr_rep_configuration_1,
{
"The Estimation Of Physical CINR Measured From Preamble For Frequency Reuse Configuration=1", "wmx.rep_rsp.preamble_phy_cinr_report.configuration_1",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 4.2 */
&hf_rep_rsp_preamble_phy_cinr_rep_configuration_3,
{
"The Estimation Of Physical CINR Measured From Preamble For Frequency Reuse Configuration=3", "wmx.rep_rsp.preamble_phy_cinr_report.configuration_3",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
/* Report Response */
{
&hf_rep_rsp_report_type,
{
"Report Type", "wmx.rep_rsp.report_type",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_basic_report,
{
"Basic Report", "wmx.rep_rsp.report_type.basic_report",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_basic_report_bit0,
{
"Wireless HUMAN Detected", "wmx.rep_rsp.report_type.basic_report.bit0",
FT_BOOLEAN, 8, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT0, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_basic_report_bit1,
{
"Unknown Transmission Detected", "wmx.rep_rsp.report_type.basic_report.bit1",
FT_BOOLEAN, 8, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT1, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_basic_report_bit2,
{
"Specific Spectrum User Detected", "wmx.rep_rsp.report_type.basic_report.bit2",
FT_BOOLEAN, 8, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT2, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_basic_report_bit3,
{
"Channel Not Measured", "wmx.rep_rsp.report_type.basic_report.bit3",
FT_BOOLEAN, 8, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_BIT3, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_basic_report_reserved,
{
"Reserved", "wmx.rep_rsp.report_type.basic_report.reserved",
FT_UINT8, BASE_HEX, NULL, REP_RSP_REPORT_TYPE_BASIC_REPORT_RSV, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_channel_number,
{
"Channel Number", "wmx.rep_rsp.report_type.channel_number",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_cinr_report,
{
"CINR Report", "wmx.rep_rsp.report_type.cinr_report",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_cinr_report_deviation,
{
"CINR Standard Deviation", "wmx.rep_rsp.report_type.cinr_report_deviation",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_cinr_report_mean,
{
"CINR Mean", "wmx.rep_rsp.report_type.cinr_report_mean",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_duration,
{
"Duration", "wmx.rep_rsp.report_type.duration",
FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_frame_number,
{
"Start Frame", "wmx.rep_rsp.report_type.frame_number",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_rssi_report,
{
"RSSI Report", "wmx.rep_rsp.report_type.rssi_report",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_rssi_report_deviation,
{
"RSSI Standard Deviation", "wmx.rep_rsp.report_type.rssi_report_deviation",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_current_transmitted_power,
{
"Current Transmitted Power", "wmx.rep_rsp.current_transmitted_power",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_report_type_rssi_report_mean,
{
"RSSI Mean", "wmx.rep_rsp.report_type.rssi_report_mean",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_zone_spec_effective_cinr_report,
{
"Zone-specific Effective CINR Report", "wmx.rep_rsp.zone_spec_effective_cinr_report",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 5.5 */
&hf_rep_rsp_zone_spec_effective_cinr_rep_amc_aas,
{
"AMC AAS Zone", "wmx.rep_rsp.zone_spec_effective_cinr_report.amc_aas",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 5.3 */
&hf_rep_rsp_zone_spec_effective_cinr_rep_fusc,
{
"FUSC Zone", "wmx.rep_rsp.zone_spec_effective_cinr_report.fusc",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 5.4 */
&hf_rep_rsp_zone_spec_effective_cinr_rep_optional_fusc,
{
"Optional FUSC Zone", "wmx.rep_rsp.zone_spec_effective_cinr_report.optional_fusc",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 5.1 */
&hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc0,
{
"PUSC Zone (use all SC=0)", "wmx.rep_rsp.zone_spec_effective_cinr_report.pusc_sc0",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 5.2 */
&hf_rep_rsp_zone_spec_effective_cinr_rep_pusc_sc1,
{
"PUSC Zone (use all SC=1)", "wmx.rep_rsp.zone_spec_effective_cinr_report.pusc_sc1",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_rsp_zone_spec_phy_cinr_report,
{
"Zone-specific Physical CINR Report", "wmx.rep_rsp.zone_spec_phy_cinr_report",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 3.6 */
&hf_rep_rsp_zone_spec_phy_cinr_rep_amc,
{
"AMC Zone", "wmx.rep_rsp.zone_spec_phy_cinr_report.amc",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 3.3 */
&hf_rep_rsp_zone_spec_phy_cinr_rep_fusc,
{
"FUSC Zone", "wmx.rep_rsp.zone_spec_phy_cinr_report.fusc",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 3.4 */
&hf_rep_rsp_zone_spec_phy_cinr_rep_optional_fusc,
{
"Optional FUSC Zone", "wmx.rep_rsp.zone_spec_phy_cinr_report.optional_fusc",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 3.1 */
&hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc0,
{
"PUSC Zone (use all SC=0)", "wmx.rep_rsp.zone_spec_phy_cinr_report.pusc_sc0",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 3.2 */
&hf_rep_rsp_zone_spec_phy_cinr_rep_pusc_sc1,
{
"PUSC Zone (use all SC=1)", "wmx.rep_rsp.zone_spec_phy_cinr_report.pusc_sc1",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 3.5 */
&hf_rep_rsp_zone_spec_phy_cinr_rep_safety_channel,
{
"Safety Channel", "wmx.rep_rsp.zone_spec_phy_cinr_report.safety_channel",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rep_unknown_type,
{
"Unknown TLV type", "wmx.rep.unknown_tlv_type",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
}
};
/* Setup protocol subtree array */
static gint *ett_rep[] =
{
&ett_mac_mgmt_msg_rep_req_decoder,
&ett_mac_mgmt_msg_rep_rsp_decoder,
};
proto_mac_mgmt_msg_rep_decoder = proto_register_protocol (
"WiMax REP-REQ/RSP Messages", /* name */
"WiMax REP-REQ/RSP (rep)", /* short name */
"wmx.rep" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_rep_decoder, hf_rep, array_length(hf_rep));
proto_register_subtree_array(ett_rep, array_length(ett_rep));
rep_req_handle = register_dissector("mac_mgmt_msg_rep_req_handler", dissect_mac_mgmt_msg_rep_req_decoder, proto_mac_mgmt_msg_rep_decoder);
rep_rsp_handle = register_dissector("mac_mgmt_msg_rep_rsp_handler", dissect_mac_mgmt_msg_rep_rsp_decoder, proto_mac_mgmt_msg_rep_decoder);
}
void
proto_reg_handoff_mac_mgmt_msg_rep(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_REP_REQ, rep_req_handle);
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_REP_RSP, rep_rsp_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_res_cmd.c | /* msg_res_cmd.c
* WiMax MAC Management RES-CMD Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#if 0
#define DEBUG /* for debug only */
#endif
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
void proto_register_mac_mgmt_msg_res_cmd(void);
void proto_reg_handoff_mac_mgmt_msg_res_cmd(void);
static dissector_handle_t res_cmd_handle;
static gint proto_mac_mgmt_msg_res_cmd_decoder = -1;
static gint ett_mac_mgmt_msg_res_cmd_decoder = -1;
/* fix fields */
static gint hf_res_cmd_unknown_type = -1;
static gint hf_res_cmd_invalid_tlv = -1;
/* Wimax Mac RES-CMD Message Dissector */
static int dissect_mac_mgmt_msg_res_cmd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tvb_len;
gint tlv_type, tlv_len, tlv_value_offset;
proto_item *res_cmd_item;
proto_tree *res_cmd_tree;
proto_tree *tlv_tree = NULL;
tlv_info_t tlv_info;
{ /* we are being asked for details */
/* Get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* display MAC payload type RES-CMD */
res_cmd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_res_cmd_decoder, tvb, offset, -1, "Reset Command (RES-CMD)");
/* add MAC RES-CMD subtree */
res_cmd_tree = proto_item_add_subtree(res_cmd_item, ett_mac_mgmt_msg_res_cmd_decoder);
/* Decode and display the Reset Command (RES-CMD) */
/* process the RES-CMD 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RES-CMD TLV error");
proto_tree_add_item(res_cmd_tree, hf_res_cmd_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(res_cmd_tree, proto_mac_mgmt_msg_res_cmd_decoder, tvb, offset, (tlv_len + tlv_value_offset), "RES-CMD 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
/* process RES-CMD TLV Encoded information */
switch (tlv_type)
{
case HMAC_TUPLE: /* Table 348d */
/* decode and display the HMAC Tuple */
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_res_cmd_decoder, res_cmd_tree, proto_mac_mgmt_msg_res_cmd_decoder, tvb, offset, tlv_len, "HMAC Tuple");
wimax_hmac_tuple_decoder(tlv_tree, tvb, offset+tlv_value_offset, tlv_len);
break;
case CMAC_TUPLE: /* Table 348b */
/* decode and display the CMAC Tuple */
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_res_cmd_decoder, res_cmd_tree, proto_mac_mgmt_msg_res_cmd_decoder, tvb, offset, tlv_len, "CMAC Tuple");
wimax_cmac_tuple_decoder(tlv_tree, tvb, offset+tlv_value_offset, tlv_len);
break;
default:
/* display the unknown tlv in hex */
add_tlv_subtree(&tlv_info, res_cmd_tree, hf_res_cmd_unknown_type, tvb, offset, ENC_NA);
break;
}
offset += (tlv_len+tlv_value_offset);
} /* end of TLV process while loop */
}
return tvb_captured_length(tvb);
}
/* 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_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));
res_cmd_handle = register_dissector("mac_mgmt_msg_res_handler", dissect_mac_mgmt_msg_res_cmd_decoder, proto_mac_mgmt_msg_res_cmd_decoder);
}
void
proto_reg_handoff_mac_mgmt_msg_res_cmd(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_RES_CMD, res_cmd_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_rng_req.c | /* msg_rng_req.c
* WiMax MAC Management RNG-REQ Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: John R. Underwood <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
void proto_register_mac_mgmt_msg_rng_req(void);
void proto_reg_handoff_mac_mgmt_msg_rng_req(void);
static dissector_handle_t rng_req_handle;
extern gboolean include_cor2_changes;
static gint proto_mac_mgmt_msg_rng_req_decoder = -1;
static gint ett_mac_mgmt_msg_rng_req_decoder = -1;
/* RNG-REQ fields */
static gint hf_rng_req_reserved = -1;
static gint hf_rng_req_dl_burst_profile_diuc = -1;
static gint hf_rng_req_dl_burst_profile_lsb_ccc = -1;
static gint hf_rng_req_ss_mac_address = -1;
static gint hf_rng_req_ranging_anomalies_max_power = -1;
static gint hf_rng_req_ranging_anomalies_min_power = -1;
static gint hf_rng_req_ranging_anomalies_timing_adj = -1;
static gint hf_rng_req_aas_broadcast = -1;
static gint hf_rng_req_serving_bs_id = -1;
static gint hf_rng_req_ranging_purpose_ho_indication = -1;
static gint hf_rng_req_ranging_purpose_location_update_request = -1;
static gint hf_rng_req_ranging_purpose_reserved = -1;
static gint hf_rng_req_ho_id = -1;
static gint hf_rng_req_power_down_indicator = -1;
static gint hf_rng_req_repetition_coding_level = -1;
static gint hf_rng_req_requested_downlink_repetition_coding_level_reserved = -1;
static gint hf_rng_req_cmac_key_count = -1;
static gint hf_rng_definition_of_power_saving_class_present = -1;
static gint hf_rng_activation_of_power_saving_class = -1;
static gint hf_rng_trf_ind_required = -1;
static gint hf_rng_power_saving_class_reserved = -1;
static gint hf_rng_power_saving_class_id = -1;
static gint hf_rng_power_saving_class_type = -1;
static gint hf_rng_power_saving_first_sleep_window_frame = -1;
static gint hf_rng_power_saving_initial_sleep_window = -1;
static gint hf_rng_power_saving_listening_window = -1;
static gint hf_rng_power_saving_final_sleep_window_base = -1;
static gint hf_rng_power_saving_final_sleep_window_exp = -1;
static gint hf_rng_power_saving_slpid = -1;
static gint hf_rng_power_saving_included_cid = -1;
static gint hf_rng_power_saving_mgmt_connection_direction = -1;
static gint hf_tlv_type = -1;
static gint hf_rng_invalid_tlv = -1;
static gint hf_rng_power_saving_class_flags = -1;
static gint hf_rng_req_dl_burst_profile = -1;
static gint hf_rng_req_ranging_anomalies = -1;
static gint hf_rng_req_ranging_purpose_indication = -1;
static gint hf_rng_req_requested_rep_coding_level = -1;
/* STRING RESOURCES */
static const true_false_string tfs_rng_req_aas_broadcast = {
"SS cannot receive broadcast messages",
"SS can receive broadcast messages"
};
static const value_string vals_rng_req_ranging_purpose_location_update_request[] = {
{1, "MS action of Idle Mode Location Update Process"},
{0, NULL}
};
static const value_string vals_rng_req_repetition_coding_level[] = {
{0, "No repetition"},
{1, "Repetition coding of 2"},
{2, "Repetition coding of 4"},
{3, "Repetition coding of 6"},
{0, NULL}
};
static const true_false_string tfs_rng_activate = {
"Activate",
"Deactivate"
};
static const true_false_string tfs_rng_max_power = {
"SS is already at maximum power",
"SS is not at maximum power"
};
static const true_false_string tfs_rng_min_power = {
"SS is already at minimum power",
"SS is not at minimum power"
};
static const true_false_string tfs_rng_timing_adj = {
"Sum of commanded timing adjustments is too large",
"Sum of commanded timing adjustments is within bounds"
};
/* Decode RNG Power Saving Class parameters (Sub TLV's). */
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)
{
proto_item *tlv_item;
proto_tree *tlv_tree;
proto_tree *power_saving_class_tree = NULL;
guint tlv_len;
guint tlv_offset;
tlv_info_t tlv_info;
/* Add a subtree for the power saving class parameters */
tlv_item = proto_tree_add_protocol_format(rng_req_tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, offset, compound_tlv_len, "Power saving class parameters (%u bytes)", compound_tlv_len);
power_saving_class_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rng_req_decoder);
/* Update the compound_tlv_len to include the offset */
compound_tlv_len += offset;
while(offset < compound_tlv_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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RNG-REQ TLV error");
proto_tree_add_item(power_saving_class_tree, hf_rng_invalid_tlv, tvb, offset, (compound_tlv_len - offset), ENC_NA);
break;
}
/* get the offset to the TLV data */
tlv_offset = offset + get_tlv_value_offset(&tlv_info);
switch (tlv_type) {
case RNG_POWER_SAVING_CLASS_FLAGS:
/* display Power Saving Class Flags */
/* add subtree */
tlv_item = add_tlv_subtree(&tlv_info, power_saving_class_tree, hf_rng_power_saving_class_flags, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rng_req_decoder);
proto_tree_add_item(tlv_tree, hf_rng_definition_of_power_saving_class_present, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_rng_activation_of_power_saving_class, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_rng_trf_ind_required, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_rng_power_saving_class_reserved, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case RNG_POWER_SAVING_CLASS_ID:
add_tlv_subtree(&tlv_info, power_saving_class_tree, hf_rng_power_saving_class_id, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_POWER_SAVING_CLASS_TYPE:
add_tlv_subtree(&tlv_info, power_saving_class_tree, hf_rng_power_saving_class_type, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_START_FRAME_NUMBER:
add_tlv_subtree(&tlv_info, power_saving_class_tree, hf_rng_power_saving_first_sleep_window_frame, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_INITIAL_SLEEP_WINDOW:
add_tlv_subtree(&tlv_info, power_saving_class_tree, hf_rng_power_saving_initial_sleep_window, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_LISTENING_WINDOW:
add_tlv_subtree(&tlv_info, power_saving_class_tree, hf_rng_power_saving_listening_window, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_FINAL_SLEEP_WINDOW_BASE:
add_tlv_subtree(&tlv_info, power_saving_class_tree, hf_rng_power_saving_final_sleep_window_base, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_FINAL_SLEEP_WINDOW_EXPONENT:
add_tlv_subtree(&tlv_info, power_saving_class_tree, hf_rng_power_saving_final_sleep_window_exp, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_SLPID:
add_tlv_subtree(&tlv_info, power_saving_class_tree, hf_rng_power_saving_slpid, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_CID:
add_tlv_subtree(&tlv_info, power_saving_class_tree, hf_rng_power_saving_included_cid, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_DIRECTION:
add_tlv_subtree(&tlv_info, power_saving_class_tree, hf_rng_power_saving_mgmt_connection_direction, tvb, offset, ENC_BIG_ENDIAN);
break;
default:
add_tlv_subtree(&tlv_info, power_saving_class_tree, hf_tlv_type, tvb, offset, ENC_NA);
break;
}
/* update the offset */
offset = tlv_len + tlv_offset;
} /* end of TLV process while loop */
}
/* Decode RNG-REQ messages. */
static int dissect_mac_mgmt_msg_rng_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tlv_offset;
guint tvb_len;
proto_item *rng_req_item, *tlv_item;
proto_tree *rng_req_tree, *tlv_tree;
tlv_info_t tlv_info;
gint tlv_type;
gint tlv_len;
{ /* 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");
/* 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_reserved, tvb, 0, 1, ENC_BIG_ENDIAN);
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 */
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), ENC_NA);
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_item = add_tlv_subtree(&tlv_info, rng_req_tree, hf_rng_req_dl_burst_profile, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rng_req_decoder);
proto_tree_add_item(tlv_tree, hf_rng_req_dl_burst_profile_diuc, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_rng_req_dl_burst_profile_lsb_ccc, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case RNG_REQ_SS_MAC_ADDRESS:
add_tlv_subtree(&tlv_info, rng_req_tree, hf_rng_req_ss_mac_address, tvb, offset, ENC_NA);
break;
case RNG_REQ_RANGING_ANOMALIES:
tlv_item = add_tlv_subtree(&tlv_info, rng_req_tree, hf_rng_req_ranging_anomalies, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rng_req_decoder);
proto_tree_add_item(tlv_tree, hf_rng_req_ranging_anomalies_max_power, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_rng_req_ranging_anomalies_min_power, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_rng_req_ranging_anomalies_timing_adj, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case RNG_REQ_AAS_BROADCAST:
add_tlv_subtree(&tlv_info, rng_req_tree, hf_rng_req_aas_broadcast, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_REQ_SERVING_BS_ID:
add_tlv_subtree(&tlv_info, rng_req_tree, hf_rng_req_serving_bs_id, tvb, offset, ENC_NA);
break;
case RNG_REQ_RANGING_PURPOSE_INDICATION:
/* display the Ranging Purpose Flags */
tlv_item = add_tlv_subtree(&tlv_info, rng_req_tree, hf_rng_req_ranging_purpose_indication, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rng_req_decoder);
proto_tree_add_item(tlv_tree, hf_rng_req_ranging_purpose_ho_indication, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_rng_req_ranging_purpose_location_update_request, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_rng_req_ranging_purpose_reserved, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case RNG_REQ_HO_ID:
add_tlv_subtree(&tlv_info, rng_req_tree, hf_rng_req_ho_id, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_REQ_POWER_DOWN_INDICATOR:
add_tlv_subtree(&tlv_info, rng_req_tree, hf_rng_req_power_down_indicator, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_REQ_REQUESTED_DNLK_REP_CODING_LEVEL:
tlv_item = add_tlv_subtree(&tlv_info, rng_req_tree, hf_rng_req_requested_rep_coding_level, tvb, offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_rng_req_decoder);
proto_tree_add_item(tlv_tree, hf_rng_req_repetition_coding_level, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_rng_req_requested_downlink_repetition_coding_level_reserved, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case RNG_REQ_CMAC_KEY_COUNT:
if (include_cor2_changes) {
add_tlv_subtree(&tlv_info, rng_req_tree, hf_rng_req_cmac_key_count, tvb, offset, ENC_BIG_ENDIAN);
} else {
/* Unknown TLV type */
add_tlv_subtree(&tlv_info, rng_req_tree, hf_tlv_type, tvb, offset, ENC_NA);
}
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, offset, tlv_len, "Short HMAC Tuple");
wimax_short_hmac_tuple_decoder(tlv_tree, tvb, tlv_offset, tvb_len - offset);
} else {
/* Unknown TLV Type */
add_tlv_subtree(&tlv_info, rng_req_tree, hf_tlv_type, tvb, offset, ENC_NA);
}
break;
case MAC_VERSION_ENCODING:
offset += wimax_common_tlv_encoding_decoder(tvb_new_subset_remaining(tvb, 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, offset, tlv_len, "Power Saving Class Parameters");
dissect_power_saving_class(tlv_tree, tlv_type, tvb, tlv_len, pinfo, tlv_offset);
break;
default:
add_tlv_subtree(&tlv_info, rng_req_tree, hf_tlv_type, tvb, offset, ENC_NA);
break;
}
/* update the offset */
offset = tlv_len + tlv_offset;
} /* end of TLV process while loop */
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_rng_req(void)
{
/* RNG-REQ fields display */
static hf_register_info hf[] =
{
{
&hf_rng_activation_of_power_saving_class,
{
"Activation of Power Saving Class (Types 1 and 2 only)", "wmx.rng.power_save.activate",
FT_BOOLEAN, 8, TFS(&tfs_rng_activate), 0x02, NULL, HFILL
}
},
{
&hf_rng_power_saving_class_id,
{
"Power Saving Class ID", "wmx.rng.power_save.class_id",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_power_saving_class_type,
{
"Power Saving Class Type", "wmx.rng.power_save.class_type",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_definition_of_power_saving_class_present,
{
"Definition of Power Saving Class present", "wmx.rng.power_save.definition_present",
FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL
}
},
{
&hf_rng_power_saving_final_sleep_window_base,
{
"Final-sleep window base (measured in frames)", "wmx.rng.power_save.final_sleep_window_base",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_power_saving_final_sleep_window_exp,
{
"Final-sleep window exponent (measured in frames)", "wmx.rng.power_save.final_sleep_window_exp",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_power_saving_first_sleep_window_frame,
{
"Start frame number for first sleep window", "wmx.rng.power_save.first_sleep_window_frame",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_power_saving_included_cid,
{
"CID of connection to be included into the Power Saving Class.", "wmx.rng.power_save.included_cid",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_power_saving_initial_sleep_window,
{
"Initial-sleep window", "wmx.rng.power_save.initial_sleep_window",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_power_saving_listening_window,
{
"Listening window duration (measured in frames)", "wmx.rng.power_save.listening_window",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_power_saving_mgmt_connection_direction,
{
"Direction for management connection added to Power Saving Class", "wmx.rng.power_save.mgmt_connection_direction",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_power_saving_class_reserved,
{
"Reserved", "wmx.rng.power_save.reserved",
FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL
}
},
{
&hf_rng_power_saving_slpid,
{
"SLPID assigned by the BS whenever an MS is instructed to enter sleep mode", "wmx.rng.power_save.slpid",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_trf_ind_required,
{
"BS shall transmit at least one TRF-IND message during each listening window of the Power Saving Class", "wmx.rng.power_save.trf_ind_required",
FT_BOOLEAN, 8, TFS(&tfs_rng_activate), 0x04, NULL, HFILL
}
},
{
&hf_rng_req_aas_broadcast,
{
"AAS broadcast capability", "wmx.rng_req.aas_broadcast",
FT_BOOLEAN, BASE_NONE, TFS(&tfs_rng_req_aas_broadcast), 0x0, NULL, HFILL
}
},
{
&hf_rng_req_ranging_anomalies_max_power,
{
"Meaning", "wmx.rng_req.anomalies.max_power",
FT_BOOLEAN, 8, TFS(&tfs_rng_max_power), 0x04, NULL, HFILL
}
},
{
&hf_rng_req_ranging_anomalies_min_power,
{
"Meaning", "wmx.rng_req.anomalies.min_power",
FT_BOOLEAN, 8, TFS(&tfs_rng_min_power), 0x02, NULL, HFILL
}
},
{
&hf_rng_req_ranging_anomalies_timing_adj,
{
"Meaning", "wmx.rng_req.anomalies.timing_adj",
FT_BOOLEAN, 8, TFS(&tfs_rng_timing_adj), 0x01, NULL, HFILL
}
},
{
&hf_rng_req_cmac_key_count,
{
"CMAC Key Count", "wmx.rng_req.cmac_key_count",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_req_dl_burst_profile_lsb_ccc,
{
"LSB of CCC of DCD associated with DIUC", "wmx.rng_req.dl_burst_profile.ccc",
FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL
}
},
{
&hf_rng_req_dl_burst_profile_diuc,
{
"DIUC", "wmx.rng_req.dl_burst_profile.diuc",
FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL
}
},
{
&hf_tlv_type,
{
"Unknown TLV Type", "wmx.rng_req.unknown_tlv_type",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
}
},
{
&hf_rng_invalid_tlv,
{
"Invalid TLV", "wmx.rng_req.invalid_tlv",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
}
},
{
&hf_rng_req_ho_id,
{
"ID from the target BS for use in initial ranging during MS handover to it", "wmx.rng_req.ho_id",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_req_power_down_indicator,
{
"Power down Indicator", "wmx.rng_req.power_down_indicator",
FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_req_ranging_purpose_ho_indication,
{
"MS HO indication", "wmx.rng_req.ranging_purpose.ho_indication",
FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL
}
},
{
&hf_rng_req_ranging_purpose_reserved,
{
"Reserved", "wmx.rng_req.ranging_purpose.reserved",
FT_UINT8, BASE_DEC, NULL, 0xFC, NULL, HFILL
}
},
{
&hf_rng_req_ranging_purpose_location_update_request,
{
"Location Update Request", "wmx.rng_req.ranging_purpose.loc_update_req",
FT_UINT8, BASE_DEC, VALS(vals_rng_req_ranging_purpose_location_update_request), 0x02, NULL, HFILL
}
},
{
&hf_rng_req_repetition_coding_level,
{
"Repetition coding level", "wmx.rng_req.repetition_coding_level",
FT_UINT8, BASE_DEC, VALS(vals_rng_req_repetition_coding_level), 0x03, NULL, HFILL
}
},
{
&hf_rng_req_requested_downlink_repetition_coding_level_reserved,
{
"Reserved", "wmx.rng_req.reserved",
FT_UINT8, BASE_DEC, NULL, 0xFC, NULL, HFILL
}
},
{
&hf_rng_req_reserved,
{
"Reserved", "wmx.rng_req.reserved",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_req_serving_bs_id,
{
"Former serving BS ID", "wmx.rng_req.serving_bs_id",
FT_ETHER, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_req_ss_mac_address,
{
"SS MAC Address", "wmx.rng_req.ss_mac_address",
FT_ETHER, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_power_saving_class_flags,
{
"Power Saving Class", "wmx.rng.power_save.flags",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_req_dl_burst_profile,
{
"Requested Downlink Burst Profile", "wmx.rng_req.dl_burst_profile",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_req_ranging_anomalies,
{
"Ranging Anomalies", "wmx.rng_req.anomalies",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_req_ranging_purpose_indication,
{
"Ranging Purpose Flags", "wmx.rng_req.ranging_purpose.indication",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_req_requested_rep_coding_level,
{
"Requested downlink repetition coding level", "wmx.rng_req.requested_rep_coding_level",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_mgmt_msg_rng_req_decoder,
};
proto_mac_mgmt_msg_rng_req_decoder = proto_register_protocol (
"WiMax RNG-REQ Messages", /* name */
"WiMax RNG-REQ", /* short name */
"wmx.rng_req" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_rng_req_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
rng_req_handle = register_dissector("mac_mgmt_msg_rng_req_handler", dissect_mac_mgmt_msg_rng_req_decoder, proto_mac_mgmt_msg_rng_req_decoder);
}
void proto_reg_handoff_mac_mgmt_msg_rng_req(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_RNG_REQ, rng_req_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_rng_rsp.c | /* msg_rng_rsp.c
* WiMax MAC Management RNG-RSP Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: John R. Underwood <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
void proto_register_mac_mgmt_msg_rng_rsp(void);
void proto_reg_handoff_mac_mgmt_msg_rng_rsp(void);
extern gboolean include_cor2_changes;
static dissector_handle_t rng_rsp_handle = NULL;
static dissector_handle_t sbc_rsp_handle = NULL;
static dissector_handle_t reg_rsp_handle = NULL;
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;
/* RNG-RSP fields */
static gint hf_rng_req_reserved = -1;
/* static gint hf_rng_rsp_ul_channel_id = -1; */
static gint hf_rng_rsp_timing_adjust = -1;
static gint hf_rng_rsp_power_level_adjust = -1;
static gint hf_rng_rsp_offset_freq_adjust = -1;
static gint hf_rng_rsp_ranging_status = -1;
static gint hf_rng_rsp_dl_freq_override = -1;
static gint hf_rng_rsp_ul_chan_id_override = -1;
static gint hf_rng_rsp_dl_operational_burst_profile = -1;
static gint hf_rng_rsp_dl_operational_burst_profile_diuc = -1;
static gint hf_rng_rsp_dl_operational_burst_profile_ccc = -1;
static gint hf_rng_rsp_ss_mac_address = -1;
static gint hf_rng_rsp_basic_cid = -1;
static gint hf_rng_rsp_primary_mgmt_cid = -1;
static gint hf_rng_rsp_broadcast = -1;
static gint hf_rng_rsp_frame_number = -1;
static gint hf_rng_rsp_opportunity_number = -1;
static gint hf_rng_rsp_service_level_prediction = -1;
static gint hf_rng_rsp_resource_retain_flag = -1;
static gint hf_rng_rsp_ho_process_optimization = -1;
static gint hf_rng_rsp_ho_process_optimization_0 = -1;
static gint hf_rng_rsp_ho_process_optimization_1_2 = -1;
static gint hf_rng_rsp_ho_process_optimization_3 = -1;
static gint hf_rng_rsp_ho_process_optimization_4 = -1;
static gint hf_rng_rsp_ho_process_optimization_5 = -1;
static gint hf_rng_rsp_ho_process_optimization_6 = -1;
static gint hf_rng_rsp_ho_process_optimization_7 = -1;
static gint hf_rng_rsp_ho_process_optimization_8 = -1;
static gint hf_rng_rsp_ho_process_optimization_9 = -1;
static gint hf_rng_rsp_ho_process_optimization_10 = -1;
static gint hf_rng_rsp_ho_process_optimization_11 = -1;
static gint hf_rng_rsp_ho_process_optimization_12 = -1;
static gint hf_rng_rsp_ho_process_optimization_13 = -1;
static gint hf_rng_rsp_ho_process_optimization_14 = -1;
static gint hf_rng_rsp_ho_process_optimization_15 = -1;
/* Added the following to help implement RNG-RSP message encoding 33 (Table 367 in IEEE 802.16e-2007) */
static gint hf_rng_rsp_dl_op_burst_profile_ofdma = -1;
static gint hf_rng_rsp_least_robust_diuc = -1;
static gint hf_rng_rsp_repetition_coding_indication = -1;
static gint hf_rng_rsp_config_change_count_of_dcd = -1;
/* Added the following to help implement RNG-RSP message encoding 22 (Table 367 in IEEE 802.16e-2007) */
static gint hf_rng_rsp_ho_id = -1;
static gint hf_rng_rsp_location_update_response = -1;
/* Added the following to help implement RNG-RSP message encoding 24 (Table 367 in IEEE 802.16e-2007) */
static gint hf_rng_rsp_paging_information = -1;
static gint hf_rng_rsp_paging_cycle = -1;
static gint hf_rng_rsp_paging_offset = -1;
static gint hf_rng_rsp_paging_group_id = -1;
static gint hf_rng_rsp_bs_random = -1;
static gint hf_rng_rsp_akid = -1;
static gint hf_rng_rsp_ranging_subchan = -1;
static gint hf_rng_rsp_time_symbol_reference = -1;
static gint hf_rng_rsp_subchannel_reference = -1;
static gint hf_rng_rsp_ranging_code_index = -1;
static gint hf_rng_rsp_frame_number2 = -1;
static gint hf_tlv_type = -1;
/* static gint hf_tlv_value = -1; */
static gint hf_rng_invalid_tlv = -1;
/* STRING RESOURCES */
static const true_false_string tfs_rng_rsp_aas_broadcast = {
"SS shall not issue contention-based Bandwidth Request",
"SS may issue contention-based Bandwidth Request"
};
static const true_false_string tfs_rng_rsp_resource_retain_flag = {
"Retained by the BS",
"Deleted by the BS"
};
static const value_string vals_rng_rsp_ranging_status[] = {
{1, "continue"},
{2, "abort"},
{3, "success"},
{4, "rerange"},
{0, NULL}
};
static const value_string vals_rng_rsp_level_of_service[] = {
{0, "No service possible for this MS"},
{1, "Some service is available for one or"
" several service flows authorized for the MS"},
{2, "For each authorized service flow, a MAC"
" connection can be established with QoS"
" specified by the AuthorizedQoSParamSet"},
{3, "No service level prediction available"},
{0, NULL}
};
static const value_string vals_rng_rsp_ho_process_optimization_0[] = {
{0, "SBC-REQ management messages during current re-entry"
" processing required"},
{1, "Omit SBC-REQ management messages during current"
" re-entry processing"},
{0, NULL},
};
static const value_string vals_rng_rsp_ho_process_optimization_1_2[] = {
{0, "Perform re-authentication and SA-TEK 3-way handshake."
" BS should include SA-TEK-Update TLV in the"
" SA-TEK-Response message. In addition, the RNG-RSP"
" message does not include SA-TEK-Update TLV or SA"
" Challenge Tuple TLV."},
{1, "SA-TEK-Update TLV is included in the RNG-RSP message."
" In this case, SA-TEK 3-way handshake is avoided and"
" SA Challenge Tuple TLV shall not be included in the"
" RNG-RSP message."},
{2, "Reserved"},
{3, "Re-authentication and SA-TEK 3-way handshake is not"
" performed. The RNG-RSP message does not include"
" SA-TEK-Update TLV nor SA Challenge Tuple TLV. All the"
" TEKs received from the serving BS are reused"},
{0, NULL}
};
static const value_string vals_rng_rsp_ho_process_optimization_3[] = {
{0, "Network Address Acquisition management messages during"
" current reentry processing required"},
{1, "Omit Network Address Acquisition management messages"
" during current reentry processing"},
{0, NULL}
};
static const value_string vals_rng_rsp_ho_process_optimization_4[] = {
{0, "Time of Day Acquisition management messages during"
" current reentry processing required"},
{1, "Omit Time of Day Acquisition management messages"
" during current reentry processing"},
{0, NULL}
};
static const value_string vals_rng_rsp_ho_process_optimization_5[] = {
{0, "TFTP management messages during current re-entry"
" processing required"},
{1, "Omit TFTP management messages during current re-entry"
" processing"},
{0, NULL}
};
static const value_string vals_rng_rsp_ho_process_optimization_6[] = {
{0, "Full service and operational state transfer or sharing"
" between Serving BS and Target BS required"},
{1, "Omit Full service and operational state transfer or"
" sharing between Serving BS and Target BS"},
{0, NULL}
};
static const value_string vals_rng_rsp_ho_process_optimization_7[] = {
{0, "REG-REQ management message during current re-entry"
" processing required"},
{1, "Omit REG-REQ management message during current re-entry"
" processing"},
{0, NULL}
};
static const value_string vals_rng_rsp_ho_process_optimization_8[] = {
{0, "BS shall send not send an unsolicited SBC-RSP"
" management message"},
{1, "BS shall send an unsolicited SBC-RSP management message"},
{0, NULL}
};
static const value_string vals_rng_rsp_ho_process_optimization_9[] = {
{0, "No post-HO re-entry MS DL data pending at target BS"},
{1, "post-HO re-entry MS DL data pending at target BS"},
{0, NULL}
};
static const value_string vals_rng_rsp_ho_process_optimization_10[] = {
{0, "BS shall not send an unsolicited REG-RSP management"
" message"},
{1, "BS shall send an unsolicited REG-RSP management message"},
{0, NULL}
};
static const value_string vals_rng_rsp_ho_process_optimization_11[] = {
{0, "(Target) BS does not support virtual SDU SN"},
{1, "(Target} BS supports virtual SDU SN"},
{0, NULL}
};
static const value_string vals_rng_rsp_ho_process_optimization_12[] = {
{0, "MS shall not send a notification of MS's successful"
" re-entry registration"},
{1, "MS shall send a notification of MS's successful"
" re-entry registration"},
{0, NULL}
};
static const value_string vals_rng_rsp_ho_process_optimization_13[] = {
{0, "MS shall not trigger a higher layer protocol required"
" to refresh its traffic IP address"},
{1, "MS shall trigger a higher layer protocol required to"
" refresh its traffic IP address"},
{0, NULL}
};
static const value_string vals_rng_rsp_repetition_coding_indication[] = {
{0, "No repetition coding"},
{1, "Repetition coding of 2"},
{2, "Repetition coding of 4"},
{3, "Repetition coding of 6"},
{0, NULL}
};
static const value_string vals_rng_rsp_location_update_response[] = {
{0, "Success of Location Update"},
{1, "Failure of Location Update"},
{3, "Success of location update and DL traffic pending"},
{4, "Reserved"},
{0, NULL}
};
/* Decode RNG-RSP messages. */
static int dissect_mac_mgmt_msg_rng_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
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;
proto_item *rng_rsp_item, *sub_item;
proto_item *tlv_item = NULL;
proto_tree *rng_rsp_tree;
proto_tree *sub_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;
{ /* 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");
/* add MAC RNG-RSP subtree */
rng_rsp_tree = proto_item_add_subtree(rng_rsp_item, ett_mac_mgmt_msg_rng_rsp_decoder);
proto_tree_add_item(rng_rsp_tree, hf_rng_req_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
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 */
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), ENC_NA);
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_tlv_subtree_no_item(&tlv_info, rng_rsp_tree, hf_rng_rsp_timing_adjust, tvb, offset);
timing_adjust = (float)(tvb_get_ntohl(tvb, tlv_offset) / 4.0);
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_tlv_subtree_no_item(&tlv_info, rng_rsp_tree, hf_rng_rsp_power_level_adjust, tvb, offset);
power_level_adjust = (float)(tvb_get_guint8(tvb, tlv_offset) / 4.0);
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: {
add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_offset_freq_adjust, tvb, offset, ENC_BIG_ENDIAN);
break;
}
case RNG_RSP_RANGING_STATUS:
ranging_status_item = add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_ranging_status, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_RSP_DL_FREQ_OVERRIDE: {
dl_freq_override_item = add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_dl_freq_override, tvb, offset, ENC_BIG_ENDIAN);
break;
}
case RNG_RSP_UL_CHANNEL_ID_OVERRIDE:
add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_ul_chan_id_override, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_RSP_DL_OPERATIONAL_BURST_PROFILE:
sub_item = add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_dl_operational_burst_profile, tvb, offset, ENC_BIG_ENDIAN);
sub_tree = proto_item_add_subtree(sub_item, ett_rng_rsp_message_tree);
proto_tree_add_item(sub_tree, hf_rng_rsp_dl_operational_burst_profile_diuc, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_dl_operational_burst_profile_ccc, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
break;
case RNG_RSP_SS_MAC_ADDRESS:
if (tlv_len == 6)
{
ss_mac_address_item = add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_ss_mac_address, tvb, offset, ENC_NA);
} else {
add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_invalid_tlv, tvb, offset, ENC_NA);
}
break;
case RNG_RSP_BASIC_CID:
add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_basic_cid, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_RSP_PRIMARY_MGMT_CID:
add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_primary_mgmt_cid, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_RSP_AAS_BROADCAST_PERMISSION:
add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_broadcast, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_RSP_FRAME_NUMBER:
frame_number_item = add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_frame_number, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_RSP_OPPORTUNITY_NUMBER:
opportunity_number_item = add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_opportunity_number, tvb, offset, ENC_BIG_ENDIAN);
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:
add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_service_level_prediction, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_RSP_RESOURCE_RETAIN_FLAG:
add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_resource_retain_flag, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_RSP_HO_PROCESS_OPTIMIZATION:
sub_item = add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_ho_process_optimization, tvb, offset, ENC_BIG_ENDIAN);
sub_tree = proto_item_add_subtree(sub_item, ett_rng_rsp_message_tree);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_0, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_1_2, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_3, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_4, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_5, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_6, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_7, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_8, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_9, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_10, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_11, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_12, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_13, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_14, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ho_process_optimization_15, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
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, offset, tlv_len, "SBC-RSP Encodings");
call_dissector(sbc_rsp_handle, tvb_new_subset_length(tvb, tlv_offset, 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, offset, tlv_len, "REG-RSP Encodings");
call_dissector(reg_rsp_handle, tvb_new_subset_length(tvb, tlv_offset, 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_item = add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_dl_op_burst_profile_ofdma, tvb, offset, ENC_BIG_ENDIAN);
sub_tree = proto_item_add_subtree(sub_item, ett_rng_rsp_message_tree);
proto_tree_add_item(sub_tree, hf_rng_rsp_least_robust_diuc, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_repetition_coding_indication, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_config_change_count_of_dcd, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
break;
case RNG_RSP_HO_ID:
add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_ho_id, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_RSP_LOCATION_UPDATE_RESPONSE:
add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_location_update_response, tvb, offset, ENC_BIG_ENDIAN);
break;
case RNG_RSP_PAGING_INFORMATION:
sub_item = add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_paging_information, tvb, offset, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_rng_rsp_message_tree);
proto_tree_add_item(sub_tree, hf_rng_rsp_paging_cycle, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_paging_offset, tvb, tlv_offset+2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_paging_group_id, tvb, tlv_offset+3, 2, ENC_BIG_ENDIAN);
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, offset, tlv_len, "Power Saving Class Parameters");
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, offset, tlv_len, "SA Challenge Tuple");
/* 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 */
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 - tlv_offset), ENC_NA);
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:
add_tlv_subtree(&sub_tlv_info, sub_tree, hf_rng_rsp_bs_random, tvb, this_offset, ENC_NA);
break;
case RNG_RSP_SA_CHALLENGE_AKID:
add_tlv_subtree(&sub_tlv_info, sub_tree, hf_rng_rsp_akid, tvb, this_offset, ENC_NA);
break;
default:
add_tlv_subtree(&sub_tlv_info, sub_tree, hf_tlv_type, tvb, this_offset, ENC_NA);
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, offset, tlv_len, "Uplink QOS Parameters");
/* decode and display the DL Service Flow Encodings */
wimax_service_flow_encodings_decoder(tvb_new_subset_length(tvb, tlv_offset, 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, offset, tlv_len, "Downlink QOS Parameters");
/* decode and display the DL Service Flow Encodings */
wimax_service_flow_encodings_decoder(tvb_new_subset_length(tvb, tlv_offset, tlv_len), pinfo, sub_tree);
break;
case RNG_RSP_RANGING_CODE_ATTRIBUTES:
/* case SHORT_HMAC_TUPLE: */
sub_item = add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_rng_rsp_ranging_subchan, tvb, offset, ENC_BIG_ENDIAN);
sub_tree = proto_item_add_subtree(sub_item, ett_rng_rsp_message_tree);
proto_tree_add_item(sub_tree, hf_rng_rsp_time_symbol_reference, tvb, tlv_offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_subchannel_reference, tvb, tlv_offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_ranging_code_index, tvb, tlv_offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_rng_rsp_frame_number2, tvb, tlv_offset, 4, ENC_BIG_ENDIAN);
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, offset, tlv_len, "Short HMAC Tuple");
wimax_short_hmac_tuple_decoder(sub_tree, tvb, tlv_offset, tvb_len - offset);
} else {
/* Unknown TLV type */
add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_tlv_type, tvb, offset, ENC_NA);
}
break;
default:
add_tlv_subtree(&tlv_info, rng_rsp_tree, hf_tlv_type, tvb, offset, ENC_NA);
break;
}
offset = tlv_len + tlv_offset;
} /* end of TLV process while loop */
/*
* XXX - these should probably be expert info items.
*/
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!)");
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_rng_rsp(void)
{
/* RNG-RSP fields display */
static hf_register_info hf[] =
{
{
&hf_rng_rsp_broadcast,
{
"AAS broadcast permission", "wmx.rng_rsp.aas_broadcast",
FT_BOOLEAN, BASE_NONE, TFS(&tfs_rng_rsp_aas_broadcast), 0x0, NULL, HFILL
}
},
{
&hf_rng_rsp_akid,
{
"AKId", "wmx.rng_rsp.akid",
FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_basic_cid,
{
"Basic CID", "wmx.rng_rsp.basic_cid",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_bs_random,
{
"BS_Random", "wmx.rng_rsp.bs_random",
FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_config_change_count_of_dcd,
{
"Configuration Change Count value of DCD defining DIUC associated burst profile", "wmx.rng_rsp.config_change_count_of_dcd",
FT_UINT16, BASE_HEX, NULL, 0xFF00, NULL, HFILL
}
},
{
&hf_rng_rsp_dl_freq_override,
{
"Downlink Frequency Override", "wmx.rng_rsp.dl_freq_override",
FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &wimax_units_hz, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_dl_operational_burst_profile_ccc,
{
"CCC value of DCD defining the burst profile associated with DIUC", "wmx.rng_rsp.dl_op_burst_prof.ccc",
FT_UINT16, BASE_DEC, NULL, 0x00FF, NULL, HFILL
}
},
{
&hf_rng_rsp_dl_operational_burst_profile_diuc,
{
"The least robust DIUC that may be used by the BS for transmissions to the SS", "wmx.rng_rsp.dl_op_burst_prof.diuc",
FT_UINT16, BASE_DEC, NULL, 0xFF00, NULL, HFILL
}
},
{
&hf_rng_rsp_dl_operational_burst_profile,
{
"Downlink Operational Burst Profile", "wmx.rng_rsp.dl_op_burst_profile",
FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
/* Added the following to help implement RNG-RSP message encoding 33 (Table 367 in IEEE 802.16e-2007) */
{
&hf_rng_rsp_dl_op_burst_profile_ofdma,
{
"Downlink Operational Burst Profile for OFDMA", "wmx.rng_rsp.dl_op_burst_profile_ofdma",
FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_frame_number2,
{
"The 8 least significant bits of the frame number of the OFDMA frame where the SS sent the ranging code", "wmx.rng_rsp.eight_bit_frame_num",
FT_UINT32, BASE_DEC, NULL, 0x000000FF, NULL, HFILL
}
},
{
&hf_rng_rsp_frame_number,
{
"Frame number", "wmx.rng_rsp.frame_number",
FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
/* Added the following to help implement RNG-RSP message encoding 22 (IEEE 802.16e-2007) */
{
&hf_rng_rsp_ho_id,
{
"HO ID", "wmx.rng_rsp.ho_id",
FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization,
{
"HO Process Optimization", "wmx.rng_rsp.ho_process_optimization",
FT_UINT16, BASE_HEX, NULL, 0x0000, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_0,
{
"Bit #0", "wmx.rng_rsp.ho_process_optimization.omit_sbc_req",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_0), 0x0001, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_1_2,
{
"Bits #1-2", "wmx.rng_rsp.ho_process_optimization.perform_reauthentication",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_1_2), 0x0006, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_3,
{
"Bit #3", "wmx.rng_rsp.ho_process_optimization.omit_network_address",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_3), 0x0008, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_4,
{
"Bit #4", "wmx.rng_rsp.ho_process_optimization.omit_time_of_day",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_4), 0x0010, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_5,
{
"Bit #5", "wmx.rng_rsp.ho_process_optimization.omit_tftp",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_5), 0x0020, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_6,
{
"Bit #6", "wmx.rng_rsp.ho_process_optimization.transfer_or_sharing",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_6), 0x0040, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_7,
{
"Bit #7", "wmx.rng_rsp.ho_process_optimization.omit_reg_req",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_7), 0x0080, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_8,
{
"Bit #8", "wmx.rng_rsp.ho_process_optimization.unsolicited_sbc_rsp",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_8), 0x0100, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_9,
{
"Bit #9", "wmx.rng_rsp.ho_process_optimization.post_ho_reentry",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_9), 0x0200, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_10,
{
"Bit #10", "wmx.rng_rsp.ho_process_optimization.unsolicited_reg_rsp",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_10), 0x0400, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_11,
{
"Bit #11", "wmx.rng_rsp.ho_process_optimization.virtual_sdu_sn",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_11), 0x0800, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_12,
{
"Bit #12", "wmx.rng_rsp.ho_process_optimization.send_notification",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_12), 0x1000, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_13,
{
"Bit #13", "wmx.rng_rsp.ho_process_optimization.trigger_higher_layer_protocol",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_ho_process_optimization_13), 0x2000, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_14,
{
"Bit #14: Reserved", "wmx.rng_rsp.ho_process_optimization.reserved",
FT_UINT16, BASE_HEX, NULL, 0x4000, NULL, HFILL
}
},
{
&hf_rng_rsp_ho_process_optimization_15,
{
"Bit #15: Reserved", "wmx.rng_rsp.ho_process_optimization.reserved",
FT_UINT16, BASE_HEX, NULL, 0x8000, NULL, HFILL
}
},
{
&hf_rng_invalid_tlv,
{
"Invalid TLV", "wmx.rng_rsp.invalid_tlv",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
}
},
{
&hf_rng_rsp_least_robust_diuc,
{
"Least Robust DIUC that may be used by the BS for transmissions to the MS", "wmx.rng_rsp.least_robust_diuc",
FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL
}
},
{
&hf_rng_rsp_location_update_response,
{
"Location Update Response", "wmx.rng_rsp.location_update_response",
FT_UINT8, BASE_DEC, VALS(vals_rng_rsp_location_update_response), 0xFF, NULL, HFILL
}
},
{
&hf_rng_rsp_offset_freq_adjust,
{
"Offset Frequency Adjust", "wmx.rng_rsp.offset_freq_adjust",
FT_INT32, BASE_DEC|BASE_UNIT_STRING, &wimax_units_hz, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_opportunity_number,
{
"Initial ranging opportunity number", "wmx.rng_rsp.opportunity_number",
FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_paging_cycle,
{
"Paging Cycle", "wmx.rng_rsp.paging_cycle",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_paging_group_id,
{
"Paging Group ID", "wmx.rng_rsp.paging_group_id",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_paging_information,
{
"Paging Information", "wmx.rng_rsp.paging_information",
FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_paging_offset,
{
"Paging Offset", "wmx.rng_rsp.paging_offset",
FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_power_level_adjust,
{
"Power Level Adjust", "wmx.rng_rsp.power_level_adjust",
FT_FLOAT, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_primary_mgmt_cid,
{
"Primary Management CID", "wmx.rng_rsp.primary_mgmt_cid",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_ranging_code_index,
{
"The ranging code index that was sent by the SS", "wmx.rng_rsp.ranging_code_index",
FT_UINT32, BASE_DEC, NULL, 0x0000FF00, NULL, HFILL
}
},
{
&hf_rng_rsp_ranging_status,
{
"Ranging status", "wmx.rng_rsp.ranging_status",
FT_UINT8, BASE_DEC, VALS(vals_rng_rsp_ranging_status), 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_ranging_subchan,
{
"Ranging code attributes", "wmx.rng_rsp.ranging_subchannel",
FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_repetition_coding_indication,
{
"Repetition Coding Indication", "wmx.rng_rsp.repetition_coding_indication",
FT_UINT16, BASE_HEX, VALS(vals_rng_rsp_repetition_coding_indication), 0x00F0, NULL, HFILL
}
},
{
&hf_rng_req_reserved,
{
"Reserved", "wmx.rng_rsp.reserved",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_rng_rsp_resource_retain_flag,
{
"The connection information for the MS is", "wmx.rng_rsp.resource_retain_flag",
FT_BOOLEAN, BASE_NONE, TFS(&tfs_rng_rsp_resource_retain_flag), 0x0, NULL, HFILL
}
},
{
&hf_rng_rsp_service_level_prediction,
{
"Service Level Prediction", "wmx.rng_rsp.service_level_prediction",
FT_UINT8, BASE_DEC, VALS(vals_rng_rsp_level_of_service), 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_ss_mac_address,
{
"SS MAC Address", "wmx.rng_rsp.ss_mac_address",
FT_ETHER, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
{
&hf_rng_rsp_subchannel_reference,
{
"OFDMA subchannel reference used to transmit the ranging code", "wmx.rng_rsp.subchannel_reference",
FT_UINT32, BASE_DEC, NULL, 0x003f0000, NULL, HFILL
}
},
{
&hf_rng_rsp_time_symbol_reference,
{
"OFDM time symbol reference used to transmit the ranging code", "wmx.rng_rsp.time_symbol_reference",
FT_UINT32, BASE_DEC, NULL, 0xFFC00000, NULL, HFILL
}
},
{
&hf_rng_rsp_timing_adjust,
{
"Timing Adjust", "wmx.rng_rsp.timing_adjust",
FT_FLOAT, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
#if 0
{
&hf_rng_rsp_ul_channel_id,
{
"Uplink Channel ID", "wmx.rng_rsp.ul_chan_id",
FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
#endif
{
&hf_rng_rsp_ul_chan_id_override,
{
"Uplink channel ID Override", "wmx.rng_rsp.ul_chan_id_override",
FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL
}
},
{
&hf_tlv_type,
{
"Unknown TLV Type", "wmx.rng_rsp.unknown_tlv_type",
FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL
}
},
#if 0
{
&hf_tlv_value,
{
"Value", "wmx.rng_rsp.tlv_value",
FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL
}
}
#endif
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_mgmt_msg_rng_rsp_decoder,
&ett_rng_rsp_message_tree
};
proto_mac_mgmt_msg_rng_rsp_decoder = proto_register_protocol (
"WiMax RNG-RSP Messages", /* name */
"WiMax RNG-RSP", /* short name */
"wmx.rng_rsp" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_rng_rsp_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
rng_rsp_handle = register_dissector("mac_mgmt_msg_rng_rsp_handler", dissect_mac_mgmt_msg_rng_rsp_decoder, proto_mac_mgmt_msg_rng_rsp_decoder);
}
void proto_reg_handoff_mac_mgmt_msg_rng_rsp(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_RNG_RSP, rng_rsp_handle);
sbc_rsp_handle = find_dissector("mac_mgmt_msg_sbc_rsp_handler");
reg_rsp_handle = find_dissector("mac_mgmt_msg_reg_rsp_handler");
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_sbc.c | /* msg_sbc.c
* WiMax MAC Management SBC-REQ/RSP Messages decoders
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#if 0
#define DEBUG /* for debug only */
#endif
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
void proto_register_mac_mgmt_msg_sbc(void);
void proto_reg_handoff_mac_mgmt_msg_sbc(void);
static dissector_handle_t sbc_req_handle;
static dissector_handle_t sbc_rsp_handle;
/* This is a global variable declared in mac_hd_generic_decoder.c, which determines whether
* or not cor2 changes are included */
extern gboolean include_cor2_changes;
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;
/* fix fields */
static gint hf_sbc_unknown_type = -1;
static gint hf_sbc_bw_alloc_support = -1;
static gint hf_sbc_bw_alloc_support_rsvd0 = -1;
static gint hf_sbc_bw_alloc_support_duplex = -1;
static gint hf_sbc_bw_alloc_support_rsvd1 = -1;
static gint hf_sbc_curr_transmit_power = -1;
static gint hf_sbc_transition_gaps = -1;
static gint hf_sbc_ssttg = -1;
static gint hf_sbc_ssrtg = -1;
static gint hf_sbc_mac_pdu = -1;
static gint hf_sbc_mac_pdu_piggybacked = -1;
static gint hf_sbc_mac_pdu_fsn = -1;
static gint hf_sbc_mac_pdu_rsvd = -1;
static gint hf_sbc_max_transmit_power = -1;
static gint hf_sbc_bpsk = -1;
static gint hf_sbc_qpsk = -1;
static gint hf_sbc_qam16 = -1;
static gint hf_sbc_qam64 = -1;
static gint hf_sbc_current_transmitted_power = -1;
static gint hf_sbc_ss_fft_sizes = -1;
static gint hf_sbc_ss_fft_256 = -1;
static gint hf_sbc_ss_fft_2048 = -1;
static gint hf_sbc_ss_fft_128 = -1;
static gint hf_sbc_ss_fft_512 = -1;
static gint hf_sbc_ss_fft_1024 = -1;
static gint hf_sbc_ss_cinr_measure_capability = -1;
static gint hf_sbc_ss_phy_cinr_measurement_preamble = -1;
static gint hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_pilot_subcarriers = -1;
static gint hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_data_subcarriers = -1;
static gint hf_sbc_ss_effective_cinr_measurement_preamble = -1;
static gint hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_pilot_subcarriers = -1;
static gint hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_data_subcarriers = -1;
static gint hf_sbc_ss_support_2_concurrent_cqi_channels = -1;
static gint hf_sbc_ss_frequency_selectivity_characterization_report = -1;
static gint hf_sbc_ss_fft_rsvd1 = -1;
static gint hf_sbc_ss_fft_rsvd2 = -1;
static gint hf_sbc_ss_demodulator = -1;
static gint hf_sbc_ss_demodulator_64qam = -1;
static gint hf_sbc_ss_demodulator_btc = -1;
static gint hf_sbc_ss_demodulator_ctc = -1;
static gint hf_sbc_ss_demodulator_stc = -1;
static gint hf_sbc_ss_demodulator_cc_with_optional_interleaver = -1;
static gint hf_sbc_ss_demodulator_harq_chase = -1;
static gint hf_sbc_ss_demodulator_harq_ctc_ir = -1;
static gint hf_sbc_ss_demodulator_reserved = -1;
/* static gint hf_sbc_ss_demodulator_reserved1 = -1; */
static gint hf_sbc_ss_demodulator_64qam_2 = -1;
static gint hf_sbc_ss_demodulator_btc_2 = -1;
static gint hf_sbc_ss_demodulator_ctc_2 = -1;
static gint hf_sbc_ss_demodulator_stc_2 = -1;
static gint hf_sbc_ss_demodulator_cc_with_optional_interleaver_2 = -1;
static gint hf_sbc_ss_demodulator_harq_chase_2 = -1;
static gint hf_sbc_ss_demodulator_harq_ctc_ir_2 = -1;
static gint hf_sbc_ss_demodulator_reserved_2 = -1;
static gint hf_sbc_ss_demodulator_harq_cc_ir_2 = -1;
static gint hf_sbc_ss_demodulator_ldpc_2 = -1;
static gint hf_sbc_ss_demodulator_dedicated_pilots_2 = -1;
static gint hf_sbc_ss_demodulator_reserved1_2 = -1;
static gint hf_sbc_ss_modulator = -1;
static gint hf_sbc_ss_modulator_64qam = -1;
static gint hf_sbc_ss_modulator_btc = -1;
static gint hf_sbc_ss_modulator_ctc = -1;
static gint hf_sbc_ss_modulator_stc = -1;
static gint hf_sbc_ss_modulator_harq_chase = -1;
static gint hf_sbc_ss_modulator_ctc_ir = -1;
static gint hf_sbc_ss_modulator_cc_ir = -1;
static gint hf_sbc_ss_modulator_ldpc = -1;
static gint hf_sbc_number_ul_arq_ack_channel = -1;
static gint hf_sbc_number_dl_arq_ack_channel = -1;
static gint hf_sbc_ss_permutation_support = -1;
static gint hf_sbc_ss_optimal_pusc = -1;
static gint hf_sbc_ss_optimal_fusc = -1;
static gint hf_sbc_ss_amc_1x6 = -1;
static gint hf_sbc_ss_amc_2x3 = -1;
static gint hf_sbc_ss_amc_3x2 = -1;
static gint hf_sbc_ss_amc_with_harq_map = -1;
static gint hf_sbc_ss_tusc1_support = -1;
static gint hf_sbc_ss_tusc2_support = -1;
static gint hf_sbc_ss_ofdma_aas_private = -1;
static gint hf_sbc_ofdma_aas_harq_map_capability = -1;
static gint hf_sbc_ofdma_aas_private_map_support = -1;
static gint hf_sbc_ofdma_aas_reduced_private_map_support = -1;
static gint hf_sbc_ofdma_aas_private_chain_enable = -1;
static gint hf_sbc_ofdma_aas_private_map_dl_frame_offset = -1;
static gint hf_sbc_ofdma_aas_private_ul_frame_offset = -1;
static gint hf_sbc_ofdma_aas_private_map_concurrency = -1;
static gint hf_sbc_ofdma_aas_capabilities = -1;
static gint hf_sbc_ss_ofdma_aas_zone = -1;
static gint hf_sbc_ss_ofdma_aas_diversity_map_scan = -1;
static gint hf_sbc_ss_ofdma_aas_fbck_rsp_support = -1;
static gint hf_sbc_ss_ofdma_downlink_aas_preamble = -1;
static gint hf_sbc_ss_ofdma_uplink_aas_preamble = -1;
static gint hf_sbc_ss_ofdma_aas_capabilities_rsvd = -1;
static gint hf_sbc_tlv_t_167_association_type_support = -1;
static gint hf_sbc_tlv_t_167_association_type_support_bit0 = -1;
static gint hf_sbc_tlv_t_167_association_type_support_bit1 = -1;
static gint hf_sbc_tlv_t_167_association_type_support_bit2 = -1;
static gint hf_sbc_tlv_t_167_association_type_support_bit3 = -1;
static gint hf_sbc_tlv_t_167_association_type_support_bit4 = -1;
static gint hf_sbc_tlv_t_167_association_type_support_reserved = -1;
static gint hf_sbc_ofdma_ss_uplink_power_control_support = -1;
static gint hf_sbc_ofdma_ss_uplink_power_control_support_open_loop = -1;
static gint hf_sbc_ofdma_ss_uplink_power_control_support_aas_preamble = -1;
static gint hf_sbc_ofdma_ss_uplink_power_control_support_rsvd = -1;
/* static gint hf_sbc_ofdm_ss_minimum_num_of_frames = -1; */
static gint hf_sbc_tlv_t_27_extension_capability = -1;
static gint hf_sbc_tlv_t_27_extension_capability_bit0 = -1;
static gint hf_sbc_tlv_t_27_extension_capability_reserved = -1;
static gint hf_sbc_tlv_t_28_ho_trigger_metric_support = -1;
static gint hf_sbc_tlv_t_28_ho_trigger_metric_support_bit0 = -1;
static gint hf_sbc_tlv_t_28_ho_trigger_metric_support_bit1 = -1;
static gint hf_sbc_tlv_t_28_ho_trigger_metric_support_bit2 = -1;
static gint hf_sbc_tlv_t_28_ho_trigger_metric_support_bit3 = -1;
static gint hf_sbc_tlv_t_28_ho_trigger_metric_support_reserved = -1;
static gint hf_sbc_tlv_t_171_minimum_num_of_frames = -1;
static gint hf_sbc_tlv_t_172_harq_map_capability = -1;
static gint hf_sbc_tlv_t_172_extended_harq_ie_capability = -1;
static gint hf_sbc_tlv_t_172_sub_map_capability_first_zone = -1;
static gint hf_sbc_tlv_t_172_sub_map_capability_other_zones = -1;
static gint hf_sbc_tlv_t_172_dl_region_definition_support = -1;
static gint hf_sbc_tlv_t_172_reserved = -1;
static gint hf_sbc_tlv_t_172 = -1;
static gint hf_sbc_tlv_t_173_ul_ctl_channel_support = -1;
static gint hf_sbc_tlv_t_173_3_bit_mimo_fast_feedback = -1;
static gint hf_sbc_tlv_t_173_enhanced_fast_feedback = -1;
static gint hf_sbc_tlv_t_173_ul_ack = -1;
static gint hf_sbc_tlv_t_173_reserved = -1;
static gint hf_sbc_tlv_t_173_uep_fast_feedback = -1;
static gint hf_sbc_tlv_t_173_measurement_report = -1;
static gint hf_sbc_tlv_t_173_primary_secondary_fast_feedback = -1;
static gint hf_sbc_tlv_t_173_diuc_cqi_fast_feedback = -1;
static gint hf_sbc_tlv_t_174_ofdma_ms_csit_capability = -1;
static gint hf_sbc_tlv_t_174_csit_compatibility_type_a = -1;
static gint hf_sbc_tlv_t_174_csit_compatibility_type_b = -1;
static gint hf_sbc_tlv_t_174_power_assignment_capability = -1;
static gint hf_sbc_tlv_t_174_sounding_rsp_time_capability = -1;
static gint hf_sbc_tlv_t_174_max_num_simultanous_sounding_instructions = -1;
static gint hf_sbc_tlv_t_174_ss_csit_type_a_support = -1;
static gint hf_sbc_tlv_t_204_ofdma_parameters_sets = -1;
static gint hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_a = -1;
static gint hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_b = -1;
static gint hf_sbc_tlv_t_204_ofdma_parameters_sets_harq_parameters_set = -1;
static gint hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_a = -1;
static gint hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_b = -1;
static gint hf_sbc_tlv_t_204_ofdma_parameters_sets_reserved = -1;
static gint hf_sbc_tlv_t_174_ss_csit_reserved = -1;
static gint hf_sbc_tlv_t_175_max_num_bst_per_frm_capability_harq = -1;
static gint hf_sbc_tlv_t_175_max_num_ul_harq_bst = -1;
static gint hf_sbc_tlv_t_175_max_num_ul_harq_per_frm_include_one_non_harq_bst = -1;
static gint hf_sbc_tlv_t_175_max_num_dl_harq_bst_per_harq_per_frm = -1;
static gint hf_sbc_tlv_t_176 = -1;
static gint hf_sbc_tlv_t_176_bit0 = -1;
static gint hf_sbc_tlv_t_176_bit1 = -1;
static gint hf_sbc_tlv_t_176_bit2 = -1;
/* static gint hf_sbc_tlv_t_176_bit2_cor2 = -1; */
static gint hf_sbc_tlv_t_176_bit3 = -1;
static gint hf_sbc_tlv_t_176_bit4 = -1;
static gint hf_sbc_tlv_t_176_bit5 = -1;
static gint hf_sbc_tlv_t_176_bit6 = -1;
static gint hf_sbc_tlv_t_176_bit7 = -1;
static gint hf_sbc_tlv_t_176_bit8 = -1;
static gint hf_sbc_tlv_t_176_bit9 = -1;
static gint hf_sbc_tlv_t_176_bit10 = -1;
static gint hf_sbc_tlv_t_176_bit11 = -1;
static gint hf_sbc_tlv_t_176_bit12 = -1;
static gint hf_sbc_tlv_t_176_bit13 = -1;
static gint hf_sbc_tlv_t_176_bit14 = -1;
static gint hf_sbc_tlv_t_176_bit15 = -1;
static gint hf_sbc_tlv_t_176_bit16 = -1;
static gint hf_sbc_tlv_t_176_bit17 = -1;
static gint hf_sbc_tlv_t_176_bit18 = -1;
static gint hf_sbc_tlv_t_176_bit19 = -1;
static gint hf_sbc_tlv_t_176_reserved = -1;
static gint hf_sbc_tlv_t_177_ofdma_ss_modulator_for_mimo_support = -1;
static gint hf_sbc_tlv_t_177_stc_matrix_a = -1;
static gint hf_sbc_tlv_t_177_stc_matrix_b_vertical = -1;
static gint hf_sbc_tlv_t_177_stc_matrix_b_horizontal = -1;
static gint hf_sbc_tlv_t_177_two_transmit_antennas = -1;
static gint hf_sbc_tlv_t_177_capable_of_transmit_diversity = -1;
static gint hf_sbc_tlv_t_177_capable_of_spacial_multiplexing = -1;
static gint hf_sbc_tlv_t_177_beamforming = -1;
static gint hf_sbc_tlv_t_177_adaptive_rate_ctl = -1;
static gint hf_sbc_tlv_t_177_single_antenna = -1;
static gint hf_sbc_tlv_t_177_collaborative_sm_with_one_antenna = -1;
static gint hf_sbc_tlv_t_177_collaborative_sm_with_two_antennas = -1;
static gint hf_sbc_tlv_t_177_capable_of_two_antenna = -1;
static gint hf_sbc_tlv_t_177_rsvd = -1;
static gint hf_sbc_tlv_t_178_sdma_pilot_capability = -1;
static gint hf_sbc_tlv_t_178_sdma_pilot_pattern_support_for_amc_zone = -1;
static gint hf_sbc_tlv_t_178_reserved = -1;
static gint hf_sbc_tlv_t_179_ofdma_multiple_dl_burst_profile_support = -1;
static gint hf_sbc_tlv_t_179_dl_bst_profile_for_multiple_fec = -1;
static gint hf_sbc_tlv_t_179_ul_bst_profile_for_multiple_fec = -1;
static gint hf_sbc_tlv_t_179_reserved = -1;
static gint hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability = -1;
static gint hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_NEP = -1;
static gint hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_dl = -1;
static gint hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_ul = -1;
static gint hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved1 = -1;
static gint hf_sbc_tlv_t_162_ul_harq_incremental_redundancy_buffer_capability_NEP = -1;
static gint hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved2 = -1;
static gint hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability = -1;
static gint hf_sbc_tlv_t_163_dl_harq_buffering_capability_for_chase_combining = -1;
static gint hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_dl = -1;
static gint hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved1 = -1;
static gint hf_sbc_tlv_t_163_ul_harq_buffering_capability_for_chase_combining = -1;
static gint hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_ul = -1;
static gint hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved2 = -1;
static gint hf_sbc_ss_demodulator_mimo_support = -1;
static gint hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_a = -1;
static gint hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_vertical = -1;
static gint hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_horizontal = -1;
static gint hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_a = -1;
static gint hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_vertical = -1;
static gint hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_horizontal = -1;
static gint hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_vertical = -1;
static gint hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_horizontal = -1;
static gint hf_sbc_ss_demodulator_mimo_rsvd = -1;
static gint hf_sbc_ss_mimo_uplink_support = -1;
static gint hf_sbc_ss_mimo_uplink_support_2_ann_sttd = -1;
static gint hf_sbc_ss_mimo_uplink_support_2_ann_sm_vertical = -1;
static gint hf_sbc_ss_mimo_uplink_support_1_ann_coop_sm = -1;
static gint hf_sbc_ss_mimo_uplink_support_rsvd = -1;
static gint hf_sbc_power_save_class_types_capability = -1;
static gint hf_sbc_power_save_class_types_capability_bit0 = -1;
static gint hf_sbc_power_save_class_types_capability_bit1 = -1;
static gint hf_sbc_power_save_class_types_capability_bit2 = -1;
static gint hf_sbc_power_save_class_types_capability_bits34 = -1;
static gint hf_sbc_power_save_class_types_capability_bits567 = -1;
static gint hf_sbc_pkm_flow_control = -1;
static gint hf_sbc_auth_policy = -1;
static gint hf_sbc_privacy_802_16 = -1;
static gint hf_sbc_privacy_rsvd = -1;
static gint hf_sbc_max_security_associations = -1;
static gint hf_sbc_invalid_tlv = -1;
static const true_false_string tfs_sbc_bw_alloc_support_duplex =
{
"Full-Duplex",
"Half-Duplex"
};
#if 0
static const value_string vals_sbc_mac_pdu_fsn[] =
{
{0, "Only 11-bit FSN values are supported"},
{1, "Only 3-bit FSN values are supported"},
{0, NULL}
};
#endif
#if 0
static const true_false_string tfs_sbc_mac_pdu_fsn =
{
"Only 3-bit FSN values are supported",
"Only 11-bit FSN values are supported"
};
#endif
#if 0
/* DCD DIUC messages (table 143) */
static const value_string diuc_msgs[] =
{
{ 0, "Downlink Burst Profile 1" },
{ 1, "Downlink Burst Profile 2" },
{ 2, "Downlink Burst Profile 3" },
{ 3, "Downlink Burst Profile 4" },
{ 4, "Downlink Burst Profile 5" },
{ 5, "Downlink Burst Profile 6" },
{ 6, "Downlink Burst Profile 7" },
{ 7, "Downlink Burst Profile 8" },
{ 8, "Downlink Burst Profile 9" },
{ 9, "Downlink Burst Profile 10" },
{ 10, "Downlink Burst Profile 11" },
{ 11, "Downlink Burst Profile 12" },
{ 12, "Downlink Burst Profile 13" },
{ 13, "Reserved" },
{ 14, "Gap" },
{ 15, "End of DL-MAP" },
{0, NULL}
};
#endif
#if 0
static const value_string vals_sbc_type[] =
{
{0, "CINR metric"},
{1, "RSSI metric"},
{2, "RTD metric"},
{3, "Reserved"},
{0, NULL}
};
#endif
#if 0
static const value_string vals_sbc_function[] =
{
{0, "Reserved"},
{1, "Metric of neighbor BS is greater than absolute value"},
{2, "Metric of neighbor BS is less than absolute value"},
{3, "Metric of neighbor BS is greater than serving BS metric by relative value"},
{4, "Metric of neighbor BS is less than serving BS metric by relative value"},
{5, "Metric of serving BS greater than absolute value"},
{6, "Metric of serving BS less than absolute value"},
{7, "Reserved"},
{0, NULL}
};
#endif
#if 0
static const value_string vals_sbc_action[] =
{
{0, "Reserved"},
{1, "Respond on trigger with MOB_SCN-REP after the end of each scanning interval"},
{2, "Respond on trigger with MOB_MSH-REQ"},
{3, "On trigger, MS starts neighbor BS scanning process by sending MOB_SCN-REQ"},
{4, "Reserved"},
{0, NULL}
};
#endif
#if 0
static const value_string vals_sbc_power_adjustmnt[] =
{
{0, "Preserve Peak Power"},
{1, "Preserve Mean Power"},
{0, NULL}
};
#endif
#if 0
static const true_false_string tfs_sbc_power_adjustment =
{
"Preserve Mean Power",
"Preserve Peak Power"
};
#endif
#if 0
static const value_string vals_reg_rsp_status[] =
{
{0, "OK"},
{1, "Message authentication failure"},
{0, NULL}
};
#endif
#if 0
static const value_string vals_sbc_burst_tcs[] =
{
{0, "TCS disabled"},
{1, "TCS enabled"},
{0, NULL}
};
#endif
#if 0
static const true_false_string tfs_sbc_burst_tcs =
{
"TCS enabled",
"TCS disabled"
};
#endif
#if 0
static const value_string vals_sbc_frame_duration[] =
{
{0, "2.5"},
{1, "4"},
{2, "5"},
{3, "8"},
{4, "10"},
{5, "12.5"},
{6, "20"},
{0, NULL}
};
#endif
#if 0
static const value_string vals_sbc_mac_version[] =
{
{1, "Conformance with IEEE Std 802.16-2001"},
{2, "Conformance with IEEE Std 802.16c-2002 and its predecessors"},
{3, "Conformance with IEEE Std 802.16a-2003 and its predecessors"},
{4, "Conformance with IEEE Std 802.16-2004"},
{5, "Conformance with IEEE Std 802.16-2004 and IEEE Std 802.16e-2005"},
{6, "reserved"},
{0, NULL}
};
#endif
#if 0
static const value_string vals_sbc_burst_fec[] =
{
{ 0, "QPSK (CC) 1/2"},
{ 1, "QPSK (CC) 3/4"},
{ 2, "16-QAM (CC) 1/2"},
{ 3, "16-QAM (CC) 3/4"},
{ 4, "64-QAM (CC) 1/2"},
{ 5, "64-QAM (CC) 2/3"},
{ 6, "64-QAM (CC) 3/4"},
{ 7, "QPSK (BTC) 1/2"},
{ 8, "QPSK (BTC) 3/4 or 2/3"},
{ 9, "16-QAM (BTC) 3/5"},
{10, "16-QAM (BTC) 4/5"},
{11, "64-QAM (BTC) 2/3 or 5/8"},
{12, "64-QAM (BTC) 5/6 or 4/5"},
{13, "QPSK (CTC) 1/2"},
{14, "Reserved"},
{15, "QPSK (CTC) 3/4"},
{16, "16-QAM (CTC) 1/2"},
{17, "16-QAM (CTC) 3/4"},
{18, "64-QAM (CTC) 1/2"},
{19, "64-QAM (CTC) 2/3"},
{20, "64-QAM (CTC) 3/4"},
{21, "64-QAM (CTC) 5/6"},
{22, "QPSK (ZT CC) 1/2"},
{23, "QPSK (ZT CC) 3/4"},
{24, "16-QAM (ZT CC) 1/2"},
{25, "16-QAM (ZT CC) 3/4"},
{26, "64-QAM (ZT CC) 1/2"},
{27, "64-QAM (ZT CC) 2/3"},
{28, "64-QAM (ZT CC) 3/4"},
{29, "QPSK (LDPC) 1/2"},
{30, "QPSK (LDPC) 2/3 A code"},
{31, "16-QAM (LDPC) 3/4 A code"},
{32, "16-QAM (LDPC) 1/2"},
{33, "16-QAM (LDPC) 2/3 A code"},
{34, "16-QAM (LDPC) 3/4 A code"},
{35, "64-QAM (LDPC) 1/2"},
{36, "64-QAM (LDPC) 2/3 A code"},
{37, "64-QAM (LDPC) 3/4 A code"},
{38, "QPSK (LDPC) 2/3 B code"},
{39, "QPSK (LDPC) 3/4 B code"},
{40, "16-QAM (LDPC) 2/3 B code"},
{41, "16-QAM (LDPC) 3/4 B code"},
{42, "64-QAM (LDPC) 2/3 B code"},
{43, "64-QAM (LDPC) 3/4 B code"},
{44, "QPSK (CC with optional interleaver) 1/2"},
{45, "QPSK (CC with optional interleaver) 3/4"},
{46, "16-QAM (CC with optional interleaver) 1/2"},
{47, "16-QAM (CC optional interleaver) 0%00"},
{48, "64-QAM (CC with optional interleaver) 2/3"},
{49, "64-QAM (CC with optional interleaver) 3/4"},
{50, "QPSK (LDPC) 5/6"},
{51, "16-QAM (LDPC) 5/6"},
{52, "64-QAM (LDPC) 5/6"},
{0, NULL}
};
#endif
#if 0
static const value_string vals_sbc_permutation_type[] =
{
{0, "PUSC" },
{1, "FUSC" },
{2, "optional FUSC"},
{3, "AMC"},
{0, NULL}
};
#endif
static const value_string vals_sbc_harq_parameters_set[] =
{
{0, "HARQ set 1"},
{1, "HARQ set 2"},
{2, "HARQ set 3"},
{3, "HARQ set 4"},
{4, "HARQ set 5"},
{5, "Reserved"},
{0, NULL}
};
static const true_false_string tfs_supported =
{
"supported",
"not supported"
};
static const true_false_string tfs_yes_no_sbc =
{
"yes",
"no"
};
static const value_string vals_sounding_rsp_time_cap_codings[] =
{
{0, "0.5ms" },
{1, "0.75ms" },
{2, "1ms"},
{3, "1.25ms"},
{4, "1.5ms"},
{5, "min(2, Next Frame)"},
{6, "min(5, Next Frame)"},
{7, "Next Frame"},
{0, NULL}
};
static const value_string vals_sbc_sdma_str[ ] =
{
{0, "no support"},
{1, "support SDMA pilot patterns #A and #B"},
{2, "support all SDMA pilot patterns"},
{3, "reserved"},
{0, NULL}
};
static void sbc_tlv_decoder(tlv_info_t* tlv_info, int ett, proto_tree* sbc_tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint tlv_offset)
{
proto_item *tlv_item, *ti;
proto_tree *tlv_tree;
gint tlv_type = get_tlv_type(tlv_info),
tlv_len = get_tlv_length(tlv_info),
value;
gfloat power_bpsk;
gfloat power_qpsk;
gfloat power_qam16;
gfloat power_qam64;
gfloat current_power;
/* process SBC TLV Encoded information */
switch (tlv_type)
{
case SBC_BW_ALLOC_SUPPORT:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_bw_alloc_support, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* display the detail meanings of the TLV value */
proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_rsvd0, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_duplex, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_bw_alloc_support_rsvd1, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_TRANSITION_GAPS:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_transition_gaps, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* display the detail meanings of the TLV value */
ti = proto_tree_add_item(tlv_tree, hf_sbc_ssttg, tvb, offset, 1, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
proto_item_append_text(ti, " us (ranges: TDD 0-50; H-FDD 0-100)");
break;
case SBC_MAC_PDU:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_mac_pdu, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* display the detail meanings of the TLV value */
proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_piggybacked, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_fsn, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_mac_pdu_rsvd, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_REQ_MAX_TRANSMIT_POWER: /* TODO: This TLV comes up as INVALID in wireshark... why? */
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_max_transmit_power, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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_float_format_value(tlv_tree, hf_sbc_bpsk, tvb, offset, 1, power_bpsk, "%.2f dBm", (gdouble)power_bpsk);
proto_tree_add_float_format_value(tlv_tree, hf_sbc_qpsk, tvb, (offset + 1), 1, power_qpsk, "%.2f dBm", (gdouble)power_qpsk);
proto_tree_add_float_format_value(tlv_tree, hf_sbc_qam16, tvb, (offset + 2), 1, power_qam16, "%.2f dBm", (gdouble)power_qam16);
proto_tree_add_float_format_value(tlv_tree, hf_sbc_qam64, tvb, (offset + 3), 1, power_qam64, "%.2f dBm", (gdouble)power_qam64);
break;
case SBC_REQ_CURR_TRANSMITTED_POWER:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_curr_transmit_power, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* display the detail meanings of the TLV value */
value = tvb_get_guint8(tvb, offset);
current_power = (gfloat)(value - 128) / 2;
proto_tree_add_float_format_value(tlv_tree, hf_sbc_current_transmitted_power, tvb, offset, 1, current_power, "%.2f dBm (Value: 0x%x)", (gdouble)current_power, value);
break;
case SBC_SS_FFT_SIZES:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_ss_fft_sizes, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
} else {
proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_256, tvb, offset, 1, ENC_BIG_ENDIAN);
}
proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_2048, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_128, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_512, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_1024, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_fft_rsvd2, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_SS_DEMODULATOR:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_ss_demodulator, tvb, tlv_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_btc, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ctc, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_stc, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_cc_with_optional_interleaver, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_chase, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_ctc_ir, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_64qam_2, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_btc_2, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ctc_2, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_stc_2, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_cc_with_optional_interleaver_2, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_chase_2, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_ctc_ir_2, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved_2, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_harq_cc_ir_2, tvb, offset , 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_ldpc_2, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_dedicated_pilots_2, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_reserved1_2, tvb, offset, 2, ENC_BIG_ENDIAN);
}
break;
case SBC_SS_MODULATOR:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_ss_modulator, tvb, tlv_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* display the detail meanings of the TLV value */
proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_64qam, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_btc, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ctc, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_stc, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_harq_chase, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ctc_ir, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_cc_ir, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_modulator_ldpc, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_SS_NUM_UL_ARQ_ACK_CHANNEL:
/* add TLV subtree */
add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_number_ul_arq_ack_channel, tvb, tlv_offset, ENC_BIG_ENDIAN);
break;
case SBC_SS_NUM_DL_ARQ_ACK_CHANNEL:
/* add TLV subtree */
add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_number_dl_arq_ack_channel, tvb, tlv_offset, ENC_BIG_ENDIAN);
break;
case SBC_SS_PERMUTATION_SUPPORT:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_ss_permutation_support, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* display the detail meanings of the TLV value */
proto_tree_add_item(tlv_tree, hf_sbc_ss_optimal_pusc, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_optimal_fusc, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_1x6, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_2x3, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_3x2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_amc_with_harq_map, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_tusc1_support, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_tusc2_support, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_SS_DEMODULATOR_MIMO_SUPPORT:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_ss_demodulator_mimo_support, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_vertical, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_horizontal, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_a, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_vertical, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_horizontal, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_vertical, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_horizontal, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_demodulator_mimo_rsvd, tvb, offset, 2, ENC_BIG_ENDIAN);
break;
case SBC_SS_MIMO_UPLINK_SUPPORT:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_ss_mimo_uplink_support, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_2_ann_sm_vertical, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_1_ann_coop_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_mimo_uplink_support_rsvd, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_SS_OFDMA_AAS_PRIVATE_MAP_SUPPORT:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_ss_ofdma_aas_private, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* display the detail meanings of the TLV value */
proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_harq_map_capability, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_support, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_reduced_private_map_support, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_chain_enable, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_dl_frame_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_ul_frame_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ofdma_aas_private_map_concurrency, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_SS_OFDMA_AAS_CAPABILITIES:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_ofdma_aas_capabilities, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* display the detail meanings of the TLV value */
proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_zone, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_diversity_map_scan, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_fbck_rsp_support, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_downlink_aas_preamble, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_uplink_aas_preamble, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_ofdma_aas_capabilities_rsvd, tvb, offset, 2, ENC_BIG_ENDIAN);
break;
case SBC_SS_CINR_MEASUREMENT_CAPABILITY:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_ss_cinr_measure_capability, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* display the detail meanings of the TLV value */
proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_preamble, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_pilot_subcarriers, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_data_subcarriers, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_preamble, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_pilot_subcarriers, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_data_subcarriers, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_support_2_concurrent_cqi_channels,tvb,offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ss_frequency_selectivity_characterization_report,tvb,offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_PKM_FLOW_CONTROL:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_pkm_flow_control, tvb, tlv_offset, ENC_BIG_ENDIAN);
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_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_auth_policy, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* display the detail meanings of the TLV value */
proto_tree_add_item(tlv_tree, hf_sbc_privacy_802_16, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_privacy_rsvd, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_MAX_SECURITY_ASSOCIATIONS:
add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_max_security_associations, tvb, tlv_offset, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_27_EXTENSION_CAPABILITY:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_27_extension_capability, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_27_extension_capability_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_28_HO_TRIGGER_METRIC_SUPPORT:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit1, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_bit3, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_28_ho_trigger_metric_support_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_167_ASSOCIATION_SUPPORT:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_167_association_type_support, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit1, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit3, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_bit4, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_167_association_type_support_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_170_UPLINK_POWER_CONTROL_SUPPORT:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_ofdma_ss_uplink_power_control_support, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_aas_preamble, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_ofdma_ss_uplink_power_control_support_rsvd, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_171_MINIMUM_NUM_OF_FRAMES:
/* add TLV subtree */
add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_171_minimum_num_of_frames, tvb, tlv_offset, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_172:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_172, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_extended_harq_ie_capability, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_sub_map_capability_first_zone, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_sub_map_capability_other_zones, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_dl_region_definition_support, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_172_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_173_UL_CONTROL_CHANNEL_SUPPORT:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_173_ul_ctl_channel_support, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_enhanced_fast_feedback, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_ul_ack, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_uep_fast_feedback, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_measurement_report, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_primary_secondary_fast_feedback, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_173_diuc_cqi_fast_feedback, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_174_OFDMA_MS_CSIT_CAPABILITY:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_174_ofdma_ms_csit_capability, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_csit_compatibility_type_b, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_power_assignment_capability, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_sounding_rsp_time_capability, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_max_num_simultanous_sounding_instructions, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_ss_csit_type_a_support, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_174_ss_csit_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_175_MAX_NUM_BST_PER_FRM_CAPABILITY_HARQ:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_175_max_num_bst_per_frm_capability_harq, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_175_max_num_dl_harq_bst_per_harq_per_frm, tvb, offset, 1, ENC_BIG_ENDIAN);
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_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_176, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* display the detail meanings of the TLV value */
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit0, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit1, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit2, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit3, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit4, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit5, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit6, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit7, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit8, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit9, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit10, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit11, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit12, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit13, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit14, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit15, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit16, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit17, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit18, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_bit19, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_176_reserved, tvb, offset, 3, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_177_OFDMA_SS_MODULATOR_FOR_MIMO_SUPPORT:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_177_ofdma_ss_modulator_for_mimo_support, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_b_vertical, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_stc_matrix_b_horizontal, tvb, offset, 1, ENC_BIG_ENDIAN);
} else {
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_two_transmit_antennas, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_transmit_diversity, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_spacial_multiplexing, tvb, offset, 1, ENC_BIG_ENDIAN);
}
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_beamforming, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_adaptive_rate_ctl, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_single_antenna, tvb, offset, 1, ENC_BIG_ENDIAN);
if (include_cor2_changes)
{
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_collaborative_sm_with_one_antenna, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_collaborative_sm_with_two_antennas, tvb, offset, 1, ENC_BIG_ENDIAN);
} else {
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_capable_of_two_antenna, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_177_rsvd, tvb, offset, 1, ENC_BIG_ENDIAN);
}
break;
case SBC_TLV_T_178_SDMA_PILOT_CAPABILITY:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_178_sdma_pilot_capability, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_178_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_179_OFDMA_MULTIPLE_DL_BURST_PROFILE_CAPABILITY:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_179_ofdma_multiple_dl_burst_profile_support, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_ul_bst_profile_for_multiple_fec, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_179_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_204_OFDMA_PARAMETERS_SETS:
if (include_cor2_changes)
{
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_b, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_harq_parameters_set, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_a, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_b, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_204_ofdma_parameters_sets_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
}
break;
case SBC_TLV_T_162_HARQ_INCREMENTAL_REDUNDANCY_BUFFER_CAPABILITY:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_dl, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved1, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_ul_harq_incremental_redundancy_buffer_capability_NEP, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_ul, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved2, tvb, offset, 2, ENC_BIG_ENDIAN);
break;
case SBC_TLV_T_163_HARQ_CHASE_COMBINING_AND_CC_IR_BUFFER_CAPABILITY:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved1, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_ul_harq_buffering_capability_for_chase_combining, tvb, offset, 2, ENC_BIG_ENDIAN);
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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved2, tvb, offset, 2, ENC_BIG_ENDIAN);
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_tree, proto_mac_mgmt_msg_sbc_decoder, tvb, tlv_offset, tlv_len, "Security Negotiation Parameters");
/* call the Security Negotiation Parameters decoder */
wimax_security_negotiation_parameters_decoder(tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
case SBC_TLV_T_26_POWER_SAVE_CLASS_TYPES_CAPABILITY:
/* add TLV subtree */
tlv_item = add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_power_save_class_types_capability, tvb, tlv_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett);
/* 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, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit1, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bit2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bits34, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sbc_power_save_class_types_capability_bits567, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
default:
/* add TLV subtree */
add_tlv_subtree(tlv_info, sbc_tree, hf_sbc_unknown_type, tvb, tlv_offset, ENC_NA);
break;
}
}
/* Wimax Mac SBC-REQ Message Dissector */
static int dissect_mac_mgmt_msg_sbc_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tvb_len;
gint tlv_type, tlv_len, tlv_value_offset;
proto_item *sbc_item;
proto_tree *sbc_tree;
tlv_info_t tlv_info;
{ /* 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, -1, "SS Basic Capability Request (SBC-REQ)");
/* 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) */
/* 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 */
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), ENC_NA);
break;
}
if (tlv_type == 0)
{ /* invalid tlv type */
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, ENC_NA);
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
/* process SBC TLV Encoded information */
sbc_tlv_decoder(&tlv_info, ett_sbc_req_tlv_subtree, sbc_tree, pinfo, tvb, offset+tlv_value_offset, offset);
offset += (tlv_len+tlv_value_offset);
} /* end of TLV process while loop */
}
return tvb_captured_length(tvb);
}
/* Wimax Mac SBC-RSP Message Dissector */
static int dissect_mac_mgmt_msg_sbc_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tvb_len;
gint tlv_type, tlv_len, tlv_value_offset;
proto_item *sbc_item;
proto_tree *sbc_tree;
tlv_info_t tlv_info;
{ /* 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, -1, "SS Basic Capability Response (SBC-RSP)");
/* 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) */
/* 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 */
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), ENC_NA);
break;
}
if (tlv_type == 0)
{ /* invalid tlv type */
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, ENC_NA);
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
/* process SBC TLV Encoded information */
sbc_tlv_decoder(&tlv_info, ett_sbc_rsp_tlv_subtree, sbc_tree, pinfo, tvb, offset+tlv_value_offset, offset);
offset += (tlv_len+tlv_value_offset);
} /* end of TLV process while loop */
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac SBC-REQ/RSP Messages Dissectors */
void proto_register_mac_mgmt_msg_sbc(void)
{
/* SBC display */
static hf_register_info hf_sbc[] =
{
{ /* 11.8.8 */
&hf_sbc_tlv_t_167_association_type_support,
{
"Association Type Support", "wmx.sbc.association_type_support",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_167_association_type_support_bit0,
{
"Scanning Without Association: association not supported", "wmx.sbc.association_type_support.bit0",
FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x1, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_167_association_type_support_bit1,
{
"Association Level 0: scanning or association without coordination", "wmx.sbc.association_type_support.bit1",
FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x2, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_167_association_type_support_bit2,
{
"Association Level 1: association with coordination", "wmx.sbc.association_type_support.bit2",
FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x4, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_167_association_type_support_bit3,
{
"Association Level 2: network assisted association", "wmx.sbc.association_type_support.bit3",
FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x8, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_167_association_type_support_bit4,
{
"Desired Association Support", "wmx.sbc.association_type_support.bit4",
FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x10, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_167_association_type_support_reserved,
{
"Reserved", "wmx.sbc.association_type_support.reserved",
FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL
}
},
{ /* 11.7.8.7 */
&hf_sbc_auth_policy,
{
"Authorization Policy Support", "wmx.sbc.auth_policy",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_privacy_802_16,
{
"IEEE 802.16 Privacy", "wmx.sbc.auth_policy.802_16",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_privacy_rsvd,
{
"Reserved", "wmx.sbc.auth_policy.rsvd",
FT_UINT8, BASE_HEX, NULL, 0xFE, NULL, HFILL
}
},
{ /* 11.8.1 */
&hf_sbc_bw_alloc_support,
{
"Bandwidth Allocation Support", "wmx.sbc.bw_alloc_support",
FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_sbc_bw_alloc_support_duplex,
{
"Duplex", "wmx.sbc.bw_alloc_support.duplex",
FT_BOOLEAN, 8, TFS(&tfs_sbc_bw_alloc_support_duplex), 0x2, NULL, HFILL
}
},
{
&hf_sbc_bw_alloc_support_rsvd0,
{
"Reserved", "wmx.sbc.bw_alloc_support.rsvd0",
FT_UINT8, BASE_HEX, NULL, 0x1, NULL, HFILL
}
},
{
&hf_sbc_bw_alloc_support_rsvd1,
{
"Reserved", "wmx.sbc.bw_alloc_support.rsvd1",
FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL
}
},
{
&hf_sbc_curr_transmit_power,
{
"Current transmitted power", "wmx.sbc.curr_transmit_power",
FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_sbc_ss_effective_cinr_measurement_preamble,
{
"Effective CINR Measurement For A Permutation Zone From Preamble", "wmx.sbc.effective_cinr_measure_permutation_zone_preamble",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
{
&hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_pilot_subcarriers,
{
"Effective CINR Measurement For A Permutation Zone From Pilot Subcarriers", "wmx.sbc.effective_cinr_measure_permutation_zone.pilot_subcarriers",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_sbc_ss_effective_cinr_measurement_permutation_zone_from_data_subcarriers,
{
"Effective CINR Measurement For A Permutation Zone From Data Subcarriers", "wmx.sbc.effective_cinr_measure_permutation_zone.data_subcarriers",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL
}
},
{ /* 11.8.6 */
&hf_sbc_tlv_t_27_extension_capability,
{
"Extension Capability", "wmx.sbc.extension_capability",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_27_extension_capability_bit0,
{
"Supported Extended Subheader Format", "wmx.sbc.extension_capability.bit0",
FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x1, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_27_extension_capability_reserved,
{
"Reserved", "wmx.sbc.extension_capability.reserved",
FT_UINT8, BASE_HEX, NULL, 0xFE, NULL, HFILL
}
},
{
&hf_sbc_ss_frequency_selectivity_characterization_report,
{
"Frequency Selectivity Characterization Report", "wmx.sbc.frequency_selectivity_characterization_report",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x80, NULL, HFILL
}
},
{ /* 11.8.3.7.19.2 */
&hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability,
{
"HARQ Chase Combining And CC-IR Buffer Capability", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability",
FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_dl,
{
"Aggregation Flag For DL", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.aggregation_flag_dl",
FT_UINT16, BASE_HEX, NULL, 0x40, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_aggregation_flag_ul,
{
"Aggregation Flag for UL", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.aggregation_flag_ul",
FT_UINT16, BASE_HEX, NULL, 0x4000, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_163_dl_harq_buffering_capability_for_chase_combining,
{
"Downlink HARQ Buffering Capability For Chase Combining (K)", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.dl_harq_buffering_capability_for_chase_combining",
FT_UINT16, BASE_HEX, NULL, 0x3F, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved1,
{
"Reserved", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.reserved1",
FT_UINT16, BASE_HEX, NULL, 0x80, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_163_harq_chase_combining_and_cc_ir_buffer_capability_reserved2,
{
"Reserved", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.reserved2",
FT_UINT16, BASE_HEX, NULL, 0x8000, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_163_ul_harq_buffering_capability_for_chase_combining,
{
"Uplink HARQ buffering capability for chase combining (K)", "wmx.sbc.harq_chase_combining_and_cc_ir_buffer_capability.ul_harq_buffering_capability_for_chase_combining",
FT_UINT16, BASE_HEX, NULL, 0x3F00, NULL, HFILL
}
},
{ /* 11.8.3.7.19.1 */
&hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability,
{
"HARQ Incremental Buffer Capability", "wmx.sbc.harq_incremental_redundancy_buffer_capability",
FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_dl,
{
"Aggregation Flag for DL", "wmx.sbc.harq_incremental_redundancy_buffer_capability.aggregation_flag_for_dl",
FT_UINT16, BASE_HEX, NULL, 0x10, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_aggregation_flag_for_ul,
{
"Aggregation Flag For UL", "wmx.sbc.harq_incremental_redundancy_buffer_capability.aggregation_flag_for_ul",
FT_UINT16, BASE_HEX, NULL, 0x1000, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_NEP,
{
"NEP Value Indicating Downlink HARQ Buffering Capability For Incremental Redundancy CTC", "wmx.sbc.harq_incremental_redundancy_buffer_capability.dl_incremental_redundancy_ctc",
FT_UINT16, BASE_HEX, NULL, 0xF, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved1,
{
"Reserved", "wmx.sbc.harq_incremental_redundancy_buffer_capability.reserved",
FT_UINT16, BASE_HEX, NULL, 0xE0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_162_harq_incremental_redundancy_buffer_capability_reserved2,
{
"Reserved", "wmx.sbc.harq_incremental_redundancy_buffer_capability.reserved2",
FT_UINT16, BASE_HEX, NULL, 0xE000, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_162_ul_harq_incremental_redundancy_buffer_capability_NEP,
{
"NEP Value Indicating Uplink HARQ Buffering Capability For Incremental Redundancy CTC", "wmx.sbc.harq_incremental_redundancy_buffer_capability.ul_incremental_redundancy_ctc",
FT_UINT16,BASE_HEX, NULL, 0xF00, NULL, HFILL
}
},
{
&hf_sbc_ofdma_aas_harq_map_capability,
{
"H-ARQ MAP Capability", "wmx.sbc.harq_map_capability",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{ /* 11.8.7 */
&hf_sbc_tlv_t_28_ho_trigger_metric_support,
{
"HO Trigger Metric Support", "wmx.sbc.ho_trigger_metric_support",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_28_ho_trigger_metric_support_bit0,
{
"BS CINR Mean", "wmx.sbc.ho_trigger_metric_support.bit0",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_28_ho_trigger_metric_support_bit1,
{
"BS RSSI Mean", "wmx.sbc.ho_trigger_metric_support.bit1",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_28_ho_trigger_metric_support_bit2,
{
"BS Relative Delay", "wmx.sbc.ho_trigger_metric_support.bit2",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_28_ho_trigger_metric_support_bit3,
{
"BS RTD", "wmx.sbc.ho_trigger_metric_support.bit3",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_28_ho_trigger_metric_support_reserved,
{
"Reserved", "wmx.sbc.ho_trigger_metric_support.reserved",
FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL
}
},
{
&hf_sbc_invalid_tlv,
{
"Invalid TLV", "wmx.sbc.invalid_tlv",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 11.8.2 */
&hf_sbc_mac_pdu,
{
"Capabilities For Construction And Transmission Of MAC PDUs", "wmx.sbc.mac_pdu",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_mac_pdu_piggybacked,
{
"Ability To Receive Requests Piggybacked With Data", "wmx.sbc.mac_pdu.bit0",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_mac_pdu_fsn,
{
"Ability To Use 3-bit FSN Values Used When Forming MAC PDUs On Non-ARQ Connections", "wmx.sbc.mac_pdu.bit1",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{ /* 11.8.3.7.15 */
&hf_sbc_tlv_t_175_max_num_bst_per_frm_capability_harq,
{
"Maximum Number Of Burst Per Frame Capability In HARQ", "wmx.sbc.max_num_bst_per_frm_capability_harq",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_175_max_num_dl_harq_bst_per_harq_per_frm,
{
"Maximum Numbers Of DL HARQ Bursts Per HARQ Enabled Of MS Per Frame (default(0)=1)", "wmx.sbc.max_num_bst_per_frm_capability_harq.max_num_dl_harq_bst_per_harq_per_frm",
FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_175_max_num_ul_harq_bst,
{
"Maximum Number Of UL HARQ Burst Per HARQ Enabled MS Per Frame (default(0)=1)", "wmx.sbc.max_num_bst_per_frm_capability_harq.max_num_ul_harq_bst",
FT_UINT8, BASE_DEC, NULL, 0x7, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_175_max_num_ul_harq_per_frm_include_one_non_harq_bst,
{
"Whether The Maximum Number Of UL HARQ Bursts Per Frame (i.e. Bits# 2-0) Includes The One Non-HARQ Burst", "wmx.sbc.max_num_bst_per_frm_capability_harq.max_num_ul_harq_per_frm_include_one_non_harq_bst",
FT_BOOLEAN, 8, TFS(&tfs_yes_no_sbc), 0x8, NULL, HFILL
}
},
{ /* 11.7.8.8 */
&hf_sbc_max_security_associations,
{
"Maximum Number Of Security Association Supported By The SS", "wmx.sbc.max_security_associations",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{ /* 11.8.3.7.2 - type 161 */
&hf_sbc_number_dl_arq_ack_channel,
{
"The Number Of DL HARQ ACK Channel", "wmx.sbc.number_dl_arq_ack_channel",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{ /* 11.8.3.7.3 - type 153 */
&hf_sbc_number_ul_arq_ack_channel,
{
"The Number Of UL HARQ ACK Channel", "wmx.sbc.number_ul_arq_ack_channel",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{ /* 11.8.3.7.8 */
&hf_sbc_ofdma_aas_capabilities,
{
"OFDMA AAS Capability", "wmx.sbc.ofdma_aas_capability",
FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_ss_ofdma_aas_capabilities_rsvd,
{
"Reserved", "wmx.sbc.ofdma_aas_capabilities.rsvd",
FT_UINT16, BASE_HEX, NULL, 0xFFE0, NULL, HFILL
}
},
{
&hf_sbc_ss_ofdma_aas_diversity_map_scan,
{
"AAS Diversity Map Scan (AAS DLFP)", "wmx.sbc.ofdma_aas_diversity_map_scan",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_ss_ofdma_aas_fbck_rsp_support,
{
"AAS-FBCK-RSP Support", "wmx.sbc.ofdma_aas_fbck_rsp_support",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_ss_ofdma_aas_zone,
{
"AAS Zone", "wmx.sbc.ofdma_aas_zone",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_ss_ofdma_downlink_aas_preamble,
{
"Downlink AAS Preamble", "wmx.sbc.ofdma_downlink_aas_preamble",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
{ /* 11.8.3.7.5 - 3 bytes */
&hf_sbc_tlv_t_176,
{
"OFDMA MS Demodulator For MIMO Support In DL", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl",
FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported), 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit0,
{
"2-antenna STC Matrix A", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit0",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit1,
{
"2-antenna STC Matrix B, vertical coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit1",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit2,
{
"Four Receive Antennas", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit2",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
#if 0
{
&hf_sbc_tlv_t_176_bit2_cor2,
{
"2-antenna STC matrix B, horizontal coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit2",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
#endif
{
&hf_sbc_tlv_t_176_bit3,
{
"4-antenna STC Matrix A", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit3",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit4,
{
"4-antenna STC Matrix B, vertical coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit4",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit5,
{
"4-antenna STC Matrix B, horizontal coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit5",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x20, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit6,
{
"4-antenna STC Matrix C, vertical coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit6",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x40, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit7,
{
"4-antenna STC Matrix C, horizontal coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit7",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x80, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit8,
{
"3-antenna STC Matrix A", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit8",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x100, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit9,
{
"3-antenna STC Matrix B", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit9",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x200, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit10,
{
"3-antenna STC Matrix C, vertical coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit10",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x400, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit11,
{
"3-antenna STC Matrix C, horizontal coding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit11",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x800, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit12,
{
"Capable Of Calculating Precoding Weight", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit12",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x1000, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit13,
{
"Capable Of Adaptive Rate Control", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit13",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x2000, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit14,
{
"Capable Of Calculating Channel Matrix", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit14",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x4000, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit15,
{
"Capable Of Antenna Grouping", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit15",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x8000, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit16,
{
"Capable Of Antenna Selection", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit16",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x10000, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit17,
{
"Capable Of Codebook Based Precoding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit17",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x20000, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit18,
{
"Capable Of Long-term Precoding", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit18",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x40000, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_bit19,
{
"Capable Of MIMO Midamble", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.bit19",
FT_BOOLEAN, 24, TFS(&tfs_supported), 0x80000, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_176_reserved,
{
"Reserved", "wmx.sbc.ofdma_ms_demodulator_for_mimo_support_in_dl.reserved",
FT_UINT24, BASE_HEX, NULL, 0xF00000, NULL, HFILL
}
},
{ /* 11.8.3.7.18 */
&hf_sbc_tlv_t_179_ofdma_multiple_dl_burst_profile_support,
{
"OFDMA Multiple Downlink Burst Profile Capability", "wmx.sbc.ofdma_multiple_dl_burst_profile_support",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_179_dl_bst_profile_for_multiple_fec,
{
"Downlink burst profile for multiple FEC types", "wmx.sbc.ofdma_multiple_dl_burst_profile_support.dl_bst_profile_for_multiple_fec",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_179_reserved,
{
"Reserved", "wmx.sbc.ofdma_multiple_dl_burst_profile_support.reserved",
FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_179_ul_bst_profile_for_multiple_fec,
{
"Uplink burst profile for multiple FEC types", "wmx.sbc.ofdma_multiple_dl_burst_profile_support.ul_burst_profile_for_multiple_fec_types",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{ /* 11.8.3.7.9 */
&hf_sbc_ss_cinr_measure_capability,
{
"OFDMA SS CINR Measurement Capability", "wmx.sbc.ofdma_ss_cinr_measure_capability",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{ /* 11.8.3.7.6 */
&hf_sbc_ss_mimo_uplink_support,
{
"OFDMA SS MIMO uplink support", "wmx.sbc.ofdma_ss_mimo_uplink_support",
FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_sbc_ss_mimo_uplink_support_2_ann_sttd,
{
"2-antenna STTD", "wmx.sbc.ofdma_ss_mimo_uplink_support.2_antenna_sttd",
FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL
}
},
{
&hf_sbc_ss_mimo_uplink_support_2_ann_sm_vertical,
{
"2-antenna SM with vertical coding", "wmx.sbc.ofdma_ss_mimo_uplink_support.2_antenna_sm_with_vertical_coding",
FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL
}
},
{
&hf_sbc_ss_mimo_uplink_support_1_ann_coop_sm,
{
"Single-antenna cooperative SM", "wmx.sbc.ofdma_ss_mimo_uplink_support.single_antenna_coop_sm",
FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL
}
},
{
&hf_sbc_ss_ofdma_uplink_aas_preamble,
{
"Uplink AAS Preamble", "wmx.sbc.ofdma_uplink_aas_preamble",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_sbc_ss_phy_cinr_measurement_preamble,
{
"Physical CINR Measurement From The Preamble", "wmx.sbc.phy_cinr_measure_preamble",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_pilot_subcarriers,
{
"Physical CINR Measurement For A Permutation Zone From Pilot Subcarriers", "wmx.sbc.phy_cinr_measure_permutation_zone.pilot_subcarriers",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_ss_phy_cinr_measurement_permutation_zone_from_data_subcarriers,
{
"Physical CINR Measurement For A Permutation Zone From Data Subcarriers", "wmx.sbc.phy_cinr_measure_permutation_zone.data_subcarriers",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{ /* 11.7.8.6 */
&hf_sbc_pkm_flow_control,
{
"PKM Flow Control", "wmx.sbc.pkm_flow_control",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{ /* 11.8.5 */
&hf_sbc_power_save_class_types_capability,
{
"Power Save Class Types Capability", "wmx.sbc.power_save_class_types_capability",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_power_save_class_types_capability_bit0,
{
"Power Save Class Type I", "wmx.sbc.power_save_class_types_capability.bit0",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_power_save_class_types_capability_bit1,
{
"Power Save Class Type II", "wmx.sbc.power_save_class_types_capability.bit1",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_power_save_class_types_capability_bit2,
{
"Power Save Class Type III", "wmx.sbc.power_save_class_types_capability.bit2",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_power_save_class_types_capability_bits34,
{
"Number Of Power Save Class Type Instances Supported From Class Type I and II", "wmx.sbc.power_save_class_types_capability.bits34",
FT_UINT8, BASE_DEC, NULL, 0x18, NULL, HFILL
}
},
{
&hf_sbc_power_save_class_types_capability_bits567,
{
"Number Of Power Save Class Type Instances Supported From Class Type III", "wmx.sbc.power_save_class_types_capability.bits567",
FT_UINT8, BASE_DEC, NULL, 0xE0, NULL, HFILL
}
},
{ /* 11.8.3.7.7 */
&hf_sbc_ofdma_aas_private_chain_enable,
{
"Private Map Chain Enable", "wmx.sbc.private_chain_enable",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
{
&hf_sbc_ofdma_aas_private_map_concurrency,
{
"Private Map Chain Concurrency", "wmx.sbc.private_map_concurrency",
FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL
}
},
{
&hf_sbc_ofdma_aas_private_map_dl_frame_offset,
{
"Private Map DL Frame Offset", "wmx.sbc.private_map_dl_frame_offset",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_sbc_ofdma_aas_private_map_support,
{
"Private Map Support", "wmx.sbc.private_map_support",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_ss_ofdma_aas_private,
{
"OFDMA AAS Private Map Support", "wmx.sbc.private_map_support.ofdma_aas",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_ofdma_aas_reduced_private_map_support,
{
"Reduced Private Map Support", "wmx.sbc.private_map_support.reduced",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_ofdma_aas_private_ul_frame_offset,
{
"Private Map UL Frame Offset", "wmx.sbc.private_ul_frame_offset",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL
}
},
{
&hf_sbc_mac_pdu_rsvd,
{
"Reserved", "wmx.sbc.mac_pdu.rsvd",
FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL
}
},
{ /* 11.8.3.2 */
&hf_sbc_max_transmit_power,
{
"Maximum Transmit Power", "wmx.sbc.max_transmit_power",
FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{
&hf_sbc_bpsk,
{
"BPSK", "wmx.sbc.bpsk",
FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_qpsk,
{
"QPSK", "wmx.sbc.qpsk",
FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_qam16,
{
"QAM16", "wmx.sbc.qam16",
FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_qam64,
{
"QAM64", "wmx.sbc.qam64",
FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_current_transmitted_power,
{
"Current Transmitted Power", "wmx.sbc.current_transmitted_power",
FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{ /* 11.8.3.7.5 - 2 bytes */
&hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_a,
{
"2-antenna STC Matrix A", "wmx.sbc.ss_demodulator.mimo.2.antenna.stc.matrix.a",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_horizontal,
{
"2-antenna STC Matrix B, horizontal coding", "wmx.sbc.ss_demodulator.mimo.2.antenna.stc.matrix.b.horizontal",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_mimo_2_ann_stc_matrix_b_vertical,
{
"2-antenna STC Matrix B, vertical coding", "wmx.sbc.ss_demodulator.mimo.2.antenna.stc.matrix.b.vertical",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_a,
{
"4-antenna STC Matrix A", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.a",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_horizontal,
{
"4-antenna STC Matrix B, horizontal coding", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.b.horizontal",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x20, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_b_vertical,
{
"4-antenna STC Matrix B, vertical coding", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.b.vertical",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_horizontal,
{
"4-antenna STC Matrix C, horizontal coding", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.c.horizontal",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x80, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_mimo_4_ann_stc_matrix_c_vertical,
{
"4-antenna STC Matrix C, vertical coding", "wmx.sbc.ss_demodulator.mimo.4.antenna.stc.matrix.c.vertical",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x40, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_mimo_rsvd,
{
"Reserved", "wmx.sbc.ss_demodulator.mimo.reserved",
FT_UINT16, BASE_HEX, NULL, 0xFF00, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_mimo_support,
{
"OFDMA SS Demodulator For MIMO Support", "wmx.sbc.ss_demodulator.mimo.support",
FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
/*11.8.3.7.11 ??? */
{ /* 11.8.3.7.12 - 170 */
&hf_sbc_ofdma_ss_uplink_power_control_support,
{
"OFDMA SS uplink power control support", "wmx.sbc.ofdma_ss_uplink_power_control_support",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_ofdma_ss_uplink_power_control_support_open_loop,
{
"Open loop", "wmx.sbc.ofdma_ss_uplink_power_control_support.open_loop",
FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL
}
},
{
&hf_sbc_ofdma_ss_uplink_power_control_support_aas_preamble,
{
"AAS preamble", "wmx.sbc.ofdma_ss_uplink_power_control_support.aas_preamble",
FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL
}
},
{
&hf_sbc_ofdma_ss_uplink_power_control_support_rsvd,
{
"Reserved", "wmx.sbc.ofdma_ss_uplink_power_control_support.rsvd",
FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_172_dl_region_definition_support,
{
"DL Region Definition Support", "wmx.sbc.ofdma_map_capability.dl_region_definition_support",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{ /* 11.8.3.7.12 - 172 */
&hf_sbc_tlv_t_172,
{
"Support For Extended HARQ", "wmx.sbc.ofdma_map_capability.extended_harq",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_172_extended_harq_ie_capability,
{
"Extended HARQ IE Capability", "wmx.sbc.ofdma_map_capability.extended_harq_ie_capability",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_172_harq_map_capability,
{
"HARQ MAP Capability", "wmx.sbc.ofdma_map_capability.harq_map_capability",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{ /* 11.8.3.7.12 - 171 */
&hf_sbc_tlv_t_171_minimum_num_of_frames,
{
"The Minimum Number Of Frames That SS Takes To Switch From The Open Loop Power Control Scheme To The Closed Loop Power Control Scheme Or Vice Versa", "wmx.sbc.ofdma_ss_uplink_power_control_support.minimum_num_of_frames",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_172_reserved,
{
"Reserved", "wmx.sbc.ofdma_map_capability.reserved",
FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_172_sub_map_capability_first_zone,
{
"Sub MAP Capability For First Zone", "wmx.sbc.ofdma_map_capability.sub_map_capability_first_zone",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_172_sub_map_capability_other_zones,
{
"Sub MAP Capability For Other Zones", "wmx.sbc.ofdma_map_capability.sub_map_capability_other_zones",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
{ /* 11.8.3.7.14 */
&hf_sbc_tlv_t_174_ofdma_ms_csit_capability,
{
"OFDMA MS CSIT Capability", "wmx.sbc.ofdma_ms_csit_capability",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_174_csit_compatibility_type_a,
{
"CSIT Compatibility Type A", "wmx.sbc.ofdma_ms_csit_capability.csit_compatibility_type_a",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_174_csit_compatibility_type_b,
{
"CSIT Compatibility Type B", "wmx.sbc.ofdma_ms_csit_capability.csit_compatibility_type_b",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_174_max_num_simultanous_sounding_instructions,
{
"Max Number Of Simultaneous Sounding Instructions", "wmx.sbc.ofdma_ms_csit_capability.max_num_simultaneous_sounding_instructions",
FT_UINT16, BASE_DEC, NULL, 0x03C0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_174_power_assignment_capability,
{
"Power Assignment Capability", "wmx.sbc.ofdma_ms_csit_capability.power_assignment_capability",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_174_ss_csit_reserved,
{
"Reserved", "wmx.sbc.ofdma_ms_csit_capability.reserved",
FT_UINT16, BASE_HEX, NULL, 0xF800, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_174_sounding_rsp_time_capability,
{
"Sounding Response Time Capability", "wmx.sbc.ofdma_ms_csit_capability.sounding_response_time_capability",
FT_UINT16, BASE_HEX, VALS(vals_sounding_rsp_time_cap_codings), 0x0038, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_174_ss_csit_type_a_support,
{
"SS Does Not Support P Values Of 9 And 18 When Supporting CSIT Type A", "wmx.sbc.ofdma_ms_csit_capability.type_a_support",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x0400, NULL, HFILL
}
},
{
/* 11.8.3.7.20 */
&hf_sbc_tlv_t_204_ofdma_parameters_sets,
{
"OFDMA parameters sets", "wmx.sbc.ofdma_parameters_sets",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_a,
{
"Support OFDMA PHY parameter set A", "wmx.sbc.ofdma_parameters_sets.phy_set_a",
FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_204_ofdma_parameters_sets_phy_set_b,
{
"Support OFDMA PHY parameter set B", "wmx.sbc.ofdma_parameters_sets.phy_set_b",
FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_204_ofdma_parameters_sets_harq_parameters_set,
{
"HARQ parameters set", "wmx.sbc.ofdma_parameters_sets.harq_parameters_set",
FT_UINT8, BASE_HEX, VALS(vals_sbc_harq_parameters_set), 0x1C, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_a,
{
"Support OFDMA MAC parameters set A", "wmx.sbc.ofdma_parameters_sets.mac_set_a",
FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_204_ofdma_parameters_sets_mac_set_b,
{
"Support OFDMA MAC parameters set B", "wmx.sbc.ofdma_parameters_sets.mac_set_b",
FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_204_ofdma_parameters_sets_reserved,
{
"Reserved", "wmx.sbc.ofdma_parameters_sets.reserved",
FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL
}
},
{ /* 11.8.3.7.16 */
&hf_sbc_tlv_t_177_ofdma_ss_modulator_for_mimo_support,
{
"OFDMA SS Modulator For MIMO Support", "wmx.sbc.ofdma_ss_modulator_for_mimo_support",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_adaptive_rate_ctl,
{
"Capable Of Adaptive Rate Control", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_adaptive_rate_control",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_beamforming,
{
"Capable Of Beamforming", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_beamforming",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_single_antenna,
{
"Capable of single antenna transmission", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_single_antenna",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_stc_matrix_b_horizontal,
{
"Capable of 2-antenna STC Matrix B, Horizontal coding", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.stc_matrix_b_horizontal",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_two_transmit_antennas,
{
"Two transmit antennas", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.two_transmit_antennas",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_capable_of_transmit_diversity,
{
"Capable of transmit diversity", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_of_transmit_diversity",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_capable_of_spacial_multiplexing,
{
"Capable of spatial multiplexing", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_of_spatial_multiplexing",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_stc_matrix_b_vertical,
{
"Capable of 2-antenna STC Matrix B, Vertical coding", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.stc_matrix_b_vertical",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_collaborative_sm_with_one_antenna,
{
"Capable of collaborative SM with one antenna", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.collaborative_sm_with_one_antenna",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_collaborative_sm_with_two_antennas,
{
"Collaborative SM with two antennas", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.collaborative_sm_with_two_antennas",
FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_capable_of_two_antenna,
{
"Capable of two antenna", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.capable_of_two_antenna",
FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_rsvd,
{
"Reserved", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.rsvd",
FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_177_stc_matrix_a,
{
"Capable of 2-antenna STC Matrix A", "wmx.sbc.ofdma_ss_modulator_for_mimo_support.stc_matrix_a",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{ /* 11.8.3.7.17 */
&hf_sbc_tlv_t_178_sdma_pilot_capability,
{
"SDMA Pilot Capability", "wmx.sbc.sdma_pilot_capability",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_178_reserved,
{
"Reserved", "wmx.sbc.sdma_pilot_capability.reserved",
FT_UINT8, BASE_HEX, NULL, 0xFC, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_178_sdma_pilot_pattern_support_for_amc_zone,
{
"SDMA Pilot Patterns Support For AMC Zone", "wmx.sbc.sdma_pilot_capability.sdma_pilot_pattern_support_for_amc_zone",
FT_UINT8, BASE_HEX, VALS(vals_sbc_sdma_str), 0x03, NULL, HFILL
}
},
{ /* 11.8.3.7.2 - type 151 */
&hf_sbc_ss_demodulator,
{
"OFDMA SS Demodulator", "wmx.sbc.ss_demodulator",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
/* tlv length = 1 byte */
{
&hf_sbc_ss_demodulator_64qam,
{
"64-QAM", "wmx.sbc.ss_demodulator.64qam",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_btc,
{
"BTC", "wmx.sbc.ss_demodulator.btc",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_cc_with_optional_interleaver,
{
"CC with Optional Interleaver", "wmx.sbc.ss_demodulator.cc_with_optional_interleaver",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_ctc,
{
"CTC", "wmx.sbc.ss_demodulator.ctc",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
/* tlv length = 2 bytes */
{
&hf_sbc_ss_demodulator_64qam_2,
{
"64-QAM", "wmx.sbc.ss_demodulator.64qam",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_btc_2,
{
"BTC", "wmx.sbc.ss_demodulator.btc",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_cc_with_optional_interleaver_2,
{
"CC with Optional Interleaver", "wmx.sbc.ss_demodulator.cc_with_optional_interleaver",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_ctc_2,
{
"CTC", "wmx.sbc.ss_demodulator.ctc",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_dedicated_pilots_2,
{
"Dedicated Pilots", "wmx.sbc.ss_demodulator.dedicated_pilots",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x400, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_harq_cc_ir_2,
{
"HARQ CC_IR", "wmx.sbc.ss_demodulator.harq.cc.ir",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x100, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_harq_chase,
{
"HARQ Chase", "wmx.sbc.ss_demodulator.harq.chase",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_harq_chase_2,
{
"HARQ Chase", "wmx.sbc.ss_demodulator.harq.chase",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x20, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_harq_ctc_ir,
{
"HARQ CTC_IR", "wmx.sbc.ss_demodulator.harq.ctc.ir",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_harq_ctc_ir_2,
{
"HARQ CTC_IR", "wmx.sbc.ss_demodulator.harq.ctc.ir",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x40, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_ldpc_2,
{
"LDPC", "wmx.sbc.ss_demodulator.ldpc",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x200, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_reserved,
{
"Reserved", "wmx.sbc.ss_demodulator.reserved1",
FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_reserved_2,
{
"Reserved", "wmx.sbc.ss_demodulator.reserved2",
FT_UINT16, BASE_HEX, NULL, 0x80, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_reserved1_2,
{
"Reserved", "wmx.sbc.ss_demodulator.reserved2",
FT_UINT16, BASE_HEX, NULL, 0x800, NULL, HFILL
}
},
#if 0
{ /* if the number of DL H-ARQ channels > 7 but tlv length = 1 */
&hf_sbc_ss_demodulator_reserved1,
{
"Reserved", "wmx.sbc.ss_demodulator.reserved1",
FT_UINT16, BASE_HEX, NULL, 0xFFFF, NULL, HFILL
}
},
#endif
{
&hf_sbc_ss_demodulator_stc,
{
"STC", "wmx.sbc.ss_demodulator.stc",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
{
&hf_sbc_ss_demodulator_stc_2,
{
"STC", "wmx.sbc.ss_demodulator.stc",
FT_BOOLEAN, 16, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
/* 11.8.3.4 - 11.8.3.6 are not supported for now */
{ /* 11.8.3.7.1 */
&hf_sbc_ss_fft_sizes,
{
"OFDMA SS FFT Sizes", "wmx.sbc.ss_fft_sizes",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_ss_fft_128,
{
"FFT-128", "wmx.sbc.ss_fft_sizes.128",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_ss_fft_256,
{
"FFT-256", "wmx.sbc.ss_fft_sizes.256",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_ss_fft_512,
{
"FFT-512", "wmx.sbc.ss_fft_sizes.512",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
{
&hf_sbc_ss_fft_1024,
{
"FFT-1024", "wmx.sbc.ss_fft_sizes.1024",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_sbc_ss_fft_2048,
{
"FFT-2048", "wmx.sbc.ss_fft_sizes.2048",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_ss_fft_rsvd1,
{
"Reserved", "wmx.sbc_ss_fft_sizes_rsvd1",
FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL
}
},
{
&hf_sbc_ss_fft_rsvd2,
{
"Reserved", "wmx.sbc.ss_fft_sizes.rsvd2",
FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL
}
},
#if 0
{
&hf_sbc_ofdm_ss_minimum_num_of_frames,
{
"SS minimum number of frames", "wmx.sbc.ss_minimum_num_of_frames",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
#endif
{
&hf_sbc_ss_mimo_uplink_support_rsvd,
{
"Reserved", "wmx.sbc.ss_mimo_ul_support.rsvd",
FT_UINT8, BASE_HEX, NULL, 0xF8, NULL, HFILL
}
},
{ /* 11.8.3.7.3 - type 152 */
&hf_sbc_ss_modulator,
{
"OFDMA SS Modulator", "wmx.sbc.ss_modulator",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_ss_modulator_64qam,
{
"64-QAM", "wmx.sbc.ss_modulator.64qam",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_ss_modulator_btc,
{
"BTC", "wmx.sbc.ss_modulator.btc",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_ss_modulator_cc_ir,
{
"CC_IR", "wmx.sbc.ss_modulator.cc_ir",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL
}
},
{
&hf_sbc_ss_modulator_ctc,
{
"CTC", "wmx.sbc.ss_modulator.ctc",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_ss_modulator_ctc_ir,
{
"CTC_IR", "wmx.sbc.ss_modulator.ctc_ir",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL
}
},
{
&hf_sbc_ss_modulator_harq_chase,
{
"HARQ Chase", "wmx.sbc.ss_modulator.harq_chase",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_sbc_ss_modulator_ldpc,
{
"LDPC", "wmx.sbc.ss_modulator.ldpc",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x80, NULL, HFILL
}
},
{
&hf_sbc_ss_modulator_stc,
{
"STC", "wmx.sbc.ss_modulator.stc",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
{ /* 11.8.3.7.4 */
&hf_sbc_ss_permutation_support,
{
"OFMDA SS Permutation Support", "wmx.sbc.ss_permutation_support",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_ss_amc_1x6,
{
"AMC 1x6", "wmx.sbc.ss_permutation_support.amc_1x6",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_ss_amc_2x3,
{
"AMC 2x3", "wmx.sbc.ss_permutation_support.amc_2x3",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x8, NULL, HFILL
}
},
{
&hf_sbc_ss_amc_3x2,
{
"AMC 3x2", "wmx.sbc.ss_permutation_support.amc_3x2",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_sbc_ss_amc_with_harq_map,
{
"AMC Support With H-ARQ Map", "wmx.sbc.ss_permutation_support.amc_support_harq_map",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL
}
},
{
&hf_sbc_ss_optimal_fusc,
{
"Optional FUSC", "wmx.sbc.ss_permutation_support.optimal_fusc",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_ss_optimal_pusc,
{
"Optional PUSC", "wmx.sbc.ss_permutation_support.optimal_pusc",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_ss_tusc1_support,
{
"TUSC1", "wmx.sbc.ss_permutation_support.tusc1_support",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL
}
},
{
&hf_sbc_ss_tusc2_support,
{
"TUSC2", "wmx.sbc.ss_permutation_support.tusc2_support",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x80, NULL, HFILL
}
},
{
&hf_sbc_ssrtg,
{
"SSRTG", "wmx.sbc.ssrtg",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_ssttg,
{
"SSTTG", "wmx.sbc.ssttg",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_ss_support_2_concurrent_cqi_channels,
{
"Support for 2 Concurrent CQI Channels", "wmx.sbc.support_2_concurrent_cqi_channels",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL
}
},
{ /* 11.8.3.1 */
&hf_sbc_transition_gaps,
{
"Subscriber Transition Gaps", "wmx.sbc.transition_gaps",
FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL
}
},
{ /* 11.8.3.7.13 */
&hf_sbc_tlv_t_173_ul_ctl_channel_support,
{
"Uplink Control Channel Support", "wmx.sbc.ul_ctl_channel_support",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_173_3_bit_mimo_fast_feedback,
{
"3-bit MIMO Fast-feedback", "wmx.sbc.ul_ctl_channel_support.3bit_mimo_fast_feedback",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x1, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_173_diuc_cqi_fast_feedback,
{
"DIUC-CQI Fast-feedback", "wmx.sbc.ul_ctl_channel_support.diuc_cqi_fast_feedback",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x80, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_173_enhanced_fast_feedback,
{
"Enhanced Fast_feedback", "wmx.sbc.ul_ctl_channel_support.enhanced_fast_feedback",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x2, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_173_measurement_report,
{
"A Measurement Report Shall Be Performed On The Last DL Burst", "wmx.sbc.ul_ctl_channel_support.measurement_report",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x20, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_173_primary_secondary_fast_feedback,
{
"Primary/Secondary FAST_FEEDBACK", "wmx.sbc.ul_ctl_channel_support.primary_secondary_fast_feedback",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x40, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_173_reserved,
{
"Reserved", "wmx.sbc.ul_ctl_channel_support.reserved",
FT_UINT8, BASE_HEX, NULL, 0x8, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_173_uep_fast_feedback,
{
"UEP Fast-feedback", "wmx.sbc.ul_ctl_channel_support.uep_fast_feedback",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x10, NULL, HFILL
}
},
{
&hf_sbc_tlv_t_173_ul_ack,
{
"UL ACK", "wmx.sbc.ul_ctl_channel_support.ul_ack",
FT_BOOLEAN, 8, TFS(&tfs_supported), 0x4, NULL, HFILL
}
},
{
&hf_sbc_unknown_type,
{
"Unknown SBC type", "wmx.sbc.unknown_tlv_type",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
}
};
/* Setup protocol subtree array */
static gint *ett_sbc[] =
{
&ett_mac_mgmt_msg_sbc_decoder,
&ett_sbc_req_tlv_subtree,
&ett_sbc_rsp_tlv_subtree,
};
proto_mac_mgmt_msg_sbc_decoder = proto_register_protocol (
"WiMax SBC-REQ/RSP Messages", /* name */
"WiMax SBC-REQ/RSP (sbc)", /* short name */
"wmx.sbc" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_sbc_decoder, hf_sbc, array_length(hf_sbc));
proto_register_subtree_array(ett_sbc, array_length(ett_sbc));
sbc_req_handle = register_dissector("mac_mgmt_msg_sbc_req_handler", dissect_mac_mgmt_msg_sbc_req_decoder, proto_mac_mgmt_msg_sbc_decoder);
sbc_rsp_handle = register_dissector("mac_mgmt_msg_sbc_rsp_handler", dissect_mac_mgmt_msg_sbc_rsp_decoder, proto_mac_mgmt_msg_sbc_decoder);
}
void
proto_reg_handoff_mac_mgmt_msg_sbc(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_SBC_REQ, sbc_req_handle);
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_SBC_RSP, sbc_rsp_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_ucd.c | /* msg_ucd.c
* WiMax MAC Management UCD Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
/*
#define DEBUG
*/
#include <epan/packet.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
void proto_register_mac_mgmt_msg_ucd(void);
void proto_reg_handoff_mac_mgmt_msg_ucd(void);
static dissector_handle_t ucd_handle;
extern gboolean include_cor2_changes;
guint cqich_id_size; /* Set for CQICH_Alloc_IE */
static gint proto_mac_mgmt_msg_ucd_decoder = -1;
static gint ett_mac_mgmt_msg_ucd_decoder = -1;
/* fix fields */
static gint hf_ucd_res_timeout = -1;
static gint hf_ucd_bw_req_size = -1;
static gint hf_ucd_ranging_req_size = -1;
static gint hf_ucd_freq = -1;
/* static gint hf_ucd_subchan_params_num_chan = -1; */
static gint hf_ucd_ul_allocated_subchannles_bitmap = -1;
/* static gint hf_ucd_subchan_params_num_sym = -1; */
/* static gint hf_ucd_subchan_codes = -1; */
static gint hf_ucd_ul_burst_reserved = -1;
static gint hf_ucd_ul_burst_uiuc = -1;
static gint hf_ucd_burst_fec = -1;
static gint hf_ucd_burst_ranging_data_ratio = -1;
/*static gint hf_ucd_burst_power_boost = -1;
*static gint hf_ucd_burst_tcs_enable = -1;
*/
static gint hf_ucd_tlv_t_159_band_amc_allocation_threshold = -1;
static gint hf_ucd_tlv_t_158_optional_permutation_ul_allocated_subchannels_bitmap = -1;
static gint hf_ucd_tlv_t_160_band_amc_release_threshold = -1;
static gint hf_ucd_tlv_t_161_band_amc_allocation_timer = -1;
static gint hf_ucd_tlv_t_162_band_amc_release_timer = -1;
static gint hf_ucd_tlv_t_163_band_status_report_max_period = -1;
static gint hf_ucd_tlv_t_164_band_amc_retry_timer = -1;
static gint hf_ucd_tlv_t_171_harq_ack_delay_dl_burst = -1;
static gint hf_ucd_tlv_t_170_safety_channel_retry_timer = -1;
static gint hf_ucd_tlv_t_172_cqich_band_amc_transition_delay = -1;
static gint hf_ucd_tlv_t_174_maximum_retransmission = -1;
static gint hf_ucd_tlv_t_177_normalized_cn_override2 = -1;
static gint hf_ucd_tlv_t_177_normalized_cn_override2_first_line = -1;
static gint hf_ucd_tlv_t_177_normalized_cn_override2_list = -1;
static gint hf_ucd_tlv_t_176_size_of_cqich_id_field = -1;
static gint hf_ucd_tlv_t_186_upper_bound_aas_preamble = -1;
static gint hf_ucd_tlv_t_187_lower_bound_aas_preamble = -1;
static gint hf_ucd_tlv_t_188_allow_aas_beam_select_message = -1;
static gint hf_ucd_tlv_t_189_use_cqich_indication_flag = -1;
static gint hf_ucd_tlv_t_190_ms_specific_up_power_addjustment_step = -1;
static gint hf_ucd_tlv_t_191_ms_specific_down_power_addjustment_step = -1;
static gint hf_ucd_tlv_t_192_min_level_power_offset_adjustment = -1;
static gint hf_ucd_tlv_t_193_max_level_power_offset_adjustment = -1;
static gint hf_ucd_tlv_t_194_handover_ranging_codes = -1;
static gint hf_ucd_tlv_t_195_initial_ranging_interval = -1;
static gint hf_ucd_tlv_t_196_tx_power_report = -1;
static gint hf_ucd_tlv_t_196_tx_power_report_threshold = -1;
static gint hf_ucd_tlv_t_196_tx_power_report_interval = -1;
static gint hf_ucd_tlv_t_196_tx_power_report_a_p_avg = -1;
static gint hf_ucd_tlv_t_196_tx_power_report_threshold_icqch = -1;
static gint hf_ucd_tlv_t_196_tx_power_report_interval_icqch = -1;
static gint hf_ucd_tlv_t_196_tx_power_report_a_p_avg_icqch = -1;
/* static gint hf_ucd_tlv_t_197_normalized_cn_channel_sounding = -1; */
static gint hf_ucd_tlv_t_202_uplink_burst_profile_for_multiple_fec_types = -1;
static gint hf_ucd_tlv_t_203_ul_pusc_subchannel_rotation = -1;
static gint hf_ucd_tlv_t_205_relative_power_offset_ul_harq_burst = -1;
static gint hf_ucd_tlv_t_206_relative_power_offset_ul_burst_containing_mac_mgmt_msg = -1;
static gint hf_ucd_tlv_t_207_ul_initial_transmit_timing = -1;
static gint hf_ucd_tlv_t_210_fast_feedback_region = -1;
static gint hf_ucd_tlv_t_211_harq_ack_region = -1;
static gint hf_ucd_tlv_t_212_ranging_region = -1;
static gint hf_ucd_tlv_t_213_sounding_region = -1;
static gint hf_ucd_tlv_t_150_initial_ranging_codes = -1;
static gint hf_ucd_tlv_t_151_periodic_ranging_codes = -1;
static gint hf_ucd_tlv_t_152_bandwidth_request_codes = -1;
static gint hf_ucd_tlv_t_155_start_of_ranging_codes_group = -1;
static gint hf_ucd_tlv_t_156_permutation_base = -1;
static gint hf_ucd_ho_ranging_start = -1;
static gint hf_ucd_ho_ranging_end = -1;
static gint hf_ucd_initial_range_backoff_start = -1;
static gint hf_ucd_initial_range_backoff_end = -1;
static gint hf_ucd_bandwidth_backoff_start = -1;
static gint hf_ucd_bandwidth_backoff_end = -1;
static gint hf_ucd_periodic_ranging_backoff_start = -1;
static gint hf_ucd_periodic_ranging_backoff_end = -1;
static gint hf_ucd_config_change_count = -1;
static gint hf_ucd_ranging_backoff_start = -1;
static gint hf_ucd_ranging_backoff_end = -1;
static gint hf_ucd_request_backoff_start = -1;
static gint hf_ucd_request_backoff_end = -1;
/* static gint hf_ucd_unknown_type = -1; */
static gint hf_ucd_invalid_tlv = -1;
#if 0
static const value_string vals_dcd_burst_tcs[] =
{
{0, "TCS disabled"},
{1, "TCS enabled"},
{0, NULL}
};
#endif
static const value_string vals_dcd_burst_fec[] =
{
{ 0, "QPSK (CC) 1/2"},
{ 1, "QPSK (CC) 3/4"},
{ 2, "16-QAM (CC) 1/2"},
{ 3, "16-QAM (CC) 3/4"},
{ 4, "64-QAM (CC) 1/2"},
{ 5, "64-QAM (CC) 2/3"},
{ 6, "64-QAM (CC) 3/4"},
{ 7, "QPSK (BTC) 1/2"},
{ 8, "QPSK (BTC) 3/4 or 2/3"},
{ 9, "16-QAM (BTC) 3/5"},
{10, "16-QAM (BTC) 4/5"},
{11, "64-QAM (BTC) 2/3 or 5/8"},
{12, "64-QAM (BTC) 5/6 or 4/5"},
{13, "QPSK (CTC) 1/2"},
{14, "Reserved"},
{15, "QPSK (CTC) 3/4"},
{16, "16-QAM (CTC) 1/2"},
{17, "16-QAM (CTC) 3/4"},
{18, "64-QAM (CTC) 1/2"},
{19, "64-QAM (CTC) 2/3"},
{20, "64-QAM (CTC) 3/4"},
{21, "64-QAM (CTC) 5/6"},
{22, "QPSK (ZT CC) 1/2"},
{23, "QPSK (ZT CC) 3/4"},
{24, "16-QAM (ZT CC) 1/2"},
{25, "16-QAM (ZT CC) 3/4"},
{26, "64-QAM (ZT CC) 1/2"},
{27, "64-QAM (ZT CC) 2/3"},
{28, "64-QAM (ZT CC) 3/4"},
{29, "QPSK (LDPC) 1/2"},
{30, "QPSK (LDPC) 2/3 A code"},
{31, "16-QAM (LDPC) 3/4 A code"},
{32, "16-QAM (LDPC) 1/2"},
{33, "16-QAM (LDPC) 2/3 A code"},
{34, "16-QAM (LDPC) 3/4 A code"},
{35, "64-QAM (LDPC) 1/2"},
{36, "64-QAM (LDPC) 2/3 A code"},
{37, "64-QAM (LDPC) 3/4 A code"},
{38, "QPSK (LDPC) 2/3 B code"},
{39, "QPSK (LDPC) 3/4 B code"},
{40, "16-QAM (LDPC) 2/3 B code"},
{41, "16-QAM (LDPC) 3/4 B code"},
{42, "64-QAM (LDPC) 2/3 B code"},
{43, "64-QAM (LDPC) 3/4 B code"},
{44, "QPSK (CC with optional interleaver) 1/2"},
{45, "QPSK (CC with optional interleaver) 3/4"},
{46, "16-QAM (CC with optional interleaver) 1/2"},
{47, "16-QAM (CC optional interleaver) 0%00"},
{48, "64-QAM (CC with optional interleaver) 2/3"},
{49, "64-QAM (CC with optional interleaver) 3/4"},
{50, "QPSK (LDPC) 5/6"},
{51, "16-QAM (LDPC) 5/6"},
{52, "64-QAM (LDPC) 5/6"},
{0, NULL}
};
static const value_string vals_ucd_cqich_size[] =
{
{0, "0 bits"},
{1, "3 bits"},
{2, "4 bits"},
{3, "5 bits"},
{4, "6 bits"},
{5, "7 bits"},
{6, "8 bits"},
{7, "9 bits"},
{0, NULL}
};
static const value_string vals_yes_no_str[] =
{
{0, "No"},
{1, "Yes"},
{0, NULL}
};
/* UCD dissector */
static int dissect_mac_mgmt_msg_ucd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tvb_len, length;
gint tlv_type, tlv_len, tlv_offset, tlv_value_offset;
tlv_info_t tlv_info;
gchar* proto_str;
{ /* we are being asked for details */
proto_item *ucd_item;
proto_tree *ucd_tree;
guint ucd_ranging_backoff_start;
guint ucd_ranging_backoff_end;
guint ucd_request_backoff_start;
guint ucd_request_backoff_end;
tvb_len = tvb_reported_length(tvb);
/* display MAC payload type UCD */
ucd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset, -1, "Uplink Channel Descriptor (UCD)");
ucd_tree = proto_item_add_subtree(ucd_item, ett_mac_mgmt_msg_ucd_decoder);
/* Decode and display the Uplink Channel Descriptor (UCD) */
/* display the Configuration Change Count */
proto_tree_add_item(ucd_tree, hf_ucd_config_change_count, tvb, offset, 1, ENC_NA);
offset++;
/* get the ranging backoff start */
ucd_ranging_backoff_start = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format_value(ucd_tree, hf_ucd_ranging_backoff_start, tvb, offset, 1, (1 << ucd_ranging_backoff_start), "2^%u = %u", ucd_ranging_backoff_start, (1 << ucd_ranging_backoff_start));
offset++;
/* get the ranging backoff end */
ucd_ranging_backoff_end = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format_value(ucd_tree, hf_ucd_ranging_backoff_end, tvb, offset, 1, (1 << ucd_ranging_backoff_end), "2^%u = %u", ucd_ranging_backoff_end, (1 << ucd_ranging_backoff_end));
offset++;
/* get the request backoff start */
ucd_request_backoff_start = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format_value(ucd_tree, hf_ucd_request_backoff_start, tvb, offset, 1, (1 << ucd_request_backoff_start), "2^%u = %u", ucd_request_backoff_start, (1 << ucd_request_backoff_start));
offset++;
/* get the request backoff end */
ucd_request_backoff_end = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format_value(ucd_tree, hf_ucd_request_backoff_end, tvb, offset, 1, (1 << ucd_request_backoff_end), "2^%u = %u", ucd_request_backoff_end, (1 << ucd_request_backoff_end));
offset++;
while(offset < tvb_len)
{
proto_tree *tlv_tree;
proto_item *tlv_item1;
guint ul_burst_uiuc;
guint utemp;
/* 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "UCD TLV error");
proto_tree_add_item(ucd_tree,hf_ucd_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(ucd_tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset, (tlv_len + tlv_value_offset), "UCD Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len);
#endif
/* update the offset */
offset += tlv_value_offset;
/* process UCD TLV Encoded information */
if (include_cor2_changes)
{
switch (tlv_type)
{
case UCD_TLV_T_203_UL_PUSC_SUBCHANNEL_ROTATION:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_203_ul_pusc_subchannel_rotation, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_205_RELATIVE_POWER_OFFSET_UL_HARQ_BURST:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_205_relative_power_offset_ul_harq_burst, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_206_RELATIVE_POWER_OFFSET_UL_BURST_CONTAINING_MAC_MGMT_MSG:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_206_relative_power_offset_ul_burst_containing_mac_mgmt_msg, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_207_UL_INITIAL_TRANSMIT_TIMING:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_207_ul_initial_transmit_timing, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_210_FAST_FEEDBACK_REGION:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_210_fast_feedback_region, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
case UCD_TLV_T_211_HARQ_ACK_REGION:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_211_harq_ack_region, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
case UCD_TLV_T_212_RANGING_REGION:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_212_ranging_region, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
case UCD_TLV_T_213_SOUNDING_REGION:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_213_sounding_region, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
}
}
switch (tlv_type)
{
case UCD_UPLINK_BURST_PROFILE:
{
/* get the UIUC */
ul_burst_uiuc = tvb_get_guint8(tvb, offset) & 0x0F;
/* add TLV subtree */
proto_str = wmem_strdup_printf(pinfo->pool, "Uplink Burst Profile (UIUC = %u)", ul_burst_uiuc);
tlv_tree = add_protocol_subtree(&tlv_info, ett_mac_mgmt_msg_ucd_decoder, ucd_tree, proto_mac_mgmt_msg_ucd_decoder, tvb, offset-tlv_value_offset, tlv_len, proto_str);
proto_tree_add_item(tlv_tree, hf_ucd_ul_burst_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_ucd_ul_burst_uiuc, tvb, offset, 1, ENC_BIG_ENDIAN);
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);
if(tlv_type == -1)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "UL Burst Profile error");
proto_tree_add_item(tlv_tree, hf_ucd_invalid_tlv, tvb, offset, (tlv_len - offset - tlv_offset), ENC_NA);
break;
}
/* get the TLV length */
length = get_tlv_length(&tlv_info);
switch (tlv_type)
{
case UCD_BURST_FEC:
{
add_tlv_subtree(&tlv_info, tlv_tree, hf_ucd_burst_fec, tvb, (offset+tlv_offset), ENC_BIG_ENDIAN);
break;
}
case UCD_BURST_RANGING_DATA_RATIO:
{
add_tlv_subtree(&tlv_info, tlv_tree, hf_ucd_burst_ranging_data_ratio, tvb, (offset+tlv_offset), ENC_BIG_ENDIAN);
break;
}
#if 0 /* for OFDM */
case UCD_BURST_POWER_BOOST:
{
add_tlv_subtree(&tlv_info, tlv_tree, hf_ucd_burst_power_boost, tvb, (offset+tlv_offset), ENC_BIG_ENDIAN);
break;
}
case UCD_BURST_TCS_ENABLE:
{
add_tlv_subtree(&tlv_info, tlv_tree, hf_ucd_burst_tcs_enable, tvb, (offset+tlv_offset), 1, ENC_BIG_ENDIAN);
break;
}
#endif
default:
/* ??? */
break;
}
tlv_offset += (length+get_tlv_value_offset(&tlv_info));
}
break;
}
case UCD_RESERVATION_TIMEOUT:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_res_timeout, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_BW_REQ_SIZE:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_bw_req_size, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_RANGING_REQ_SIZE:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_ranging_req_size, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_FREQUENCY:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_freq, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_7_HO_RANGING_START:
{
tlv_tree = add_tlv_subtree_no_item(&tlv_info, ucd_tree, hf_ucd_ho_ranging_start, tvb, offset-tlv_value_offset);
utemp = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format_value(tlv_tree, hf_ucd_ho_ranging_start, tvb, offset, tvb_len, utemp, "2^%u = %u", utemp, (1 << utemp));
break;
}
case UCD_TLV_T_8_RANGING_HO_END:
{
tlv_tree = add_tlv_subtree_no_item(&tlv_info, ucd_tree, hf_ucd_ho_ranging_end, tvb, offset-tlv_value_offset);
utemp = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format_value(tlv_tree, hf_ucd_ho_ranging_end, tvb, offset, tvb_len, utemp, "2^%u = %u", utemp, (1 << utemp));
break;
}
case UCD_TLV_T_158_OPTIONAL_PERMUTATION_UL_ALLOCATED_SUBCHANNELS_BITMAP:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_158_optional_permutation_ul_allocated_subchannels_bitmap, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
case UCD_TLV_T_159_BAND_AMC_ALLOCATION_THRESHHOLD:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_159_band_amc_allocation_threshold, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_160_BAND_AMC_RELEASE_THRESHOLD:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_160_band_amc_release_threshold, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_161_BAND_AMC_ALLOCATION_TIMER:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_161_band_amc_allocation_timer, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_162_BAND_AMC_RELEASE_TIMER:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_162_band_amc_release_timer, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_163_BAND_STATUS_REPORT_MAX_PERIOD:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_163_band_status_report_max_period, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_164_BAND_AMC_RETRY_TIMER:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_164_band_amc_retry_timer, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_170_SAFETY_CHANNEL_RETRY_TIMER:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_170_safety_channel_retry_timer, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_171_HARQ_ACK_DELAY_FOR_DL_BURST:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_171_harq_ack_delay_dl_burst, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_172_CQICH_BAND_AMC_TRANSITION_DELAY:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_172_cqich_band_amc_transition_delay, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_174_MAXIMUM_RETRANSMISSION:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_174_maximum_retransmission, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_176_SIZE_OF_CQICH_ID_FIELD:
{
utemp = tvb_get_guint8(tvb, offset);
cqich_id_size = 0; /* Default is 0 */
if (utemp && utemp < 8) {
/* Set for CQICH_Alloc_IE */
cqich_id_size = utemp + 2;
}
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_176_size_of_cqich_id_field, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_177_NORMALIZED_CN_OVERRIDE_2:
{
/* add TLV subtree */
tlv_item1 = add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_177_normalized_cn_override2, tvb, offset-tlv_value_offset, ENC_NA|ENC_ASCII);
tlv_tree = proto_item_add_subtree(tlv_item1, ett_mac_mgmt_msg_ucd_decoder);
proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_177_normalized_cn_override2_first_line, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_177_normalized_cn_override2_list, tvb, offset + 3, 7, ENC_ASCII|ENC_NA);
break;
}
case UCD_TLV_T_186_UPPER_BOUND__AAS_PREAMBLE:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_186_upper_bound_aas_preamble, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_187_LOWER_BOUND_AAS_PREAMBLE:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_187_lower_bound_aas_preamble, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_188_ALLOW_AAS_BEAM_SELECT_MESSAGE:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_188_allow_aas_beam_select_message, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_189_USE_CQICH_INDICATION_FLAG:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_189_use_cqich_indication_flag, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_190_MS_SPECIFIC_UP_POWER_OFFSET_ADJUSTMENT_STEP:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_190_ms_specific_up_power_addjustment_step, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_191_MS_SPECIFIC_DOWN_POWER_OFSET_ADJUSTMENT_STEP:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_191_ms_specific_down_power_addjustment_step, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_192_MIN_LEVEL_POWER_OFFSET_ADJUSTMENT:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_192_min_level_power_offset_adjustment, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_193_MAX_LEVEL_POWER_OFFSETR_ADJUSTMENT:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_193_max_level_power_offset_adjustment, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_194_HANDOVER_RANGING_CODES:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_194_handover_ranging_codes, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_195_INITIAL_RANGING_INTERVAL:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_195_initial_ranging_interval, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_196_TX_POWER_REPORT:
{
tlv_item1 = add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_196_tx_power_report, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item1, ett_mac_mgmt_msg_ucd_decoder);
proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_196_tx_power_report_threshold, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_196_tx_power_report_interval, tvb , offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_196_tx_power_report_a_p_avg, tvb, (offset + 1), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_196_tx_power_report_threshold_icqch, tvb, (offset + 1), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_196_tx_power_report_interval_icqch, tvb, (offset + 2), 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_ucd_tlv_t_196_tx_power_report_a_p_avg_icqch, tvb, (offset + 2), 1, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_197_NORMALIZED_CN_FOR_CHANNEL_SOUNDING:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_195_initial_ranging_interval, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_TLV_T_198_INTIAL_RANGING_BACKOFF_START:
{
tlv_tree = add_tlv_subtree_no_item(&tlv_info, ucd_tree, hf_ucd_initial_range_backoff_start, tvb, offset-tlv_value_offset);
utemp = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format_value(tlv_tree, hf_ucd_initial_range_backoff_start, tvb, offset, tvb_len, utemp, "2^%u = %u", utemp, (1 << utemp));
break;
}
case UCD_TLV_T_199_INITIAL_RANGING_BACKOFF_END:
{
tlv_tree = add_tlv_subtree_no_item(&tlv_info, ucd_tree, hf_ucd_initial_range_backoff_end, tvb, offset-tlv_value_offset);
utemp = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format_value(tlv_tree, hf_ucd_initial_range_backoff_end, tvb, offset, tvb_len, utemp, "2^%u = %u", utemp, (1 << utemp));
break;
}
case UCD_TLV_T_200_BANDWIDTH_REQUESET_BACKOFF_START:
{
tlv_tree = add_tlv_subtree_no_item(&tlv_info, ucd_tree, hf_ucd_bandwidth_backoff_start, tvb, offset-tlv_value_offset);
utemp = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format_value(tlv_tree, hf_ucd_bandwidth_backoff_start, tvb, offset, tvb_len, utemp, "2^%u = %u", utemp, (1 << utemp));
break;
}
case UCD_TLV_T_201_BANDWIDTH_REQUEST_BACKOFF_END:
{
tlv_tree = add_tlv_subtree_no_item(&tlv_info, ucd_tree, hf_ucd_bandwidth_backoff_end, tvb, offset-tlv_value_offset);
utemp = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format_value(tlv_tree, hf_ucd_bandwidth_backoff_end, tvb, offset, tvb_len, utemp, "2^%u = %u", utemp, (1 << utemp));
break;
}
case UCD_TLV_T_202_UPLINK_BURST_PROFILE_FOR_MULTIPLE_FEC_TYPES:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_202_uplink_burst_profile_for_multiple_fec_types, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_INITIAL_RANGING_CODES:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_150_initial_ranging_codes, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_PERIODIC_RANGING_CODES:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_151_periodic_ranging_codes, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_BANDWIDTH_REQUEST_CODES:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_152_bandwidth_request_codes, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_PERIODIC_RANGING_BACKOFF_START:
{
tlv_tree = add_tlv_subtree_no_item(&tlv_info, ucd_tree, hf_ucd_periodic_ranging_backoff_start, tvb, offset-tlv_value_offset);
utemp = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format_value(tlv_tree, hf_ucd_periodic_ranging_backoff_start, tvb, offset, tvb_len, utemp, "2^%u = %u", utemp, (1 << utemp));
break;
}
case UCD_PERIODIC_RANGING_BACKOFF_END:
{
tlv_tree = add_tlv_subtree_no_item(&tlv_info, ucd_tree, hf_ucd_periodic_ranging_backoff_end, tvb, offset-tlv_value_offset);
utemp = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format_value(tlv_tree, hf_ucd_periodic_ranging_backoff_end, tvb, offset, tvb_len, utemp, "2^%u = %u", utemp, (1 << utemp));
break;
}
case UCD_START_OF_RANGING_CODES_GROUP:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_155_start_of_ranging_codes_group, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_PERMUTATION_BASE:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_tlv_t_156_permutation_base, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
}
case UCD_UL_ALLOCATED_SUBCHANNELS_BITMAP:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_ul_allocated_subchannles_bitmap, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
case UCD_TLV_T_203_UL_PUSC_SUBCHANNEL_ROTATION:
case UCD_TLV_T_205_RELATIVE_POWER_OFFSET_UL_HARQ_BURST:
case UCD_TLV_T_206_RELATIVE_POWER_OFFSET_UL_BURST_CONTAINING_MAC_MGMT_MSG:
case UCD_TLV_T_207_UL_INITIAL_TRANSMIT_TIMING:
case UCD_TLV_T_210_FAST_FEEDBACK_REGION:
case UCD_TLV_T_211_HARQ_ACK_REGION:
case UCD_TLV_T_212_RANGING_REGION:
case UCD_TLV_T_213_SOUNDING_REGION:
{
/* Unknown TLV type if cor2 not enabled. */
if (!include_cor2_changes)
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_invalid_tlv, tvb, offset-tlv_value_offset, ENC_NA);
}
break;
}
default:
{
add_tlv_subtree(&tlv_info, ucd_tree, hf_ucd_invalid_tlv, tvb, offset-tlv_value_offset, ENC_NA);
}
} /* end of switch(tlv_type) */
offset += tlv_len;
} /* end of TLV process while loop */
}
return tvb_captured_length(tvb);
}
/* Register Wimax Mac Payload Protocol and Dissector */
void proto_register_mac_mgmt_msg_ucd(void)
{
/* UCD display */
static hf_register_info hf[] =
{
{
&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|BASE_UNIT_STRING, &wimax_units_db, 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|BASE_UNIT_STRING, &wimax_units_frame_frames, 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|BASE_UNIT_STRING, &wimax_units_db, 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|BASE_UNIT_STRING, &wimax_units_frame_frames, 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|BASE_UNIT_STRING, &wimax_units_frame_frames, 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|BASE_UNIT_STRING, &wimax_units_frame_frames, 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|BASE_UNIT_STRING, &wimax_units_db, 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|BASE_UNIT_STRING, &wimax_units_db, 0, NULL, HFILL}
},
{
&hf_ucd_burst_tcs_enable,
{"TCS", "wmx.ucd.burst.tcs", FT_UINT8, BASE_DEC, VALS(vals_dcd_burst_tcs), 0, NULL, HFILL}
},
#endif
{
&hf_ucd_bw_req_size,
{
"Bandwidth Request Opportunity Size", "wmx.ucd.bw_req_size",
FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &wimax_units_ps, 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|BASE_UNIT_STRING, &wimax_units_frame_frames, 0, NULL, HFILL
}
},
{
&hf_ucd_freq,
{
"Frequency", "wmx.ucd.frequency",
FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &wimax_units_khz, 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|BASE_UNIT_STRING, &wimax_units_frame_offset, 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
}
},
#if 0
{
&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
}
},
#endif
{
&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|BASE_UNIT_STRING, &wimax_units_db, 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|BASE_UNIT_STRING, &wimax_units_frame_frames, 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
}
},
#if 0
{
&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
}
},
#endif
{
&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
}
},
#if 0
{
&hf_ucd_unknown_type,
{
"Unknown UCD Type", "wmx.ucd.unknown_tlv_type",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL
}
},
#endif
{
&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
}
},
{
&hf_ucd_ho_ranging_start,
{
"Initial Backoff Window Size for MS Performing Initial During Handover Process", "wmx.ucd.ho_ranging_start",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
{
&hf_ucd_ho_ranging_end,
{
"Final Backoff Window Size for MS Performing Initial During Handover Process", "wmx.ucd.ho_ranging_end",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
{
&hf_ucd_initial_range_backoff_start,
{
"Initial Ranging Backoff Start", "wmx.ucd.initial_range_backoff_start",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
{
&hf_ucd_initial_range_backoff_end,
{
"Initial Ranging Backoff End", "wmx.ucd.initial_range_backoff_end",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
{
&hf_ucd_bandwidth_backoff_start,
{
"Bandwidth Request Backoff Start", "wmx.ucd.bandwidth_backoff_start",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
{
&hf_ucd_bandwidth_backoff_end,
{
"Bandwidth Request Backoff End", "wmx.ucd.bandwidth_backoff_end",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
{
&hf_ucd_periodic_ranging_backoff_start,
{
"Periodic Ranging Backoff Start", "wmx.ucd.periodic_ranging_backoff_start",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
{
&hf_ucd_periodic_ranging_backoff_end,
{
"Periodic Ranging Backoff End", "wmx.ucd.periodic_ranging_backoff_end",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
{
&hf_ucd_config_change_count,
{
"Configuration Change Count", "wmx.ucd.config_change_count",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
{
&hf_ucd_ranging_backoff_start,
{
"Ranging Backoff Start", "wmx.ucd.ranging_backoff_start",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
{
&hf_ucd_ranging_backoff_end,
{
"Ranging Backoff End", "wmx.ucd.ranging_backoff_end",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
{
&hf_ucd_request_backoff_start,
{
"Request Backoff Start", "wmx.ucd.request_backoff_start",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
{
&hf_ucd_request_backoff_end,
{
"Request Backoff End", "wmx.ucd.request_backoff_end",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL
}
},
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_mac_mgmt_msg_ucd_decoder,
};
proto_mac_mgmt_msg_ucd_decoder = proto_register_protocol (
"WiMax UCD Messages", /* name */
"WiMax UCD", /* short name */
"wmx.ucd" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_ucd_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
ucd_handle = register_dissector("mac_mgmt_msg_ucd_handler", dissect_mac_mgmt_msg_ucd_decoder, proto_mac_mgmt_msg_ucd_decoder);
}
void proto_reg_handoff_mac_mgmt_msg_ucd(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_UCD, ucd_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/msg_ulmap.c | /* msg_ulmap.c
* WiMax MAC Management UL-MAP Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Mike Harvey <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#include "wimax_mac.h"
#include "wimax_bits.h"
#include "wimax_utils.h"
extern gboolean include_cor2_changes;
static dissector_handle_t ulmap_handle;
void proto_register_mac_mgmt_msg_ulmap(void);
void proto_reg_handoff_mac_mgmt_msg_ulmap(void);
#define MAC_MGMT_MSG_ULMAP 3
#define XBIT_HF(bits, hf) \
proto_tree_add_bits_item(tree, hf, tvb, bit, bits, ENC_BIG_ENDIAN); bit += bits;
#define XBIT_HF_VALUE(var, bits, hf) \
do { \
var = TVB_BIT_BITS(bit, tvb, bits); \
proto_tree_add_bits_item(tree, hf, tvb, bit, bits, ENC_BIG_ENDIAN); \
bit += bits; \
} while(0)
#define VNIB(var, nibs, hf) \
do { \
var = TVB_NIB_NIBS(nib, tvb, nibs); \
proto_tree_add_uint(tree, hf, tvb, NIBHI(nib, nibs), var); \
nib += nibs; \
} while(0)
/* from msg_ucd.c */
extern guint cqich_id_size; /* Set for CQICH_Alloc_IE */
/* from msg_dlmap.c */
extern gint harq;
extern gint ir_type;
extern gint N_layer;
extern gint RCID_Type;
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_287_1 = -1;
static gint ett_287_2 = -1;
static gint ett_289 = -1;
static gint ett_290 = -1;
static gint ett_290b = -1;
static gint ett_291 = -1;
static gint ett_292 = -1;
static gint ett_293 = -1;
static gint ett_294 = -1;
static gint ett_295 = -1;
static gint ett_299 = -1;
static gint ett_300 = -1;
static gint ett_302 = -1;
static gint ett_302a = -1;
static gint ett_302b = -1;
static gint ett_302c = -1;
static gint ett_302d = -1;
static gint ett_302e = -1;
static gint ett_302f = -1;
static gint ett_302g = -1;
static gint ett_302h = -1;
static gint ett_302i = -1;
static gint ett_302j = -1;
static gint ett_302k = -1;
static gint ett_302l = -1;
static gint ett_302m = -1;
static gint ett_302n = -1;
static gint ett_302o = -1;
static gint ett_302p = -1;
static gint ett_302q = -1;
static gint ett_302r = -1;
static gint ett_302s = -1;
static gint ett_302t = -1;
static gint ett_302u = -1;
static gint ett_302v = -1;
static gint ett_306 = -1;
static gint ett_306_ul = -1;
static gint ett_308b = -1;
static gint ett_315d = -1;
#define DCD_DOWNLINK_BURST_PROFILE 1
#define DCD_BS_EIRP 2
#define DCD_FRAME_DURATION 3
#define DCD_PHY_TYPE 4
#define DCD_POWER_ADJUSTMENT 5
#define DCD_CHANNEL_NR 6
#define DCD_TTG 7
#define DCD_RTG 8
#define DCD_RSS 9
#define DCD_CHANNEL_SWITCH_FRAME_NR 10
#define DCD_FREQUENCY 12
#define DCD_BS_ID 13
#define DCD_FRAME_DURATION_CODE 14
#define DCD_FRAME_NR 15
#define DCD_SIZE_CQICH_ID 16
#define DCD_H_ARQ_ACK_DELAY 17
#define DCD_MAC_VERSION 148
#define DCD_RESTART_COUNT 154
#define DCD_BURST_FREQUENCY 1
#define DCD_BURST_FEC_CODE_TYPE 150
#define DCD_BURST_DIUC_EXIT_THRESHOLD 151
#define DCD_BURST_DIUC_ENTRY_THRESHOLD 152
#define DCD_BURST_TCS_ENABLE 153
#define DCD_TLV_T_541_TYPE_FUNCTION_ACTION 1
#define DCD_TLV_T542_TRIGGER_VALUE 2
#define DCD_TLV_T_543_TRIGGER_AVERAGING_DURATION 3
#define DCD_TLV_T_19_PERMUTATION_TYPE_FOR_BROADCAST_REGION_IN_HARQ_ZONE 19
#define DCD_TLV_T_20_MAXIMUM_RETRANSMISSION 20
#define DCD_TLV_T_21_DEFAULT_RSSI_AND_CINR_AVERAGING_PARAMETER 21
#define DCD_TLV_T_22_DL_AMC_ALLOCATED_PHYSICAL_BANDS_BITMAP 22
#define DCD_TLV_T_31_H_ADD_THRESHOLD 31
#define DCD_TLV_T_32_H_DELETE_THRESHOLD 32
#define DCD_TLV_T_33_ASR 33
#define DCD_TLV_T_34_DL_REGION_DEFINITION 34
#define DCD_TLV_T_35_PAGING_GROUP_ID 35
#define DCD_TLV_T_36_TUSC1_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP 36
#define DCD_TLV_T_37_TUSC2_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP 37
#define DCD_TLV_T_45_PAGING_INTERVAL_LENGTH 45
#define DCD_TLV_T_50_HO_TYPE_SUPPORT 50
#define DCD_TLV_T_51_HYSTERSIS_MARGIN 51
#define DCD_TLV_T_52_TIME_TO_TRIGGER_DURATION 52
#define DCD_TLV_T_54_TRIGGER 54
#define DCD_TLV_T_153_DOWNLINK_BURST_PROFILE_FOR_MULTIPLE_FEC_TYPES 153
#define UL_MAP_NCT_PMP 0
#define UL_MAP_NCT_DM 1
#define UL_MAP_NCT_PTP 2
#if 0
/* NCT messages */
static const value_string nct_msgs[] =
{
{ UL_MAP_NCT_PMP, "PMP" },
{ UL_MAP_NCT_PMP, "DM" },
{ UL_MAP_NCT_PMP, "PTP" },
{ 0, NULL }
};
#endif
#if 0
/* Repetition Coding Indications */
static const value_string rep_msgs[] =
{
{ 0, "No Repetition Coding" },
{ 1, "Repetition Coding of 2 Used" },
{ 2, "Repetition Coding of 4 Used" },
{ 3, "Repetition Coding of 6 Used" },
{ 0, NULL }
};
#endif
#if 0
/* DL Frame Prefix Coding Indications */
static const value_string boost_msgs[] =
{
{ 0, "Normal (not boosted)" },
{ 1, "+6dB" },
{ 2, "-6dB" },
{ 3, "+9dB" },
{ 4, "+3dB" },
{ 5, "-3dB" },
{ 6, "-9dB" },
{ 7, "-12dB" },
{ 0, NULL }
};
#endif
/* ul-map fields */
static gint hf_ulmap_reserved = -1;
static gint hf_ulmap_ucd_count = -1;
static gint hf_ulmap_alloc_start_time = -1;
static gint hf_ulmap_ofdma_sym = -1;
static gint hf_ulmap_ie_diuc_ext = -1;
static gint hf_ulmap_ie_diuc_ext2 = -1;
static gint hf_ulmap_ie_length = -1;
static gint hf_ulmap_ie_reserved_extended2_duic = -1;
static gint hf_ulmap_ie_reserved_extended_duic = -1;
/* static gint hf_ulmap_fch_expected = -1; */
/* static gint hf_ulmap_ie = -1; */
static gint hf_ulmap_ie_cid = -1;
static gint hf_ulmap_ie_uiuc = -1;
static gint hf_ulmap_uiuc12_symofs = -1;
static gint hf_ulmap_uiuc12_subofs = -1;
static gint hf_ulmap_uiuc12_numsym = -1;
static gint hf_ulmap_uiuc12_numsub = -1;
static gint hf_ulmap_uiuc12_method = -1;
static gint hf_ulmap_uiuc12_dri = -1;
static gint hf_ulmap_uiuc10_dur = -1;
static gint hf_ulmap_uiuc10_rep = -1;
static gint hf_ulmap_uiuc10_slot_offset = -1;
static gint hf_ulmap_uiuc14_dur = -1;
static gint hf_ulmap_uiuc14_uiuc = -1;
static gint hf_ulmap_uiuc14_rep = -1;
static gint hf_ulmap_uiuc14_idx = -1;
static gint hf_ulmap_uiuc14_code = -1;
static gint hf_ulmap_uiuc14_sym = -1;
static gint hf_ulmap_uiuc14_sub = -1;
static gint hf_ulmap_uiuc14_bwr = -1;
/* static gint hf_ulmap_uiuc11_ext = -1; */
/* static gint hf_ulmap_uiuc11_len = -1; */
/* static gint hf_ulmap_uiuc11_data = -1; */
/* static gint hf_ulmap_uiuc15_ext = -1; */
/* static gint hf_ulmap_uiuc15_len = -1; */
/* static gint hf_ulmap_uiuc15_data = -1; */
static gint hf_ulmap_uiuc0_symofs = -1;
static gint hf_ulmap_uiuc0_subofs = -1;
static gint hf_ulmap_uiuc0_numsym = -1;
static gint hf_ulmap_uiuc0_numsub = -1;
static gint hf_ulmap_uiuc0_rsv = -1;
static gint hf_ulmap_uiuc13_symofs = -1;
static gint hf_ulmap_uiuc13_subofs = -1;
static gint hf_ulmap_uiuc13_numsym = -1;
static gint hf_ulmap_uiuc13_numsub = -1;
static gint hf_ulmap_uiuc13_papr = -1;
static gint hf_ulmap_uiuc13_zone = -1;
static gint hf_ulmap_uiuc13_rsv = -1;
/* static gint hf_ulmap_crc16 = -1; */
/* static gint hf_ulmap_crc16_status = -1; */
static gint hf_ulmap_padding = -1;
/* Generated via "one time" script to help create filterable fields */
static int hf_ulmap_dedicated_ul_control_length = -1;
static int hf_ulmap_dedicated_ul_control_control_header = -1;
static int hf_ulmap_dedicated_ul_control_num_sdma_layers = -1;
static int hf_ulmap_dedicated_ul_control_pilot_pattern = -1;
static int hf_ulmap_dedicated_mimo_ul_control_matrix = -1;
static int hf_ulmap_dedicated_mimo_ul_control_n_layer = -1;
static int hf_ulmap_harq_chase_dedicated_ul_control_indicator = -1;
static int hf_ulmap_harq_chase_uiuc = -1;
static int hf_ulmap_harq_chase_repetition_coding_indication = -1;
static int hf_ulmap_harq_chase_duration = -1;
static int hf_ulmap_harq_chase_acid = -1;
static int hf_ulmap_harq_chase_ai_sn = -1;
static int hf_ulmap_harq_chase_ack_disable = -1;
static int hf_ulmap_reserved_uint = -1;
static int hf_ulmap_harq_ir_ctc_dedicated_ul_control_indicator = -1;
static int hf_ulmap_harq_ir_ctc_nep = -1;
static int hf_ulmap_harq_ir_ctc_nsch = -1;
static int hf_ulmap_harq_ir_ctc_spid = -1;
static int hf_ulmap_harq_ir_ctc_acin = -1;
static int hf_ulmap_harq_ir_ctc_ai_sn = -1;
static int hf_ulmap_harq_ir_ctc_ack_disable = -1;
static int hf_ulmap_harq_ir_cc_dedicated_ul_control_indicator = -1;
static int hf_ulmap_harq_ir_cc_uiuc = -1;
static int hf_ulmap_harq_ir_cc_repetition_coding_indication = -1;
static int hf_ulmap_harq_ir_cc_duration = -1;
static int hf_ulmap_harq_ir_cc_spid = -1;
static int hf_ulmap_harq_ir_cc_acid = -1;
static int hf_ulmap_harq_ir_cc_ai_sn = -1;
static int hf_ulmap_harq_ir_cc_ack_disable = -1;
static int hf_ulmap_mimo_ul_chase_harq_mu_indicator = -1;
static int hf_ulmap_mimo_ul_chase_harq_dedicated_mimo_ulcontrol_indicator = -1;
static int hf_ulmap_mimo_ul_chase_harq_ack_disable = -1;
static int hf_ulmap_mimo_ul_chase_harq_matrix = -1;
static int hf_ulmap_mimo_ul_chase_harq_duration = -1;
static int hf_ulmap_mimo_ul_chase_harq_uiuc = -1;
static int hf_ulmap_mimo_ul_chase_harq_repetition_coding_indication = -1;
static int hf_ulmap_mimo_ul_chase_harq_acid = -1;
static int hf_ulmap_mimo_ul_chase_harq_ai_sn = -1;
static int hf_ulmap_mimo_ul_ir_harq_mu_indicator = -1;
static int hf_ulmap_mimo_ul_ir_harq_dedicated_mimo_ul_control_indicator = -1;
static int hf_ulmap_mimo_ul_ir_harq_ack_disable = -1;
static int hf_ulmap_mimo_ul_ir_harq_matrix = -1;
static int hf_ulmap_mimo_ul_ir_harq_nsch = -1;
static int hf_ulmap_mimo_ul_ir_harq_nep = -1;
static int hf_ulmap_mimo_ul_ir_harq_spid = -1;
static int hf_ulmap_mimo_ul_ir_harq_acid = -1;
static int hf_ulmap_mimo_ul_ir_harq_ai_sn = -1;
static int hf_ulmap_mimo_ul_ir_harq_cc_mu_indicator = -1;
static int hf_ulmap_mimo_ul_ir_harq_cc_dedicated_mimo_ul_control_indicator = -1;
static int hf_ulmap_mimo_ul_ir_harq_cc_ack_disable = -1;
static int hf_ulmap_mimo_ul_ir_harq_cc_matrix = -1;
static int hf_ulmap_mimo_ul_ir_harq_cc_duration = -1;
static int hf_ulmap_mimo_ul_ir_harq_cc_uiuc = -1;
static int hf_ulmap_mimo_ul_ir_harq_cc_repetition_coding_indication = -1;
static int hf_ulmap_mimo_ul_ir_harq_cc_acid = -1;
static int hf_ulmap_mimo_ul_ir_harq_cc_ai_sn = -1;
static int hf_ulmap_mimo_ul_ir_harq_cc_spid = -1;
static int hf_ulmap_mimo_ul_stc_harq_tx_count = -1;
static int hf_ulmap_mimo_ul_stc_harq_duration = -1;
static int hf_ulmap_mimo_ul_stc_harq_sub_burst_offset_indication = -1;
static int hf_ulmap_mimo_ul_stc_harq_sub_burst_offset = -1;
static int hf_ulmap_mimo_ul_stc_harq_ack_disable = -1;
static int hf_ulmap_mimo_ul_stc_harq_uiuc = -1;
static int hf_ulmap_mimo_ul_stc_harq_repetition_coding_indication = -1;
static int hf_ulmap_mimo_ul_stc_harq_acid = -1;
static int hf_ulmap_power_control = -1;
static int hf_ulmap_power_measurement_frame = -1;
static int hf_ulmap_mini_subcha_alloc_extended_2_uiuc = -1;
static int hf_ulmap_mini_subcha_alloc_length = -1;
static int hf_ulmap_mini_subcha_alloc_ctype = -1;
static int hf_ulmap_mini_subcha_alloc_duration = -1;
static int hf_ulmap_mini_subcha_alloc_cid = -1;
static int hf_ulmap_mini_subcha_alloc_uiuc = -1;
static int hf_ulmap_mini_subcha_alloc_repetition = -1;
static int hf_ulmap_mini_subcha_alloc_padding = -1;
static int hf_ulmap_aas_ul_extended_uiuc = -1;
static int hf_ulmap_aas_ul_length = -1;
static int hf_ulmap_aas_ul_permutation = -1;
static int hf_ulmap_aas_ul_ul_permbase = -1;
static int hf_ulmap_aas_ul_ofdma_symbol_offset = -1;
static int hf_ulmap_aas_ul_aas_zone_length = -1;
static int hf_ulmap_aas_ul_uplink_preamble_config = -1;
static int hf_ulmap_aas_ul_preamble_type = -1;
static int hf_ulmap_cqich_alloc_extended_uiuc = -1;
static int hf_ulmap_cqich_alloc_length = -1;
static int hf_ulmap_cqich_alloc_cqich_id = -1;
static int hf_ulmap_cqich_alloc_allocation_offset = -1;
static int hf_ulmap_cqich_alloc_period = -1;
static int hf_ulmap_cqich_alloc_frame_offset = -1;
static int hf_ulmap_cqich_alloc_duration = -1;
static int hf_ulmap_cqich_alloc_report_configuration_included = -1;
static int hf_ulmap_cqich_alloc_feedback_type = -1;
static int hf_ulmap_cqich_alloc_report_type = -1;
static int hf_ulmap_cqich_alloc_cinr_preamble_report_type = -1;
static int hf_ulmap_cqich_alloc_zone_permutation = -1;
static int hf_ulmap_cqich_alloc_zone_type = -1;
static int hf_ulmap_cqich_alloc_zone_prbs_id = -1;
static int hf_ulmap_cqich_alloc_major_group_indication = -1;
static int hf_ulmap_cqich_alloc_pusc_major_group_bitmap = -1;
static int hf_ulmap_cqich_alloc_cinr_zone_measurement_type = -1;
static int hf_ulmap_cqich_alloc_averaging_parameter_included = -1;
static int hf_ulmap_cqich_alloc_averaging_parameter = -1;
static int hf_ulmap_cqich_alloc_mimo_permutation_feedback_cycle = -1;
static int hf_ulmap_zone_extended_uiuc = -1;
static int hf_ulmap_zone_length = -1;
static int hf_ulmap_zone_ofdma_symbol_offset = -1;
static int hf_ulmap_zone_permutation = -1;
static int hf_ulmap_zone_ul_permbase = -1;
static int hf_ulmap_zone_amc_type = -1;
static int hf_ulmap_zone_use_all_sc_indicator = -1;
static int hf_ulmap_zone_disable_subchannel_rotation = -1;
static int hf_ulmap_phymod_ul_extended_uiuc = -1;
static int hf_ulmap_phymod_ul_length = -1;
static int hf_ulmap_phymod_ul_preamble_modifier_type = -1;
static int hf_ulmap_phymod_ul_preamble_frequency_shift_index = -1;
static int hf_ulmap_phymod_ul_preamble_time_shift_index = -1;
static int hf_ulmap_phymod_ul_pilot_pattern_modifier = -1;
static int hf_ulmap_phymod_ul_pilot_pattern_index = -1;
static int hf_ulmap_fast_tracking_extended_uiuc = -1;
static int hf_ulmap_fast_tracking_length = -1;
static int hf_ulmap_fast_tracking_map_index = -1;
static int hf_ulmap_fast_tracking_power_correction = -1;
static int hf_ulmap_fast_tracking_frequency_correction = -1;
static int hf_ulmap_fast_tracking_time_correction = -1;
static int hf_ulmap_pusc_burst_allocation_extended_uiuc = -1;
static int hf_ulmap_pusc_burst_allocation_length = -1;
static int hf_ulmap_pusc_burst_allocation_uiuc = -1;
static int hf_ulmap_pusc_burst_allocation_segment = -1;
static int hf_ulmap_pusc_burst_allocation_ul_permbase = -1;
static int hf_ulmap_pusc_burst_allocation_ofdma_symbol_offset = -1;
static int hf_ulmap_pusc_burst_allocation_subchannel_offset = -1;
static int hf_ulmap_pusc_burst_allocation_duration = -1;
static int hf_ulmap_pusc_burst_allocation_repetition_coding_indication = -1;
static int hf_ulmap_fast_ranging_extended_uiuc = -1;
static int hf_ulmap_fast_ranging_length = -1;
static int hf_ulmap_fast_ranging_ho_id_indicator = -1;
static int hf_ulmap_fast_ranging_ho_id = -1;
static int hf_ulmap_fast_ranging_mac_address = -1;
static int hf_ulmap_fast_ranging_uiuc = -1;
static int hf_ulmap_fast_ranging_duration = -1;
static int hf_ulmap_fast_ranging_repetition_coding_indication = -1;
static int hf_ulmap_allocation_start_extended_uiuc = -1;
static int hf_ulmap_allocation_start_length = -1;
static int hf_ulmap_allocation_start_ofdma_symbol_offset = -1;
static int hf_ulmap_allocation_start_subchannel_offset = -1;
static int hf_ulmap_cqich_enhanced_alloc_extended_2_uiuc = -1;
static int hf_ulmap_cqich_enhanced_alloc_length = -1;
static int hf_ulmap_cqich_enhanced_alloc_cqich_id = -1;
static int hf_ulmap_cqich_enhanced_alloc_period = -1;
static int hf_ulmap_cqich_enhanced_alloc_frame_offset = -1;
static int hf_ulmap_cqich_enhanced_alloc_duration = -1;
static int hf_ulmap_cqich_enhanced_alloc_cqich_num = -1;
static int hf_ulmap_cqich_enhanced_alloc_feedback_type = -1;
static int hf_ulmap_cqich_enhanced_alloc_allocation_index = -1;
static int hf_ulmap_cqich_enhanced_alloc_cqich_type = -1;
static int hf_ulmap_cqich_enhanced_alloc_sttd_indication = -1;
static int hf_ulmap_cqich_enhanced_alloc_band_amc_precoding_mode = -1;
static int hf_ulmap_cqich_enhanced_alloc_nr_precoders_feedback = -1;
static int hf_ulmap_anchor_bs_switch_extended_2_uiuc = -1;
static int hf_ulmap_anchor_bs_switch_length = -1;
static int hf_ulmap_anchor_bs_switch_n_anchor_bs_switch = -1;
static int hf_ulmap_anchor_bs_switch_reduced_cid = -1;
static int hf_ulmap_anchor_bs_switch_action_code = -1;
static int hf_ulmap_anchor_bs_switch_action_time = -1;
static int hf_ulmap_anchor_bs_switch_temp_bs_id = -1;
static int hf_ulmap_anchor_bs_switch_ak_change_indicator = -1;
static int hf_ulmap_anchor_bs_switch_cqich_allocation_indicator = -1;
static int hf_ulmap_anchor_bs_switch_cqich_id = -1;
static int hf_ulmap_anchor_bs_switch_feedback_channel_offset = -1;
static int hf_ulmap_anchor_bs_switch_period = -1;
static int hf_ulmap_anchor_bs_switch_frame_offset = -1;
static int hf_ulmap_anchor_bs_switch_duration = -1;
static int hf_ulmap_anchor_bs_switch_mimo_permutation_feedback_code = -1;
static int hf_ulmap_sounding_command_extended_2_uiuc = -1;
static int hf_ulmap_sounding_command_length = -1;
static int hf_ulmap_sounding_command_type = -1;
static int hf_ulmap_sounding_command_send_sounding_report_flag = -1;
static int hf_ulmap_sounding_command_relevance_flag = -1;
static int hf_ulmap_sounding_command_relevance = -1;
static int hf_ulmap_sounding_command_include_additional_feedback = -1;
static int hf_ulmap_sounding_command_num_sounding_symbols = -1;
static int hf_ulmap_sounding_command_separability_type = -1;
static int hf_ulmap_sounding_command_max_cyclic_shift_index_p = -1;
static int hf_ulmap_sounding_command_decimation_value = -1;
static int hf_ulmap_sounding_command_decimation_offset_randomization = -1;
static int hf_ulmap_sounding_command_symbol_index = -1;
static int hf_ulmap_sounding_command_number_of_cids = -1;
static int hf_ulmap_sounding_command_shorted_basic_cid = -1;
static int hf_ulmap_sounding_command_power_assignment_method = -1;
static int hf_ulmap_sounding_command_power_boost = -1;
static int hf_ulmap_sounding_command_multi_antenna_flag = -1;
static int hf_ulmap_sounding_command_allocation_mode = -1;
static int hf_ulmap_sounding_command_band_bit_map = -1;
static int hf_ulmap_sounding_command_starting_frequency_band = -1;
static int hf_ulmap_sounding_command_number_of_frequency_bands = -1;
static int hf_ulmap_sounding_command_cyclic_time_shift_index = -1;
static int hf_ulmap_sounding_command_decimation_offset = -1;
static int hf_ulmap_sounding_command_use_same_symbol_for_additional_feedback = -1;
static int hf_ulmap_sounding_command_periodicity = -1;
static int hf_ulmap_sounding_command_permutation = -1;
static int hf_ulmap_sounding_command_dl_permbase = -1;
static int hf_ulmap_sounding_command_shortened_basic_cid = -1;
static int hf_ulmap_sounding_command_subchannel_offset = -1;
static int hf_ulmap_sounding_command_number_of_subchannels = -1;
static int hf_ulmap_harq_ulmap_extended_2_uiuc = -1;
static int hf_ulmap_harq_ulmap_length = -1;
static int hf_ulmap_harq_ulmap_rcid_type = -1;
static int hf_ulmap_harq_ulmap_mode = -1;
static int hf_ulmap_harq_ulmap_allocation_start_indication = -1;
static int hf_ulmap_harq_ulmap_ofdma_symbol_offset = -1;
static int hf_ulmap_harq_ulmap_subchannel_offset = -1;
static int hf_ulmap_harq_ulmap_n_sub_burst = -1;
static int hf_ulmap_harq_ackch_region_alloc_extended_2_uiuc = -1;
static int hf_ulmap_harq_ackch_region_alloc_length = -1;
static int hf_ulmap_harq_ackch_region_alloc_ofdma_symbol_offset = -1;
static int hf_ulmap_harq_ackch_region_alloc_subchannel_offset = -1;
static int hf_ulmap_harq_ackch_region_alloc_num_ofdma_symbols = -1;
static int hf_ulmap_harq_ackch_region_alloc_num_subchannels = -1;
static int hf_ulmap_aas_sdma_extended_2_uiuc = -1;
static int hf_ulmap_aas_sdma_length = -1;
static int hf_ulmap_aas_sdma_rcid_type = -1;
static int hf_ulmap_aas_sdma_num_burst_region = -1;
static int hf_ulmap_aas_sdma_slot_offset = -1;
static int hf_ulmap_aas_sdma_slot_duration = -1;
static int hf_ulmap_aas_sdma_number_of_users = -1;
static int hf_ulmap_aas_sdma_encoding_mode = -1;
static int hf_ulmap_aas_sdma_power_adjust = -1;
static int hf_ulmap_aas_sdma_pilot_pattern_modifier = -1;
static int hf_ulmap_aas_sdma_preamble_modifier_index = -1;
static int hf_ulmap_aas_sdma_pilot_pattern = -1;
static int hf_ulmap_aas_sdma_diuc = -1;
static int hf_ulmap_aas_sdma_repetition_coding_indication = -1;
static int hf_ulmap_aas_sdma_acid = -1;
static int hf_ulmap_aas_sdma_ai_sn = -1;
static int hf_ulmap_aas_sdma_nep = -1;
static int hf_ulmap_aas_sdma_nsch = -1;
static int hf_ulmap_aas_sdma_spid = -1;
static int hf_ulmap_aas_sdma_power_adjustment = -1;
static int hf_ulmap_feedback_polling_extended_2_uiuc = -1;
static int hf_ulmap_feedback_polling_length = -1;
static int hf_ulmap_feedback_polling_num_allocation = -1;
static int hf_ulmap_feedback_polling_dedicated_ul_allocation_included = -1;
static int hf_ulmap_feedback_polling_basic_cid = -1;
static int hf_ulmap_feedback_polling_allocation_duration = -1;
static int hf_ulmap_feedback_polling_type = -1;
static int hf_ulmap_feedback_polling_frame_offset = -1;
static int hf_ulmap_feedback_polling_period = -1;
static int hf_ulmap_feedback_polling_uiuc = -1;
static int hf_ulmap_feedback_polling_ofdma_symbol_offset = -1;
static int hf_ulmap_feedback_polling_subchannel_offset = -1;
static int hf_ulmap_feedback_polling_duration = -1;
static int hf_ulmap_feedback_polling_repetition_coding_indication = -1;
static int hf_ulmap_reduced_aas_aas_zone_configuration_included = -1;
static int hf_ulmap_reduced_aas_aas_zone_position_included = -1;
static int hf_ulmap_reduced_aas_ul_map_information_included = -1;
static int hf_ulmap_reduced_aas_phy_modification_included = -1;
static int hf_ulmap_reduced_aas_power_control_included = -1;
static int hf_ulmap_reduced_aas_include_feedback_header = -1;
static int hf_ulmap_reduced_aas_encoding_mode = -1;
static int hf_ulmap_reduced_aas_permutation = -1;
static int hf_ulmap_reduced_aas_ul_permbase = -1;
static int hf_ulmap_reduced_aas_preamble_indication = -1;
static int hf_ulmap_reduced_aas_padding = -1;
static int hf_ulmap_reduced_aas_zone_symbol_offset = -1;
static int hf_ulmap_reduced_aas_zone_length = -1;
static int hf_ulmap_reduced_aas_ucd_count = -1;
static int hf_ulmap_reduced_aas_private_map_alloc_start_time = -1;
static int hf_ulmap_reduced_aas_pilot_pattern_index = -1;
static int hf_ulmap_reduced_aas_preamble_select = -1;
static int hf_ulmap_reduced_aas_preamble_shift_index = -1;
static int hf_ulmap_reduced_aas_pilot_pattern_modifier = -1;
static int hf_ulmap_reduced_aas_power_control = -1;
static int hf_ulmap_reduced_aas_ul_frame_offset = -1;
static int hf_ulmap_reduced_aas_slot_offset = -1;
static int hf_ulmap_reduced_aas_slot_duration = -1;
static int hf_ulmap_reduced_aas_uiuc_nep = -1;
static int hf_ulmap_reduced_aas_acid = -1;
static int hf_ulmap_reduced_aas_ai_sn = -1;
static int hf_ulmap_reduced_aas_nsch = -1;
static int hf_ulmap_reduced_aas_spid = -1;
static int hf_ulmap_reduced_aas_repetition_coding_indication = -1;
static expert_field ei_ulmap_not_implemented = EI_INIT;
/* This gets called each time a capture file is loaded. */
void init_wimax_globals(void)
{
cqich_id_size = 0;
harq = 0;
ir_type = 0;
N_layer = 0;
RCID_Type = 0;
}
/********************************************************************
* UL-MAP HARQ Sub-Burst IEs
* 8.4.5.4.24 table 302j
* these functions take offset/length in bits
*******************************************************************/
static gint Dedicated_UL_Control_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.4.24.1 Dedicated_UL_Control_IE -- table 302r */
/* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
gint bit;
proto_item *tree;
gint sdma;
bit = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302r, NULL, "Dedicated_UL_Control_IE");
XBIT_HF(4, hf_ulmap_dedicated_ul_control_length);
XBIT_HF_VALUE(sdma, 4, hf_ulmap_dedicated_ul_control_control_header);
if ((sdma & 1) == 1) {
XBIT_HF(2, hf_ulmap_dedicated_ul_control_num_sdma_layers);
XBIT_HF(2, hf_ulmap_dedicated_ul_control_pilot_pattern);
}
return (bit - offset); /* length in bits */
}
static gint Dedicated_MIMO_UL_Control_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.4.24.2 Dedicated_MIMO_UL_Control_IE -- table 302s */
/* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
gint bit;
proto_item *tree;
bit = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302s, NULL, "Dedicated_MIMO_UL_Control_IE");
XBIT_HF(2, hf_ulmap_dedicated_mimo_ul_control_matrix);
XBIT_HF_VALUE(N_layer, 2, hf_ulmap_dedicated_mimo_ul_control_n_layer);
return (bit - offset); /* length in bits */
}
/* begin Sub-Burst IEs */
static gint UL_HARQ_Chase_Sub_Burst_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.4.24 UL_HARQ_Chase_sub_burst_IE -- table 302k */
/* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
gint bit;
proto_item *tree;
/*proto_item *generic_item = NULL;*/
gint duci;
/*guint16 calculated_crc;*/
bit = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, BITHI(offset,length), ett_302k, NULL, "UL_HARQ_Chase_Sub_Burst_IE");
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
XBIT_HF_VALUE(duci, 1, hf_ulmap_harq_chase_dedicated_ul_control_indicator);
if (duci == 1) {
bit += Dedicated_UL_Control_IE(tree, bit, length, tvb);
}
XBIT_HF(4, hf_ulmap_harq_chase_uiuc);
XBIT_HF(2, hf_ulmap_harq_chase_repetition_coding_indication);
XBIT_HF(10, hf_ulmap_harq_chase_duration);
XBIT_HF(4, hf_ulmap_harq_chase_acid);
XBIT_HF(1, hf_ulmap_harq_chase_ai_sn);
XBIT_HF(1, hf_ulmap_harq_chase_ack_disable);
XBIT_HF(1, hf_ulmap_reserved_uint);
#if 0
if (include_cor2_changes)
{
calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BITHI(bit,16), hf_ulmap_crc16, hf_ulmap_crc16_status, &ei_ulmap_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
#endif
return (bit - offset); /* length in bits */
}
static gint UL_HARQ_IR_CTC_Sub_Burst_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.4.24 UL_HARQ_IR_CTC_sub_burst_IE -- table 302l */
/* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
gint bit;
proto_item *tree;
/*proto_item *generic_item = NULL;*/
gint duci;
/*guint16 calculated_crc;*/
bit = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302l, NULL, "UL_HARQ_IR_CTC_Sub_Burst_IE");
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
XBIT_HF_VALUE(duci, 1, hf_ulmap_harq_ir_ctc_dedicated_ul_control_indicator);
if (duci == 1) {
bit += Dedicated_UL_Control_IE(tree, bit, length, tvb);
}
XBIT_HF(4, hf_ulmap_harq_ir_ctc_nep);
XBIT_HF(4, hf_ulmap_harq_ir_ctc_nsch);
XBIT_HF(2, hf_ulmap_harq_ir_ctc_spid);
XBIT_HF(4, hf_ulmap_harq_ir_ctc_acin);
XBIT_HF(1, hf_ulmap_harq_ir_ctc_ai_sn);
XBIT_HF(1, hf_ulmap_harq_ir_ctc_ack_disable);
XBIT_HF(3, hf_ulmap_reserved_uint);
#if 0
if (include_cor2_changes)
{
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BITHI(bit,16), hf_ulmap_crc16, hf_ulmap_crc16_status, &ei_ulmap_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
#endif
return (bit - offset); /* length in bits */
}
static gint UL_HARQ_IR_CC_Sub_Burst_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.4.24 UL_HARQ_IR_CC_sub_burst_IE -- table 302m */
/* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
gint bit;
proto_item *tree;
/*proto_item *generic_item = NULL;*/
gint duci;
/*guint16 calculated_crc;*/
bit = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302m, NULL, "UL_HARQ_IR_CC_Sub_Burst_IE");
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
XBIT_HF_VALUE(duci, 1, hf_ulmap_harq_ir_cc_dedicated_ul_control_indicator);
if (duci == 1) {
bit += Dedicated_UL_Control_IE(tree, bit, length, tvb);
}
XBIT_HF(4, hf_ulmap_harq_ir_cc_uiuc);
XBIT_HF(2, hf_ulmap_harq_ir_cc_repetition_coding_indication);
XBIT_HF(10, hf_ulmap_harq_ir_cc_duration);
XBIT_HF(2, hf_ulmap_harq_ir_cc_spid);
XBIT_HF(4, hf_ulmap_harq_ir_cc_acid);
XBIT_HF(1, hf_ulmap_harq_ir_cc_ai_sn);
XBIT_HF(1, hf_ulmap_harq_ir_cc_ack_disable);
XBIT_HF(3, hf_ulmap_reserved_uint);
#if 0
if (include_cor2_changes)
{
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BITHI(bit,16), hf_ulmap_crc16, hf_ulmap_crc16_status, &ei_ulmap_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
#endif
return (bit - offset); /* length in bits */
}
static gint MIMO_UL_Chase_HARQ_Sub_Burst_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.4.24 MIMO_UL_Chase_HARQ_Sub_Burst_IE -- table 302n */
/* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
gint bit;
proto_item *tree;
/*proto_item *generic_item = NULL;*/
gint muin,dmci,ackd,i;
/*guint16 calculated_crc;*/
bit = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302n, NULL, "MIMO_UL_Chase_HARQ_Sub_Burst_IE");
XBIT_HF_VALUE(muin, 1, hf_ulmap_mimo_ul_chase_harq_mu_indicator);
XBIT_HF_VALUE(dmci, 1, hf_ulmap_mimo_ul_chase_harq_dedicated_mimo_ulcontrol_indicator);
XBIT_HF_VALUE(ackd, 1, hf_ulmap_mimo_ul_chase_harq_ack_disable);
if (muin == 0) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
if (dmci) {
bit += Dedicated_MIMO_UL_Control_IE(tree, bit, length, tvb);
}
} else {
XBIT_HF(1, hf_ulmap_mimo_ul_chase_harq_matrix);
}
XBIT_HF(10, hf_ulmap_mimo_ul_chase_harq_duration);
for (i = 0; i < N_layer; i++) {
if (muin == 1) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
}
XBIT_HF(4, hf_ulmap_mimo_ul_chase_harq_uiuc);
XBIT_HF(2, hf_ulmap_mimo_ul_chase_harq_repetition_coding_indication);
if (ackd == 0) {
XBIT_HF(4, hf_ulmap_mimo_ul_chase_harq_acid);
XBIT_HF(1, hf_ulmap_mimo_ul_chase_harq_ai_sn);
}
}
#if 0
if (include_cor2_changes)
{
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BITHI(bit,16), hf_ulmap_crc16, hf_ulmap_crc16_status, &ei_ulmap_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
#endif
return (bit - offset); /* length in bits */
}
static gint MIMO_UL_IR_HARQ__Sub_Burst_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.4.24 MIMO_UL_IR_HARQ__Sub_Burst_IE -- table 302o */
/* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
gint bit;
proto_item *tree;
/*proto_item *generic_item = NULL;*/
gint muin,dmci,ackd,i;
/*guint16 calculated_crc;*/
bit = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302o, NULL, "MIMO_UL_IR_HARQ__Sub_Burst_IE");
XBIT_HF_VALUE(muin, 1, hf_ulmap_mimo_ul_ir_harq_mu_indicator);
XBIT_HF_VALUE(dmci, 1, hf_ulmap_mimo_ul_ir_harq_dedicated_mimo_ul_control_indicator);
XBIT_HF_VALUE(ackd, 1, hf_ulmap_mimo_ul_ir_harq_ack_disable);
if (muin == 0) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
if (dmci) {
bit += Dedicated_MIMO_UL_Control_IE(tree, bit, length, tvb);
}
} else {
XBIT_HF(1, hf_ulmap_mimo_ul_ir_harq_matrix);
}
XBIT_HF(4, hf_ulmap_mimo_ul_ir_harq_nsch);
for (i = 0; i < N_layer; i++) {
if (muin == 1) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
}
XBIT_HF(4, hf_ulmap_mimo_ul_ir_harq_nep);
if (ackd == 0) {
XBIT_HF(2, hf_ulmap_mimo_ul_ir_harq_spid);
XBIT_HF(4, hf_ulmap_mimo_ul_ir_harq_acid);
XBIT_HF(1, hf_ulmap_mimo_ul_ir_harq_ai_sn);
}
}
#if 0
if (include_cor2_changes)
{
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BITHI(bit,16), hf_ulmap_crc16, hf_ulmap_crc16_status, &ei_ulmap_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
#endif
return (bit - offset); /* length in bits */
}
static gint MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.4.24 MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE -- table 302p */
/* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
gint bit;
proto_item *tree;
/*proto_item *generic_item = NULL;*/
gint muin,dmci,ackd,i;
/*guint16 calculated_crc;*/
bit = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302p, NULL, "MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE");
XBIT_HF_VALUE(muin, 1, hf_ulmap_mimo_ul_ir_harq_cc_mu_indicator);
XBIT_HF_VALUE(dmci, 1, hf_ulmap_mimo_ul_ir_harq_cc_dedicated_mimo_ul_control_indicator);
XBIT_HF_VALUE(ackd, 1, hf_ulmap_mimo_ul_ir_harq_cc_ack_disable);
if (muin == 0) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
if (dmci) {
bit += Dedicated_MIMO_UL_Control_IE(tree, bit, length, tvb);
}
} else {
XBIT_HF(1, hf_ulmap_mimo_ul_ir_harq_cc_matrix);
}
XBIT_HF(10, hf_ulmap_mimo_ul_ir_harq_cc_duration);
for (i = 0; i < N_layer; i++) {
if (muin == 1) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
}
XBIT_HF(4, hf_ulmap_mimo_ul_ir_harq_cc_uiuc);
XBIT_HF(2, hf_ulmap_mimo_ul_ir_harq_cc_repetition_coding_indication);
if (ackd == 0) {
XBIT_HF(4, hf_ulmap_mimo_ul_ir_harq_cc_acid);
XBIT_HF(1, hf_ulmap_mimo_ul_ir_harq_cc_ai_sn);
XBIT_HF(2, hf_ulmap_mimo_ul_ir_harq_cc_spid);
}
}
#if 0
if (include_cor2_changes)
{
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BITHI(bit,16), hf_ulmap_crc16, hf_ulmap_crc16_status, &ei_ulmap_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
#endif
return (bit - offset); /* length in bits */
}
static gint MIMO_UL_STC_HARQ_Sub_Burst_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.4.24 MIMO_UL_STC_HARQ_Sub_Burst_IE -- table 302q */
/* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
gint bit;
proto_item *tree;
/*proto_item *generic_item = NULL;*/
gint ackd,txct,sboi;
/*guint16 calculated_crc;*/
bit = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302q, NULL, "MIMO_UL_STC_HARQ_Sub_Burst_IE");
XBIT_HF_VALUE(txct, 2, hf_ulmap_mimo_ul_stc_harq_tx_count);
XBIT_HF(10, hf_ulmap_mimo_ul_stc_harq_duration);
XBIT_HF_VALUE(sboi, 1, hf_ulmap_mimo_ul_stc_harq_sub_burst_offset_indication);
/*XBIT_HF_VALUE(muin, 1, hf_ulmap_reserved_uint);*/
if (sboi == 1) {
XBIT_HF(8, hf_ulmap_mimo_ul_stc_harq_sub_burst_offset);
}
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
XBIT_HF_VALUE(ackd, 1, hf_ulmap_mimo_ul_stc_harq_ack_disable);
if (txct == 0) {
XBIT_HF(4, hf_ulmap_mimo_ul_stc_harq_uiuc);
XBIT_HF(2, hf_ulmap_mimo_ul_stc_harq_repetition_coding_indication);
}
if (ackd == 0) {
XBIT_HF(4, hf_ulmap_mimo_ul_stc_harq_acid);
}
#if 0
if (include_cor2_changes)
{
/* CRC-16 is always appended */
calculated_crc = wimax_mac_calc_crc16((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
proto_tree_add_checksum(tree, tvb, BITHI(bit,16), hf_ulmap_crc16, hf_ulmap_crc16_status, &ei_ulmap_crc16, pinfo, calculated_crc,
ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
bit += 16;
}
#endif
return (bit - offset); /* length in bits */
}
/********************************************************************
* UL-MAP Extended IEs
* table 290a
*******************************************************************/
static gint Power_Control_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended IE = 0 */
/* 8.4.5.4.5 Power_Control_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_item *tree;
nib = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_292, NULL, "Power_Control_IE");
VNIB(data, 1, hf_ulmap_ie_diuc_ext);
VNIB(data, 1, hf_ulmap_ie_length);
VNIB(data, 2, hf_ulmap_power_control);
VNIB(data, 2, hf_ulmap_power_measurement_frame);
return nib;
}
static gint Mini_Subchannel_allocation_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended IE = 1 */
/* 8.4.5.4.8 [2] Mini-Subchannel_allocation_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
guint idx;
proto_item *tree;
gint j, M;
const gint m_table[4] = { 2, 2, 3, 6 };
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_295, NULL, "Mini_subchannel_allocation_IE");
XBIT_HF(4, hf_ulmap_mini_subcha_alloc_extended_2_uiuc);
XBIT_HF(8, hf_ulmap_mini_subcha_alloc_length);
XBIT_HF_VALUE(idx, 2, hf_ulmap_mini_subcha_alloc_ctype);
M = m_table[idx];
XBIT_HF(6, hf_ulmap_mini_subcha_alloc_duration);
for (j = 0; j < M; j++) {
data = TVB_BIT_BITS(bit, tvb, 16);
proto_tree_add_uint_format(tree, hf_ulmap_mini_subcha_alloc_cid, tvb, BITHI(bit, 16), data, "CID(%d): %d", j, data);
bit += 16;
data = TVB_BIT_BITS(bit, tvb, 4);
proto_tree_add_uint_format(tree, hf_ulmap_mini_subcha_alloc_uiuc, tvb, BITHI(bit, 4), data, "UIUC(%d): %d", j, data);
bit += 4;
data = TVB_BIT_BITS(bit, tvb, 2);
proto_tree_add_uint_format(tree, hf_ulmap_mini_subcha_alloc_repetition, tvb, BITHI(bit, 2), data, "Repetition(%d): %d", j, data);
bit += 2;
}
if (M == 3) {
XBIT_HF(4, hf_ulmap_mini_subcha_alloc_padding);
}
return BIT_TO_NIB(bit);
}
static gint AAS_UL_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended IE = 2 */
/* 8.4.5.4.6 [2] AAS_UL_IE*/
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_item *tree;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_293, NULL, "AAS_UL_IE");
XBIT_HF(4, hf_ulmap_aas_ul_extended_uiuc);
XBIT_HF(4, hf_ulmap_aas_ul_length);
XBIT_HF(2, hf_ulmap_aas_ul_permutation);
XBIT_HF(7, hf_ulmap_aas_ul_ul_permbase);
XBIT_HF(8, hf_ulmap_aas_ul_ofdma_symbol_offset);
XBIT_HF(8, hf_ulmap_aas_ul_aas_zone_length);
XBIT_HF(2, hf_ulmap_aas_ul_uplink_preamble_config);
XBIT_HF(1, hf_ulmap_aas_ul_preamble_type);
XBIT_HF(4, hf_ulmap_reserved_uint);
return BIT_TO_NIB(bit);
}
static gint CQICH_Alloc_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended IE = 3 */
/* 8.4.5.4.12 [2] CQICH_Alloc_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
gint target;
proto_item *tree;
gint rci, rtype, ftype, zperm, mgi, api, pad;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_300, NULL, "CQICH_Alloc_IE");
XBIT_HF(4, hf_ulmap_cqich_alloc_extended_uiuc);
XBIT_HF_VALUE(data, 4, hf_ulmap_cqich_alloc_length);
target = bit + BYTE_TO_BIT(data);
if (cqich_id_size == 0) {
proto_tree_add_uint_format_value(tree, hf_ulmap_cqich_alloc_cqich_id, tvb, BITHI(bit, 1), cqich_id_size, "n/a (size == 0 bits)");
} else {
/* variable from 0-9 bits */
data = TVB_BIT_BITS16(bit, tvb, cqich_id_size);
proto_tree_add_uint_format_value(tree, hf_ulmap_cqich_alloc_cqich_id, tvb, BITHI(bit, cqich_id_size), data, "%d (%d bits)", data, cqich_id_size);
bit += cqich_id_size;
}
XBIT_HF(6, hf_ulmap_cqich_alloc_allocation_offset);
XBIT_HF(2, hf_ulmap_cqich_alloc_period);
XBIT_HF(3, hf_ulmap_cqich_alloc_frame_offset);
XBIT_HF(3, hf_ulmap_cqich_alloc_duration);
XBIT_HF_VALUE(rci, 1, hf_ulmap_cqich_alloc_report_configuration_included);
if (rci)
{
XBIT_HF_VALUE(ftype, 2, hf_ulmap_cqich_alloc_feedback_type);
XBIT_HF_VALUE(rtype, 1, hf_ulmap_cqich_alloc_report_type);
if (rtype == 0) {
XBIT_HF(1, hf_ulmap_cqich_alloc_cinr_preamble_report_type);
}
else {
XBIT_HF_VALUE(zperm, 3, hf_ulmap_cqich_alloc_zone_permutation);
XBIT_HF(2, hf_ulmap_cqich_alloc_zone_type);
XBIT_HF(2, hf_ulmap_cqich_alloc_zone_prbs_id);
if (zperm == 0 || zperm == 1) {
XBIT_HF_VALUE(mgi, 1, hf_ulmap_cqich_alloc_major_group_indication);
if (mgi == 1) {
/* PUSC major group bitmap*/
XBIT_HF(6, hf_ulmap_cqich_alloc_pusc_major_group_bitmap);
}
}
XBIT_HF(1, hf_ulmap_cqich_alloc_cinr_zone_measurement_type);
}
if (ftype == 0) {
XBIT_HF_VALUE(api, 1, hf_ulmap_cqich_alloc_averaging_parameter_included);
if (api == 1) {
XBIT_HF(4, hf_ulmap_cqich_alloc_averaging_parameter);
}
}
}
XBIT_HF(2, hf_ulmap_cqich_alloc_mimo_permutation_feedback_cycle);
pad = target - bit;
if (pad) {
proto_tree_add_bytes_format_value(tree, hf_ulmap_padding, tvb, BITHI(bit, pad), NULL, "%d bits", pad);
bit += pad;
}
return BIT_TO_NIB(bit); /* Return position in nibbles. */
}
static gint UL_Zone_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended IE = 4 */
/* 8.4.5.4.7 [2] UL_Zone_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_item *tree;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_294, NULL, "UL_Zone_IE");
XBIT_HF(4, hf_ulmap_zone_extended_uiuc);
XBIT_HF(4, hf_ulmap_zone_length);
XBIT_HF(7, hf_ulmap_zone_ofdma_symbol_offset);
XBIT_HF(2, hf_ulmap_zone_permutation);
XBIT_HF(7, hf_ulmap_zone_ul_permbase);
XBIT_HF(2, hf_ulmap_zone_amc_type);
XBIT_HF(1, hf_ulmap_zone_use_all_sc_indicator);
XBIT_HF(1, hf_ulmap_zone_disable_subchannel_rotation);
XBIT_HF(4, hf_ulmap_reserved_uint);
return BIT_TO_NIB(bit);
}
static gint PHYMOD_UL_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended IE = 5 */
/* 8.4.5.4.14 [2] PHYMOD_UL_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_item *tree;
gint pmt;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302, NULL, "PHYMOD_UL_IE");
XBIT_HF(4, hf_ulmap_phymod_ul_extended_uiuc);
XBIT_HF(4, hf_ulmap_phymod_ul_length);
XBIT_HF_VALUE(pmt, 1, hf_ulmap_phymod_ul_preamble_modifier_type);
if (pmt == 0) {
XBIT_HF(4, hf_ulmap_phymod_ul_preamble_frequency_shift_index);
} else {
XBIT_HF(4, hf_ulmap_phymod_ul_preamble_time_shift_index);
}
XBIT_HF(1, hf_ulmap_phymod_ul_pilot_pattern_modifier);
XBIT_HF(2, hf_ulmap_phymod_ul_pilot_pattern_index);
return BIT_TO_NIB(bit);
}
static gint MIMO_UL_IE(proto_tree *uiuc_tree, packet_info* pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended IE = 6 */
/* 8.4.5.4.11 MIMO_UL_Basic_IE (not implemented) */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_item *tree;
nib = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_299, NULL, "MIMO_UL_Basic_IE");
VNIB(data, 1, hf_ulmap_ie_diuc_ext);
VNIB(data, 1, hf_ulmap_ie_length);
proto_tree_add_expert(tree, pinfo, &ei_ulmap_not_implemented, tvb, NIBHI(nib,length-2));
return nib;
}
static gint ULMAP_Fast_Tracking_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended IE = 7 */
/* 8.4.5.4.22 [2] ULMAP_Fast_Tracking_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_item *tree;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302h, NULL, "Fast_Tracking_IE");
length = NIB_TO_BIT(length);
XBIT_HF(4, hf_ulmap_fast_tracking_extended_uiuc);
XBIT_HF(4, hf_ulmap_fast_tracking_length);
XBIT_HF(2, hf_ulmap_fast_tracking_map_index);
XBIT_HF(6, hf_ulmap_reserved_uint);
while (bit < (length-7)) {
XBIT_HF(3, hf_ulmap_fast_tracking_power_correction);
XBIT_HF(3, hf_ulmap_fast_tracking_frequency_correction);
XBIT_HF(2, hf_ulmap_fast_tracking_time_correction);
}
return BIT_TO_NIB(bit);
}
static gint UL_PUSC_Burst_Allocation_in_other_segment_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended IE = 8 */
/* 8.4.5.4.17 [2] UL_PUSC_Burst_Allocation_in_other_segment_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_item *tree;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302c, NULL, "UL_PUSC_Burst_Allocation_in_Other_Segment_IE");
XBIT_HF(4, hf_ulmap_pusc_burst_allocation_extended_uiuc);
XBIT_HF(4, hf_ulmap_pusc_burst_allocation_length);
XBIT_HF(4, hf_ulmap_pusc_burst_allocation_uiuc);
XBIT_HF(2, hf_ulmap_pusc_burst_allocation_segment);
XBIT_HF(7, hf_ulmap_pusc_burst_allocation_ul_permbase);
XBIT_HF(8, hf_ulmap_pusc_burst_allocation_ofdma_symbol_offset);
XBIT_HF(6, hf_ulmap_pusc_burst_allocation_subchannel_offset);
XBIT_HF(10, hf_ulmap_pusc_burst_allocation_duration);
XBIT_HF(2, hf_ulmap_pusc_burst_allocation_repetition_coding_indication);
XBIT_HF(1, hf_ulmap_reserved_uint);
return BIT_TO_NIB(bit);
}
static gint Fast_Ranging_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended IE = 9 */
/* 8.4.5.4.21 [2] Fast_Ranging_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_item *tree;
gint hidi;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302g, NULL, "Fast_Ranging_IE");
XBIT_HF(4, hf_ulmap_fast_ranging_extended_uiuc);
XBIT_HF(4, hf_ulmap_fast_ranging_length);
XBIT_HF_VALUE(hidi, 1, hf_ulmap_fast_ranging_ho_id_indicator);
XBIT_HF(7, hf_ulmap_reserved_uint);
if (hidi == 1) {
XBIT_HF(8, hf_ulmap_fast_ranging_ho_id);
/* XBIT_HF(40, hf_ulmap_reserved_uint); TODO */
} else {
proto_tree_add_item(tree, hf_ulmap_fast_ranging_mac_address, tvb, BITHI(bit, 48), ENC_NA);
bit += 48;
}
XBIT_HF(4, hf_ulmap_fast_ranging_uiuc);
XBIT_HF(10, hf_ulmap_fast_ranging_duration);
XBIT_HF(2, hf_ulmap_fast_ranging_repetition_coding_indication);
return BIT_TO_NIB(bit);
}
static gint UL_Allocation_Start_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended IE = 0xA */
/* 8.4.5.4.15 [2] UL_Allocation_Start_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_item *tree;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302a, NULL, "UL_Allocation_start_IE");
XBIT_HF(4, hf_ulmap_allocation_start_extended_uiuc);
XBIT_HF(4, hf_ulmap_allocation_start_length);
XBIT_HF(8, hf_ulmap_allocation_start_ofdma_symbol_offset);
XBIT_HF(7, hf_ulmap_allocation_start_subchannel_offset);
XBIT_HF(1, hf_ulmap_reserved_uint);
return BIT_TO_NIB(bit);
}
/********************************************************************
* UL-MAP Extended-2 IEs
* table 290c
*******************************************************************/
static gint CQICH_Enhanced_Allocation_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended-2 IE = 0 */
/* 8.4.5.4.16 [2] CQICH_Enhanced_Allocation_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_item *tree;
gint i, cnum, bapm;
guint pad;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302b, NULL, "CQICH_Enhanced_Alloc_IE");
XBIT_HF(4, hf_ulmap_cqich_enhanced_alloc_extended_2_uiuc);
XBIT_HF(8, hf_ulmap_cqich_enhanced_alloc_length);
if (cqich_id_size == 0) {
proto_tree_add_uint_format_value(tree, hf_ulmap_cqich_enhanced_alloc_cqich_id, tvb, BITHI(bit, 1), cqich_id_size, "n/a (size == 0 bits)");
} else {
/* variable from 0-9 bits */
data = TVB_BIT_BITS16(bit, tvb, cqich_id_size);
proto_tree_add_uint_format_value(tree, hf_ulmap_cqich_enhanced_alloc_cqich_id, tvb, BITHI(bit, cqich_id_size), data, "%d (%d bits)", data, cqich_id_size);
bit += cqich_id_size;
}
XBIT_HF(3, hf_ulmap_cqich_enhanced_alloc_period);
XBIT_HF(3, hf_ulmap_cqich_enhanced_alloc_frame_offset);
XBIT_HF(3, hf_ulmap_cqich_enhanced_alloc_duration);
XBIT_HF_VALUE(cnum, 4, hf_ulmap_cqich_enhanced_alloc_cqich_num);
cnum += 1;
for (i = 0; i < cnum; i++) {
XBIT_HF(3, hf_ulmap_cqich_enhanced_alloc_feedback_type);
XBIT_HF(6, hf_ulmap_cqich_enhanced_alloc_allocation_index);
XBIT_HF(3, hf_ulmap_cqich_enhanced_alloc_cqich_type);
XBIT_HF(1, hf_ulmap_cqich_enhanced_alloc_sttd_indication);
}
XBIT_HF_VALUE(bapm, 1, hf_ulmap_cqich_enhanced_alloc_band_amc_precoding_mode);
if (bapm == 1) {
XBIT_HF(3, hf_ulmap_cqich_enhanced_alloc_nr_precoders_feedback);
}
pad = BIT_PADDING(bit,8);
if (pad) {
proto_tree_add_bytes_format_value(tree, hf_ulmap_padding, tvb, BITHI(bit, pad), NULL, "%d bits", pad);
bit += pad;
}
return BIT_TO_NIB(bit);
}
static gint HO_Anchor_Active_UL_MAP_IE(proto_tree *uiuc_tree, packet_info* pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended-2 IE = 1 */
/* 8.4.5.4.18 [2] HO_Anchor_Active_UL_MAP_IE (not implemented) */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_item *tree;
nib = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302d, NULL, "HO_Anchor_Active_UL_MAP_IE");
VNIB(data, 1, hf_ulmap_ie_diuc_ext2);
VNIB(data, 2, hf_ulmap_ie_length);
proto_tree_add_expert(tree, pinfo, &ei_ulmap_not_implemented, tvb, NIBHI(nib,length-3));
return nib;
}
static gint HO_Active_Anchor_UL_MAP_IE(proto_tree *uiuc_tree, packet_info* pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended-2 IE = 2 */
/* 8.4.5.4.19 [2] HO_Active_Anchor_UL_MAP_IE (not implemented) */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_item *tree;
nib = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302e, NULL, "HO_Active_Anchor_UL_MAP_IE");
VNIB(data, 1, hf_ulmap_ie_diuc_ext2);
VNIB(data, 2, hf_ulmap_ie_length);
proto_tree_add_expert(tree, pinfo, &ei_ulmap_not_implemented, tvb, NIBHI(nib,length-3));
return nib;
}
static gint Anchor_BS_switch_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended-2 IE = 3 */
/* 8.4.5.4.23 [2] Anchor_BS_switch_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
gint data;
proto_item *tree;
gint nbss, acod, cqai, pad;
gint i;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302i, NULL, "Anchor_BS_switch_IE");
XBIT_HF(4, hf_ulmap_anchor_bs_switch_extended_2_uiuc);
XBIT_HF(8, hf_ulmap_anchor_bs_switch_length);
XBIT_HF_VALUE(nbss, 4, hf_ulmap_anchor_bs_switch_n_anchor_bs_switch);
for (i = 0; i < nbss; i++) {
XBIT_HF(12, hf_ulmap_anchor_bs_switch_reduced_cid);
XBIT_HF_VALUE(acod, 2, hf_ulmap_anchor_bs_switch_action_code);
if (acod == 1) {
XBIT_HF(3, hf_ulmap_anchor_bs_switch_action_time);
XBIT_HF(3, hf_ulmap_anchor_bs_switch_temp_bs_id);
XBIT_HF(2, hf_ulmap_reserved_uint);
}
if (acod == 0 || acod == 1) {
XBIT_HF(1, hf_ulmap_anchor_bs_switch_ak_change_indicator);
XBIT_HF_VALUE(cqai, 1, hf_ulmap_anchor_bs_switch_cqich_allocation_indicator);
if (cqai == 1) {
/* variable bits from 0-9 */
if (cqich_id_size == 0) {
proto_tree_add_uint_format_value(tree, hf_ulmap_anchor_bs_switch_cqich_id, tvb, BITHI(bit, 1), cqich_id_size, "n/a (size == 0 bits)");
} else {
data = TVB_BIT_BITS16(bit, tvb, cqich_id_size);
proto_tree_add_uint_format_value(tree, hf_ulmap_anchor_bs_switch_cqich_id, tvb, BITHI(bit, cqich_id_size),
data, "%d (%d bits)", data, cqich_id_size);
bit += cqich_id_size;
}
XBIT_HF(6, hf_ulmap_anchor_bs_switch_feedback_channel_offset);
XBIT_HF(2, hf_ulmap_anchor_bs_switch_period);
XBIT_HF(3, hf_ulmap_anchor_bs_switch_frame_offset);
XBIT_HF(3, hf_ulmap_anchor_bs_switch_duration);
XBIT_HF(2, hf_ulmap_anchor_bs_switch_mimo_permutation_feedback_code);
pad = BIT_PADDING(bit,8);
if (pad) {
proto_tree_add_uint_format_value(tree, hf_ulmap_reserved, tvb, BITHI(bit,pad), 0, "%d bits", pad);
}
}
} else {
XBIT_HF(2, hf_ulmap_reserved_uint);
}
}
XBIT_HF(4, hf_ulmap_reserved_uint);
return BIT_TO_NIB(bit);
}
static gint UL_sounding_command_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended-2 IE = 4 */
/* 8.4.5.4.26 [2] UL_sounding_command_IE */
/* see 8.4.6.2.7.1 */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_item *tree;
gint stype, srlf, iafb, pad, sept, nssym, ncid, amod;
gint i, j;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_315d, NULL, "UL_Sounding_Command_IE");
XBIT_HF(4, hf_ulmap_sounding_command_extended_2_uiuc);
XBIT_HF(8, hf_ulmap_sounding_command_length);
XBIT_HF_VALUE(stype, 1, hf_ulmap_sounding_command_type);
XBIT_HF(1, hf_ulmap_sounding_command_send_sounding_report_flag);
XBIT_HF_VALUE(srlf, 1, hf_ulmap_sounding_command_relevance_flag);
if (srlf == 0) {
XBIT_HF(1, hf_ulmap_sounding_command_relevance);
XBIT_HF(2, hf_ulmap_reserved_uint);
} else {
XBIT_HF(3, hf_ulmap_reserved_uint);
}
XBIT_HF_VALUE(iafb, 2, hf_ulmap_sounding_command_include_additional_feedback);
if (stype == 0) {
XBIT_HF_VALUE(nssym, 3, hf_ulmap_sounding_command_num_sounding_symbols);
XBIT_HF(1, hf_ulmap_reserved_uint);
for (i = 0; i < nssym; i++) {
XBIT_HF_VALUE(sept, 1, hf_ulmap_sounding_command_separability_type);
if (sept == 0) {
XBIT_HF(3, hf_ulmap_sounding_command_max_cyclic_shift_index_p);
XBIT_HF(1, hf_ulmap_reserved_uint);
} else {
XBIT_HF(3, hf_ulmap_sounding_command_decimation_value);
XBIT_HF(1, hf_ulmap_sounding_command_decimation_offset_randomization);
}
XBIT_HF(3, hf_ulmap_sounding_command_symbol_index);
XBIT_HF_VALUE(ncid, 7, hf_ulmap_sounding_command_number_of_cids);
XBIT_HF(1, hf_ulmap_reserved_uint);
for (j = 0; j < ncid; j++) {
XBIT_HF(12, hf_ulmap_sounding_command_shorted_basic_cid);
XBIT_HF(2, hf_ulmap_sounding_command_power_assignment_method);
XBIT_HF(1, hf_ulmap_sounding_command_power_boost);
XBIT_HF(1, hf_ulmap_sounding_command_multi_antenna_flag);
XBIT_HF_VALUE(amod, 1, hf_ulmap_sounding_command_allocation_mode);
if (amod == 1) {
XBIT_HF(12, hf_ulmap_sounding_command_band_bit_map);
XBIT_HF(2, hf_ulmap_reserved_uint);
} else {
XBIT_HF(7, hf_ulmap_sounding_command_starting_frequency_band);
XBIT_HF(7, hf_ulmap_sounding_command_number_of_frequency_bands);
}
if (srlf == 1) {
XBIT_HF(1, hf_ulmap_sounding_command_relevance);
} else {
XBIT_HF(1, hf_ulmap_reserved_uint);
}
if (sept == 0) {
XBIT_HF(5, hf_ulmap_sounding_command_cyclic_time_shift_index);
} else {
XBIT_HF(6, hf_ulmap_sounding_command_decimation_offset);
if (iafb == 1) {
XBIT_HF(1, hf_ulmap_sounding_command_use_same_symbol_for_additional_feedback);
XBIT_HF(2, hf_ulmap_reserved_uint);
} else {
XBIT_HF(3, hf_ulmap_reserved_uint);
}
}
XBIT_HF(3, hf_ulmap_sounding_command_periodicity);
}
}
} else {
XBIT_HF(3, hf_ulmap_sounding_command_permutation);
XBIT_HF(6, hf_ulmap_sounding_command_dl_permbase);
XBIT_HF_VALUE(nssym, 3, hf_ulmap_sounding_command_num_sounding_symbols);
for (i = 0; i < nssym; i++) {
XBIT_HF_VALUE(ncid, 7, hf_ulmap_sounding_command_number_of_cids);
XBIT_HF(1, hf_ulmap_reserved_uint);
for (j = 0; j < ncid; j++) {
XBIT_HF(12, hf_ulmap_sounding_command_shortened_basic_cid);
if (srlf) {
XBIT_HF(1, hf_ulmap_sounding_command_relevance);
XBIT_HF(3, hf_ulmap_reserved_uint);
}
XBIT_HF(7, hf_ulmap_sounding_command_subchannel_offset);
XBIT_HF(1, hf_ulmap_sounding_command_power_boost);
XBIT_HF(3, hf_ulmap_sounding_command_number_of_subchannels);
XBIT_HF(3, hf_ulmap_sounding_command_periodicity);
XBIT_HF(2, hf_ulmap_sounding_command_power_assignment_method);
}
}
}
pad = BIT_PADDING(bit,8);
if (pad) {
proto_tree_add_bytes_format_value(tree, hf_ulmap_padding, tvb, BITHI(bit, pad), NULL, "%d bits", pad);
bit += pad;
}
return BIT_TO_NIB(bit);
}
static gint MIMO_UL_Enhanced_IE(proto_tree *uiuc_tree, packet_info* pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended-2 IE = 6 */
/* 8.4.5.4.20 [2] MIMO_UL_Enhanced_IE (not implemented) */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint nib;
gint data;
proto_item *tree;
nib = offset;
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302f, NULL, "MIMO_UL_Enhanced_IE");
VNIB(data, 1, hf_ulmap_ie_diuc_ext2);
VNIB(data, 2, hf_ulmap_ie_length);
proto_tree_add_expert(tree, pinfo, &ei_ulmap_not_implemented, tvb, NIBHI(nib,length-3));
return nib;
}
static gint HARQ_ULMAP_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended-2 IE = 7 */
/* 8.4.5.4.24 HARQ_ULMAP_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_item *tree;
gint bitlength;
gint lastbit;
gint pad, mode, alsi, nsub;
gint i;
bit = NIB_TO_BIT(offset);
bitlength = NIB_TO_BIT(length);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302j, NULL, "HARQ_ULMAP_IE");
XBIT_HF(4, hf_ulmap_harq_ulmap_extended_2_uiuc);
XBIT_HF(8, hf_ulmap_harq_ulmap_length);
XBIT_HF_VALUE(RCID_Type, 2, hf_ulmap_harq_ulmap_rcid_type);
XBIT_HF(2, hf_ulmap_reserved_uint);
lastbit = bit + bitlength -16 - 4;
while (bit < lastbit) {
XBIT_HF_VALUE(mode, 3, hf_ulmap_harq_ulmap_mode);
XBIT_HF_VALUE(alsi, 1, hf_ulmap_harq_ulmap_allocation_start_indication);
if (alsi == 1) {
XBIT_HF(8, hf_ulmap_harq_ulmap_ofdma_symbol_offset);
XBIT_HF(7, hf_ulmap_harq_ulmap_subchannel_offset);
XBIT_HF(1, hf_ulmap_reserved_uint);
}
XBIT_HF_VALUE(nsub, 4, hf_ulmap_harq_ulmap_n_sub_burst);
nsub++;
for (i = 0; i < nsub; i++) {
if (mode == 0) {
bit += UL_HARQ_Chase_Sub_Burst_IE(tree, bit, bitlength, tvb);
} else if (mode == 1) {
bit += UL_HARQ_IR_CTC_Sub_Burst_IE(tree, bit, bitlength, tvb);
} else if (mode == 2) {
bit += UL_HARQ_IR_CC_Sub_Burst_IE(tree, bit, bitlength, tvb);
} else if (mode == 3) {
bit += MIMO_UL_Chase_HARQ_Sub_Burst_IE(tree, bit, bitlength, tvb);
} else if (mode == 4) {
bit += MIMO_UL_IR_HARQ__Sub_Burst_IE(tree, bit, bitlength, tvb);
} else if (mode == 5) {
bit += MIMO_UL_IR_HARQ_for_CC_Sub_Burst_UIE(tree, bit, bitlength, tvb);
} else if (mode == 6) {
bit += MIMO_UL_STC_HARQ_Sub_Burst_IE(tree, bit, bitlength, tvb);
}
}
}
pad = NIB_TO_BIT(offset) + bitlength - bit;
if (pad) {
proto_tree_add_bytes_format_value(tree, hf_ulmap_padding, tvb, BITHI(bit, pad), NULL, "%d bits", pad);
bit += pad;
}
return BIT_TO_NIB(bit);
}
static gint HARQ_ACKCH_Region_Allocation_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended-2 IE = 8 */
/* 8.4.5.4.25 [2] HARQ_ACKCH_Region_Allocation_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_item *tree;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302t, NULL, "HARQ_ACKCH_Region_IE");
XBIT_HF(4, hf_ulmap_harq_ackch_region_alloc_extended_2_uiuc);
XBIT_HF(8, hf_ulmap_harq_ackch_region_alloc_length);
XBIT_HF(8, hf_ulmap_harq_ackch_region_alloc_ofdma_symbol_offset);
XBIT_HF(7, hf_ulmap_harq_ackch_region_alloc_subchannel_offset);
XBIT_HF(5, hf_ulmap_harq_ackch_region_alloc_num_ofdma_symbols);
XBIT_HF(4, hf_ulmap_harq_ackch_region_alloc_num_subchannels);
return BIT_TO_NIB(bit);
}
static gint AAS_SDMA_UL_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended-2 IE = 0xE */
/* 8.4.5.4.27 [2] AAS_SDMA_UL_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_item *tree;
gint nreg, pad, user, encm, ppmd, padj;
gint aasp = 0; /* TODO AAS UL preamble used */
gint ii, jj;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302u, NULL, "AAS_SDMA_UL_IE");
XBIT_HF(4, hf_ulmap_aas_sdma_extended_2_uiuc);
XBIT_HF(8, hf_ulmap_aas_sdma_length);
XBIT_HF_VALUE(RCID_Type, 2, hf_ulmap_aas_sdma_rcid_type);
XBIT_HF_VALUE(nreg, 4, hf_ulmap_aas_sdma_num_burst_region);
XBIT_HF(2, hf_ulmap_reserved_uint);
for (ii = 0; ii < nreg; ii++) {
XBIT_HF(12, hf_ulmap_aas_sdma_slot_offset);
XBIT_HF(10, hf_ulmap_aas_sdma_slot_duration);
XBIT_HF_VALUE(user, 3, hf_ulmap_aas_sdma_number_of_users);
XBIT_HF(3, hf_ulmap_reserved_uint);
for (jj = 0; jj < user; jj++) {
bit += RCID_IE(tree, bit, length, tvb, RCID_Type);
XBIT_HF_VALUE(encm, 2, hf_ulmap_aas_sdma_encoding_mode);
XBIT_HF_VALUE(padj, 1, hf_ulmap_aas_sdma_power_adjust);
XBIT_HF_VALUE(ppmd, 1, hf_ulmap_aas_sdma_pilot_pattern_modifier);
if (aasp) {
XBIT_HF(4, hf_ulmap_aas_sdma_preamble_modifier_index);
}
if (ppmd) {
XBIT_HF(2, hf_ulmap_aas_sdma_pilot_pattern);
XBIT_HF(2, hf_ulmap_reserved_uint);
}
if (encm == 0) {
XBIT_HF(4, hf_ulmap_aas_sdma_diuc);
XBIT_HF(2, hf_ulmap_aas_sdma_repetition_coding_indication);
XBIT_HF(2, hf_ulmap_reserved_uint);
}
if (encm == 1) {
XBIT_HF(4, hf_ulmap_aas_sdma_diuc);
XBIT_HF(2, hf_ulmap_aas_sdma_repetition_coding_indication);
XBIT_HF(4, hf_ulmap_aas_sdma_acid);
XBIT_HF(1, hf_ulmap_aas_sdma_ai_sn);
XBIT_HF(1, hf_ulmap_reserved_uint);
}
if (encm == 2) {
XBIT_HF(4, hf_ulmap_aas_sdma_nep);
XBIT_HF(4, hf_ulmap_aas_sdma_nsch);
XBIT_HF(2, hf_ulmap_aas_sdma_spid);
XBIT_HF(4, hf_ulmap_aas_sdma_acid);
XBIT_HF(1, hf_ulmap_aas_sdma_ai_sn);
XBIT_HF(1, hf_ulmap_reserved_uint);
}
if (encm == 3) {
XBIT_HF(4, hf_ulmap_aas_sdma_diuc);
XBIT_HF(2, hf_ulmap_aas_sdma_repetition_coding_indication);
XBIT_HF(2, hf_ulmap_aas_sdma_spid);
XBIT_HF(4, hf_ulmap_aas_sdma_acid);
XBIT_HF(1, hf_ulmap_aas_sdma_ai_sn);
XBIT_HF(3, hf_ulmap_reserved_uint);
}
if (padj) {
XBIT_HF(8, hf_ulmap_aas_sdma_power_adjustment);
}
}
}
pad = BIT_PADDING(bit,8);
if (pad) {
proto_tree_add_bytes_format_value(tree, hf_ulmap_padding, tvb, BITHI(bit, pad), NULL, "%d bits", pad);
bit += pad;
}
return BIT_TO_NIB(bit);
}
static gint Feedback_Polling_IE(proto_tree *uiuc_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* UL-MAP Extended-2 IE = 0xF */
/* 8.4.5.4.28 [2] Feedback_Polling_IE */
/* offset of TLV in nibbles, length of TLV in nibbles */
gint bit;
proto_item *tree;
gint nalloc, dula, pad, adur;
gint i;
bit = NIB_TO_BIT(offset);
tree = proto_tree_add_subtree(uiuc_tree, tvb, NIBHI(offset, length), ett_302v, NULL, "Feedback_Polling_IE");
XBIT_HF(4, hf_ulmap_feedback_polling_extended_2_uiuc);
XBIT_HF(8, hf_ulmap_feedback_polling_length);
XBIT_HF_VALUE(nalloc, 4, hf_ulmap_feedback_polling_num_allocation);
XBIT_HF_VALUE(dula, 1, hf_ulmap_feedback_polling_dedicated_ul_allocation_included);
XBIT_HF(3, hf_ulmap_reserved_uint);
for (i = 0; i < nalloc; i++) {
XBIT_HF(16, hf_ulmap_feedback_polling_basic_cid);
XBIT_HF_VALUE(adur, 3, hf_ulmap_feedback_polling_allocation_duration);
if (adur != 0) {
XBIT_HF(4, hf_ulmap_feedback_polling_type);
XBIT_HF(3, hf_ulmap_feedback_polling_frame_offset);
XBIT_HF(2, hf_ulmap_feedback_polling_period);
if (dula == 1) {
XBIT_HF(4, hf_ulmap_feedback_polling_uiuc);
XBIT_HF(8, hf_ulmap_feedback_polling_ofdma_symbol_offset);
XBIT_HF(7, hf_ulmap_feedback_polling_subchannel_offset);
XBIT_HF(3, hf_ulmap_feedback_polling_duration);
XBIT_HF(2, hf_ulmap_feedback_polling_repetition_coding_indication);
}
}
}
pad = BIT_PADDING(bit,8);
if (pad) {
proto_tree_add_bytes_format_value(tree, hf_ulmap_padding, tvb, BITHI(bit, pad), NULL, "%d bits", pad);
bit += pad;
}
return BIT_TO_NIB(bit);
}
/********************************************************************
* UL-MAP Miscellany
*******************************************************************/
gint dissect_ulmap_ie( proto_tree *ie_tree, packet_info* pinfo, gint offset, gint length _U_, tvbuff_t *tvb)
{
/* decode a single UL-MAP IE and return the
* length of the IE in nibbles
* offset = start of IE (nibbles)
* length = total length of tvb (nibbles) */
proto_item *ti;
proto_tree *tree;
gint nibble;
gint uiuc, ext_uiuc, ext2_uiuc, len, aas_or_amc;
guint cid;
guint data;
guint32 data32;
nibble = offset;
/* 8.4.5.4 UL-MAP IE format - table 287 */
cid = TVB_NIB_WORD(nibble, tvb);
uiuc = TVB_NIB_NIBBLE(nibble + 4, tvb);
if (uiuc == 0)
{
/* 8.4.5.4.9 FAST-FEEDBACK channel */
tree = proto_tree_add_subtree(ie_tree, tvb, NIBHI(nibble, 5+8), ett_ulmap_ffb, NULL, "FAST FEEDBACK Allocation IE");
proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
nibble += 4;
proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
nibble += 1;
data = TVB_NIB_LONG(nibble, tvb);
proto_tree_add_uint(tree, hf_ulmap_uiuc0_symofs, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc0_subofs, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc0_numsym, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc0_numsub, tvb, NIBHI(nibble, 8), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc0_rsv, tvb, NIBHI(nibble, 8), data);
nibble += 8;
}
else if (uiuc == 11)
{
/* 8.4.5.4.4.2 [2] extended-2 UIUC IE table 290b */
ext2_uiuc = TVB_NIB_NIBBLE(5+nibble, tvb);
len = TVB_NIB_BYTE(5+nibble+1, tvb);
tree = proto_tree_add_subtree_format(ie_tree, tvb, NIBHI(nibble, 5+3+len*2), ett_290b, NULL, "UIUC: %d (Extended-2 IE)", uiuc);
proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
nibble += 4;
proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
nibble += 1;
#if 0
proto_tree_add_uint(tree, hf_ulmap_uiuc11_ext, tvb, NIBHI(nibble, 1), ext2_uiuc);
nibble += 1;
proto_tree_add_uint(tree, hf_ulmap_uiuc11_len, tvb, NIBHI(nibble, 2), len);
nibble += 2;
#endif
len = 3 + BYTE_TO_NIB(len); /* length in nibbles */
/* data table 290c 8.4.5.4.4.2 */
switch (ext2_uiuc) {
case 0x00:
/* 8.4.5.4.16 CQICH_Enhanced_Allocation_IE */
nibble = CQICH_Enhanced_Allocation_IE(tree, nibble, len, tvb);
break;
case 0x01:
/* 8.4.5.4.18 HO_Anchor_Active_UL_MAP_IE */
nibble = HO_Anchor_Active_UL_MAP_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x02:
/* 8.4.5.4.19 HO_Active_Anchor_UL_MAP_IE */
nibble = HO_Active_Anchor_UL_MAP_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x03:
/* 8.4.5.4.23 Anchor_BS_switch_IE */
nibble = Anchor_BS_switch_IE(tree, nibble, len, tvb);
break;
case 0x04:
/* 8.4.5.4.26 UL_sounding_command_IE */
nibble = UL_sounding_command_IE(tree, nibble, len, tvb);
break;
case 0x06:
/* 8.4.5.4.20 MIMO_UL_Enhanced_IE */
nibble = MIMO_UL_Enhanced_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x07:
/* 8.4.5.4.24 HARQ_ULMAP_IE */
nibble = HARQ_ULMAP_IE(tree, nibble, len, tvb);
break;
case 0x08:
/* 8.4.5.4.25 HARQ_ACKCH_Region_Allocation_IE */
nibble = HARQ_ACKCH_Region_Allocation_IE(tree, nibble, len, tvb);
break;
case 0x0e:
/* 8.4.5.4.27 AAS_SDMA_UL_IE */
nibble = AAS_SDMA_UL_IE(tree, nibble, len, tvb);
break;
case 0x0f:
/* 8.4.5.4.28 Feedback_Polling_IE */
nibble = Feedback_Polling_IE(tree, nibble, len, tvb);
break;
default:
proto_tree_add_bytes_format(tree, hf_ulmap_ie_reserved_extended2_duic, tvb, NIBHI(nibble, len), NULL, "(reserved Extended-2 UIUC: %d)", ext2_uiuc);
nibble += len;
break;
}
}
else if (uiuc == 12)
{
/* 8.4.5.4 [2] CDMA bandwidth request, CDMA ranging */
tree = proto_tree_add_subtree(ie_tree, tvb, NIBHI(nibble, 5+8), ett_287_1, NULL, "CDMA Bandwidth/Ranging Request IE");
proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
nibble += 4;
proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
nibble += 1;
data32 = TVB_NIB_LONG(nibble, tvb);
proto_tree_add_uint(tree, hf_ulmap_uiuc12_symofs, tvb, NIBHI(nibble,8), data32);
proto_tree_add_uint(tree, hf_ulmap_uiuc12_subofs, tvb, NIBHI(nibble,8), data32);
proto_tree_add_uint(tree, hf_ulmap_uiuc12_numsym, tvb, NIBHI(nibble,8), data32);
proto_tree_add_uint(tree, hf_ulmap_uiuc12_numsub, tvb, NIBHI(nibble,8), data32);
proto_tree_add_uint(tree, hf_ulmap_uiuc12_method, tvb, NIBHI(nibble,8), data32);
proto_tree_add_uint(tree, hf_ulmap_uiuc12_dri, tvb, NIBHI(nibble,8), data32);
nibble += 8;
}
else if (uiuc == 13)
{
/* 8.4.5.4.2 [2] PAPR reduction allocation, safety zone - table 289 */
tree = proto_tree_add_subtree(ie_tree, tvb, NIBHI(nibble,5+8), ett_289, NULL, "PAPR/Safety/Sounding Zone IE");
proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
nibble += 4;
proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
nibble += 1;
data = TVB_NIB_LONG(nibble, tvb);
proto_tree_add_uint(tree, hf_ulmap_uiuc13_symofs, tvb, NIBHI(nibble,8), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc13_subofs, tvb, NIBHI(nibble,8), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc13_numsym, tvb, NIBHI(nibble,8), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc13_numsub, tvb, NIBHI(nibble,8), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc13_papr, tvb, NIBHI(nibble,8), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc13_zone, tvb, NIBHI(nibble,8), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc13_rsv, tvb, NIBHI(nibble,8), data);
nibble += 8;
}
else if (uiuc == 14)
{
/* 8.4.5.4.3 [2] CDMA allocation IE */
tree = proto_tree_add_subtree(ie_tree, tvb, NIBHI(nibble,5+10), ett_290, &ti, "CDMA allocation IE");
proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
nibble += 4;
proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
nibble += 1;
data = TVB_NIB_WORD(nibble, tvb);
proto_tree_add_uint(tree, hf_ulmap_uiuc14_dur, tvb, NIBHI(nibble,2), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc14_uiuc, tvb, NIBHI(nibble+1,2), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc14_rep, tvb, NIBHI(nibble+2,1), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc14_idx, tvb, NIBHI(nibble+3,1), data);
nibble += 4;
data = TVB_NIB_BYTE(nibble, tvb);
proto_tree_add_uint(tree, hf_ulmap_uiuc14_code, tvb, NIBHI(nibble,2), data);
proto_item_append_text(ti, " (0x%02x)", data);
nibble += 2;
data = TVB_NIB_BYTE(nibble, tvb);
proto_tree_add_uint(tree, hf_ulmap_uiuc14_sym, tvb, NIBHI(nibble,2), data);
proto_item_append_text(ti, " (0x%02x)", data);
nibble += 2;
data = TVB_NIB_BYTE(nibble, tvb);
proto_tree_add_uint(tree, hf_ulmap_uiuc14_sub, tvb, NIBHI(nibble,2), data);
proto_item_append_text(ti, " (0x%02x)", data >> 1);
proto_tree_add_uint(tree, hf_ulmap_uiuc14_bwr, tvb, NIBHI(nibble+1,1), data);
nibble += 2;
}
else if (uiuc == 15)
{
/* 8.4.5.4.4 [1] Extended UIUC dependent IE table 291 */
ext_uiuc = TVB_NIB_NIBBLE(5+nibble, tvb);
len = TVB_NIB_NIBBLE(5+nibble+1, tvb);
tree = proto_tree_add_subtree_format(ie_tree, tvb, NIBHI(nibble, 5+2+len*2), ett_291, NULL, "UIUC: %d (Extended IE)", uiuc);
proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble,4), cid);
nibble += 4;
proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble,1), uiuc);
nibble += 1;
#if 0
ti = proto_tree_add_uint(tree, hf_ulmap_uiuc11_ext, tvb, NIBHI(nibble,1), ext_uiuc);
nibble += 1;
proto_tree_add_uint(tree, hf_ulmap_uiuc11_len, tvb, NIBHI(nibble,1), len);
nibble += 1;
#endif
len = 2 + BYTE_TO_NIB(len); /* length in nibbles */
/* data table 290a 8.4.5.4.4.1 */
switch (ext_uiuc) {
case 0x00:
/* 8.4.5.4.5 Power_Control_IE */
nibble = Power_Control_IE(tree, nibble, len, tvb);
break;
case 0x01:
/* 8.4.5.4.8 Mini-Subchannel_allocation_IE*/
nibble = Mini_Subchannel_allocation_IE(tree, nibble, len, tvb);
break;
case 0x02:
/* 8.4.5.4.6 AAS_UL_IE*/
nibble = AAS_UL_IE(tree, nibble, len, tvb);
break;
case 0x03:
/* 8.4.5.4.12 CQICH_Alloc_IE */
nibble = CQICH_Alloc_IE(tree, nibble, len, tvb);
break;
case 0x04:
/* 8.4.5.4.7 UL_Zone_IE */
nibble = UL_Zone_IE(tree, nibble, len, tvb);
break;
case 0x05:
/* 8.4.5.4.14 PHYMOD_UL_IE */
nibble = PHYMOD_UL_IE(tree, nibble, len, tvb);
break;
case 0x06:
/* 8.4.5.4.11 MIMO_UL_IE */
nibble = MIMO_UL_IE(tree, pinfo, nibble, len, tvb);
break;
case 0x07:
/* 8.4.5.4.22 ULMAP_Fast_Tracking_IE */
nibble = ULMAP_Fast_Tracking_IE(tree, nibble, len, tvb);
break;
case 0x08:
/* 8.4.5.4.17 UL_PUSC_Burst_Allocation_in_other_segment_IE */
nibble = UL_PUSC_Burst_Allocation_in_other_segment_IE(tree, nibble, len, tvb);
break;
case 0x09:
/* 8.4.5.4.21 Fast_Ranging_IE */
nibble = Fast_Ranging_IE(tree, nibble, len, tvb);
break;
case 0x0a:
/* 8.4.5.4.15 UL_Allocation_Start_IE */
nibble = UL_Allocation_Start_IE(tree, nibble, len, tvb);
break;
default:
proto_tree_add_bytes_format_value(tree, hf_ulmap_ie_reserved_extended_duic, tvb, NIBHI(nibble,len), NULL, "(reserved Extended UIUC: %d)", ext_uiuc);
nibble += len;
break;
}
}
else
{
/* 8.4.5.4 [2] regular IE 1-10, data grant burst type */
aas_or_amc = 0; /* TODO */
len = 3;
if (aas_or_amc) len += 3;
tree = proto_tree_add_subtree(ie_tree, tvb, NIBHI(nibble, 5+len), ett_287_2, NULL, "Data Grant Burst Profile");
proto_tree_add_uint(tree, hf_ulmap_ie_cid, tvb, NIBHI(nibble, 4), cid);
nibble += 4;
proto_tree_add_uint(tree, hf_ulmap_ie_uiuc, tvb, NIBHI(nibble, 1), uiuc);
nibble += 1;
data = TVB_NIB_WORD(nibble, tvb);
proto_tree_add_uint(tree, hf_ulmap_uiuc10_dur, tvb, NIBHI(nibble,3), data);
proto_tree_add_uint(tree, hf_ulmap_uiuc10_rep, tvb, NIBHI(nibble+2,1), data);
nibble += 3;
if (aas_or_amc) {
data = TVB_NIB_BITS12(nibble, tvb);
proto_tree_add_uint(tree, hf_ulmap_uiuc10_slot_offset, tvb, NIBHI(nibble,3), data);
nibble += 3;
}
}
/* length in nibbles */
return (nibble - offset);
}
static int dissect_mac_mgmt_msg_ulmap_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
{
/* 6.3.2.3.4 [2] UL-MAP table 18 */
guint offset = 0;
guint length;
guint nib, pad;
proto_item *ti = NULL;
proto_tree *ulmap_tree = NULL;
proto_tree *ie_tree = NULL;
guint tvb_len;
tvb_len = tvb_reported_length(tvb);
/* display MAC UL-MAP */
ti = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_ulmap_decoder, tvb, offset, -1, "UL-MAP");
ulmap_tree = proto_item_add_subtree(ti, ett_ulmap);
proto_tree_add_item(ulmap_tree, hf_ulmap_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_item(ulmap_tree, hf_ulmap_ucd_count, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_item(ulmap_tree, hf_ulmap_alloc_start_time, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(ulmap_tree, hf_ulmap_ofdma_sym, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* UL-MAP IEs */
length = tvb_len - offset; /* remaining length in bytes */
ie_tree = proto_tree_add_subtree_format(ulmap_tree, tvb, offset, length, ett_ulmap_ie, NULL, "UL-MAP IEs (%u bytes)", length);
/* length = BYTE_TO_NIB(length); */ /* convert length to nibbles */
nib = BYTE_TO_NIB(offset);
while (nib < ((tvb_len*2)-1)) {
nib += dissect_ulmap_ie(ie_tree, pinfo, nib, tvb_len*2, tvb);
}
pad = NIB_PADDING(nib);
if (pad) {
proto_tree_add_bytes_format(ulmap_tree, hf_ulmap_padding, tvb, NIBHI(nib,1), NULL, "Padding nibble");
nib++;
}
return tvb_captured_length(tvb);
}
/*gint wimax_decode_ulmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)*/
gint wimax_decode_ulmapc(proto_tree *base_tree, packet_info* pinfo, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.6.2 [2] Compressed UL-MAP */
/* returns length in nibbles */
gint nib;
guint data;
proto_item *ti = NULL;
proto_tree *tree = NULL;
proto_tree *ie_tree = NULL;
nib = offset;
/* display MAC UL-MAP */
ti = proto_tree_add_protocol_format(base_tree, proto_mac_mgmt_msg_ulmap_decoder, tvb, NIBHI(offset,length-offset), "Compressed UL-MAP (%u bytes)", NIB_ADDR(length-offset));
tree = proto_item_add_subtree(ti, ett_306);
/* Decode and display the UL-MAP */
data = TVB_NIB_BYTE(nib, tvb);
proto_tree_add_uint(tree, hf_ulmap_ucd_count, tvb, NIBHI(nib,2), data);
nib += 2;
data = TVB_NIB_LONG(nib, tvb);
proto_tree_add_uint(tree, hf_ulmap_alloc_start_time, tvb, NIBHI(nib,8), data);
nib += 8;
data = TVB_NIB_BYTE(nib, tvb);
proto_tree_add_uint(tree, hf_ulmap_ofdma_sym, tvb, NIBHI(nib,2), data); /* added 2005 */
nib += 2;
ie_tree = proto_tree_add_subtree_format(tree, tvb, NIBHI(nib,length-nib), ett_306_ul, NULL, "UL-MAP IEs (%u bytes)", NIB_ADDR(length-nib));
while (nib < length-1) {
nib += dissect_ulmap_ie(ie_tree, pinfo, nib, length-nib, tvb);
}
/* padding */
if (nib & 1) {
proto_tree_add_bytes_format(tree, hf_ulmap_padding, tvb, NIBHI(nib,1), NULL, "Padding nibble");
nib++;
}
return length;
}
gint wimax_decode_ulmap_reduced_aas(proto_tree *base_tree, gint offset, gint length, tvbuff_t *tvb)
{
/* 8.4.5.8.2 Reduced AAS private UL-MAP */
/* offset and length are in bits since this is called from within
* the Reduced AAS private DL-MAP
* return length in bits */
gint bit;
guint data;
proto_tree *tree;
gint azci, azpi, umii, phmi, powi;
bit = offset;
tree = proto_tree_add_subtree(base_tree, tvb, BITHI(bit,length), ett_308b, NULL, "Reduced_AAS_Private_UL_MAP");
/* Decode and display the Reduced AAS private UL-MAP */
XBIT_HF_VALUE(azci, 1, hf_ulmap_reduced_aas_aas_zone_configuration_included);
XBIT_HF_VALUE(azpi, 1, hf_ulmap_reduced_aas_aas_zone_position_included);
XBIT_HF_VALUE(umii, 1, hf_ulmap_reduced_aas_ul_map_information_included);
XBIT_HF_VALUE(phmi, 1, hf_ulmap_reduced_aas_phy_modification_included);
XBIT_HF_VALUE(powi, 1, hf_ulmap_reduced_aas_power_control_included);
XBIT_HF(2, hf_ulmap_reduced_aas_include_feedback_header);
XBIT_HF(2, hf_ulmap_reduced_aas_encoding_mode);
if (azci) {
XBIT_HF(2, hf_ulmap_reduced_aas_permutation);
XBIT_HF(7, hf_ulmap_reduced_aas_ul_permbase);
XBIT_HF(2, hf_ulmap_reduced_aas_preamble_indication);
XBIT_HF(5, hf_ulmap_reduced_aas_padding);
}
if (azpi) {
XBIT_HF(8, hf_ulmap_reduced_aas_zone_symbol_offset);
XBIT_HF(8, hf_ulmap_reduced_aas_zone_length);
}
if (umii) {
XBIT_HF(8, hf_ulmap_reduced_aas_ucd_count);
data = TVB_BIT_BITS64(bit,tvb,32);
proto_tree_add_uint64(tree, hf_ulmap_reduced_aas_private_map_alloc_start_time, tvb, BITHI(bit,32), data);
bit += 32;
}
if (phmi) {
XBIT_HF(1, hf_ulmap_reduced_aas_preamble_select);
XBIT_HF(4, hf_ulmap_reduced_aas_preamble_shift_index);
XBIT_HF(1, hf_ulmap_reduced_aas_pilot_pattern_modifier);
data = TVB_BIT_BITS32(bit,tvb,22);
proto_tree_add_uint64(tree, hf_ulmap_reduced_aas_pilot_pattern_index, tvb, BITHI(bit,22), data);
bit += 22;
}
if (powi) {
XBIT_HF(8, hf_ulmap_reduced_aas_power_control);
}
XBIT_HF(3, hf_ulmap_reduced_aas_ul_frame_offset);
XBIT_HF(12, hf_ulmap_reduced_aas_slot_offset);
XBIT_HF(10, hf_ulmap_reduced_aas_slot_duration);
XBIT_HF(4, hf_ulmap_reduced_aas_uiuc_nep);
if (harq) {
XBIT_HF(4, hf_ulmap_reduced_aas_acid);
XBIT_HF(1, hf_ulmap_reduced_aas_ai_sn);
XBIT_HF(3, hf_ulmap_reserved_uint);
if (ir_type) {
XBIT_HF(4, hf_ulmap_reduced_aas_nsch);
XBIT_HF(2, hf_ulmap_reduced_aas_spid);
XBIT_HF(2, hf_ulmap_reserved_uint);
}
}
XBIT_HF(2, hf_ulmap_reduced_aas_repetition_coding_indication);
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[] =
{
#if 0
{
&hf_ulmap_fch_expected,
{
"FCH Expected", "wmx.ulmap.fch.expected",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
#endif
#if 0
{
&hf_ulmap_ie,
{
"UL-MAP IE", "wmx.ulmap.ie",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
#endif
{
&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_ie_diuc_ext,
{
"Extended DIUC", "wmx.ulmap.ie.ext_diuc",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_ulmap_ie_diuc_ext2,
{
"Extended-2 DIUC", "wmx.ulmap.ie.ext2_diuc",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_ulmap_ie_length,
{
"Length", "wmx.ilmap.ie.length",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
}
},
{
&hf_ulmap_ie_reserved_extended2_duic,
{
"Reserved Extended-2 DIUC", "wmx.ulmap.ie.ext2_diuc_reserved",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL
}
},
{
&hf_ulmap_ie_reserved_extended_duic,
{
"Reserved Extended DIUC", "wmx.ulmap.ie.ext_diuc_reserved",
FT_BYTES, BASE_NONE, 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
}
},
#if 0
{
&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
}
},
#endif
{
&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.uiuc10.rep",
FT_UINT16, BASE_DEC, NULL, 0x0030, NULL, HFILL
}
},
{
&hf_ulmap_uiuc10_slot_offset,
{
"Slot offset", "wmx.ulmap.uiuc10.slot_offset",
FT_UINT32, BASE_DEC, NULL, 0x0, 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
}
},
#if 0
{
&hf_ulmap_crc16,
{
"CRC-16", "wmx.ulmap.crc16",
FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL
}
},
{
&hf_ulmap_crc16_status,
{
"CRC-16 Status", "wmx.ulmap.crc16.status",
FT_UINT8, BASE_NONE, VALS(plugin_proto_checksum_vals), 0x0, NULL, HFILL
}
},
#endif
{
&hf_ulmap_padding,
{
"Padding", "wmx.ulmap.padding",
FT_BYTES, BASE_NONE, NULL, 0x0, 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
}
},
#if 0
{
&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
}
},
#endif
/* Generated via "one time" script to help create filterable fields */
{ &hf_ulmap_dedicated_ul_control_length, { "Length", "wmx.ulmap.dedicated_ul_control.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_dedicated_ul_control_control_header, { "Control Header", "wmx.ulmap.dedicated_ul_control.control_header", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_dedicated_ul_control_num_sdma_layers, { "Num SDMA layers", "wmx.ulmap.dedicated_ul_control.num_sdma_layers", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_dedicated_ul_control_pilot_pattern, { "Pilot Pattern", "wmx.ulmap.dedicated_ul_control.pilot_pattern", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_dedicated_mimo_ul_control_matrix, { "Matrix", "wmx.ulmap.dedicated_mimo_ul_control.matrix", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_dedicated_mimo_ul_control_n_layer, { "N_layer", "wmx.ulmap.dedicated_mimo_ul_control.n_layer", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_chase_dedicated_ul_control_indicator, { "Dedicated UL Control Indicator", "wmx.ulmap.harq_chase.dedicated_ul_control_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_chase_uiuc, { "UIUC", "wmx.ulmap.harq_chase.uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_chase_repetition_coding_indication, { "Repetition Coding Indication", "wmx.ulmap.harq_chase.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_chase_duration, { "Duration", "wmx.ulmap.harq_chase.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_chase_acid, { "ACID", "wmx.ulmap.harq_chase.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_chase_ai_sn, { "AI_SN", "wmx.ulmap.harq_chase.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_chase_ack_disable, { "ACK_disable", "wmx.ulmap.harq_chase.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reserved_uint, { "Reserved", "wmx.ulmap.reserved.uint", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_ctc_dedicated_ul_control_indicator, { "Dedicated UL Control Indicator", "wmx.ulmap.harq_ir_ctc.dedicated_ul_control_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_ctc_nep, { "N(EP)", "wmx.ulmap.harq_ir_ctc.nep", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_ctc_nsch, { "N(SCH)", "wmx.ulmap.harq_ir_ctc.nsch", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_ctc_spid, { "SPID", "wmx.ulmap.harq_ir_ctc.spid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_ctc_acin, { "ACIN", "wmx.ulmap.harq_ir_ctc.acin", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_ctc_ai_sn, { "AI_SN", "wmx.ulmap.harq_ir_ctc.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_ctc_ack_disable, { "ACK_disable", "wmx.ulmap.harq_ir_ctc.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_cc_dedicated_ul_control_indicator, { "Dedicated UL Control Indicator", "wmx.ulmap.harq_ir_cc.dedicated_ul_control_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_cc_uiuc, { "UIUC", "wmx.ulmap.harq_ir_cc.uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_cc_repetition_coding_indication, { "Repetition Coding Indication", "wmx.ulmap.harq_ir_cc.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_cc_duration, { "Duration", "wmx.ulmap.harq_ir_cc.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_cc_spid, { "SPID", "wmx.ulmap.harq_ir_cc.spid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_cc_acid, { "ACID", "wmx.ulmap.harq_ir_cc.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_cc_ai_sn, { "AI_SN", "wmx.ulmap.harq_ir_cc.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ir_cc_ack_disable, { "ACK_disable", "wmx.ulmap.harq_ir_cc.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_chase_harq_mu_indicator, { "MU indicator", "wmx.ulmap.mimo_ul_chase_harq.mu_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_chase_harq_dedicated_mimo_ulcontrol_indicator, { "Dedicated MIMO ULControl Indicator", "wmx.ulmap.mimo_ul_chase_harq.dedicated_mimo_ulcontrol_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_chase_harq_ack_disable, { "ACK Disable", "wmx.ulmap.mimo_ul_chase_harq.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_chase_harq_matrix, { "Matrix", "wmx.ulmap.mimo_ul_chase_harq.matrix", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_chase_harq_duration, { "Duration", "wmx.ulmap.mimo_ul_chase_harq.duration", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_chase_harq_uiuc, { "UIUC", "wmx.ulmap.mimo_ul_chase_harq.uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_chase_harq_repetition_coding_indication, { "Repetition Coding Indication", "wmx.ulmap.mimo_ul_chase_harq.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_chase_harq_acid, { "ACID", "wmx.ulmap.mimo_ul_chase_harq.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_chase_harq_ai_sn, { "AI_SN", "wmx.ulmap.mimo_ul_chase_harq.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_mu_indicator, { "MU indicator", "wmx.ulmap.mimo_ul_ir_harq.mu_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_dedicated_mimo_ul_control_indicator, { "Dedicated MIMO UL Control Indicator", "wmx.ulmap.mimo_ul_ir_harq.dedicated_mimo_ul_control_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_ack_disable, { "ACK Disable", "wmx.ulmap.mimo_ul_ir_harq.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_matrix, { "Matrix", "wmx.ulmap.mimo_ul_ir_harq.matrix", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_nsch, { "N(SCH)", "wmx.ulmap.mimo_ul_ir_harq.nsch", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_nep, { "N(EP)", "wmx.ulmap.mimo_ul_ir_harq.nep", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_spid, { "SPID", "wmx.ulmap.mimo_ul_ir_harq.spid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_acid, { "ACID", "wmx.ulmap.mimo_ul_ir_harq.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_ai_sn, { "AI_SN", "wmx.ulmap.mimo_ul_ir_harq.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_cc_mu_indicator, { "MU indicator", "wmx.ulmap.mimo_ul_ir_harq_cc.mu_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_cc_dedicated_mimo_ul_control_indicator, { "Dedicated MIMO UL Control Indicator", "wmx.ulmap.mimo_ul_ir_harq_cc.dedicated_mimo_ul_control_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_cc_ack_disable, { "ACK Disable", "wmx.ulmap.mimo_ul_ir_harq_cc.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_cc_matrix, { "Matrix", "wmx.ulmap.mimo_ul_ir_harq_cc.matrix", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_cc_duration, { "Duration", "wmx.ulmap.mimo_ul_ir_harq_cc.duration", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_cc_uiuc, { "UIUC", "wmx.ulmap.mimo_ul_ir_harq_cc.uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_cc_repetition_coding_indication, { "Repetition Coding Indication", "wmx.ulmap.mimo_ul_ir_harq_cc.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_cc_acid, { "ACID", "wmx.ulmap.mimo_ul_ir_harq_cc.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_cc_ai_sn, { "AI_SN", "wmx.ulmap.mimo_ul_ir_harq_cc.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_ir_harq_cc_spid, { "SPID", "wmx.ulmap.mimo_ul_ir_harq_cc.spid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_stc_harq_tx_count, { "Tx count", "wmx.ulmap.mimo_ul_stc_harq.tx_count", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_stc_harq_duration, { "Duration", "wmx.ulmap.mimo_ul_stc_harq.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_stc_harq_sub_burst_offset_indication, { "Sub-burst offset indication", "wmx.ulmap.mimo_ul_stc_harq.sub_burst_offset_indication", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_stc_harq_sub_burst_offset, { "Sub-burst offset", "wmx.ulmap.mimo_ul_stc_harq.sub_burst_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_stc_harq_ack_disable, { "ACK Disable", "wmx.ulmap.mimo_ul_stc_harq.ack_disable", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_stc_harq_uiuc, { "UIUC", "wmx.ulmap.mimo_ul_stc_harq.uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_stc_harq_repetition_coding_indication, { "Repetition Coding Indication", "wmx.ulmap.mimo_ul_stc_harq.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mimo_ul_stc_harq_acid, { "ACID", "wmx.ulmap.mimo_ul_stc_harq.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_power_control, { "Power Control", "wmx.ulmap.power_control", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_power_measurement_frame, { "Power measurement frame", "wmx.ulmap.power_measurement_frame", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mini_subcha_alloc_extended_2_uiuc, { "Extended-2 UIUC", "wmx.ulmap.mini_subcha_alloc.extended_2_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mini_subcha_alloc_length, { "Length", "wmx.ulmap.mini_subcha_alloc.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mini_subcha_alloc_ctype, { "Ctype", "wmx.ulmap.mini_subcha_alloc.ctype", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mini_subcha_alloc_duration, { "Duration", "wmx.ulmap.mini_subcha_alloc.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mini_subcha_alloc_cid, { "CID", "wmx.ulmap.mini_subcha_alloc.cid", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mini_subcha_alloc_uiuc, { "UIUC", "wmx.ulmap.mini_subcha_alloc.uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mini_subcha_alloc_repetition, { "Repetition", "wmx.ulmap.mini_subcha_alloc.repetition", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_mini_subcha_alloc_padding, { "Padding", "wmx.ulmap.mini_subcha_alloc.padding", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_ul_extended_uiuc, { "Extended UIUC", "wmx.ulmap.aas_ul.extended_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_ul_length, { "Length", "wmx.ulmap.aas_ul.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_ul_permutation, { "Permutation", "wmx.ulmap.aas_ul.permutation", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_ul_ul_permbase, { "UL_PermBase", "wmx.ulmap.aas_ul.ul_permbase", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_ul_ofdma_symbol_offset, { "OFDMA symbol offset", "wmx.ulmap.aas_ul.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_ul_aas_zone_length, { "AAS zone length", "wmx.ulmap.aas_ul.aas_zone_length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_ul_uplink_preamble_config, { "Uplink preamble config", "wmx.ulmap.aas_ul.uplink_preamble_config", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_ul_preamble_type, { "Preamble type", "wmx.ulmap.aas_ul.preamble_type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_extended_uiuc, { "Extended UIUC", "wmx.ulmap.cqich_alloc.extended_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_length, { "Length", "wmx.ulmap.cqich_alloc.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_cqich_id, { "CQICH_ID", "wmx.ulmap.cqich_alloc.cqich_id", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_allocation_offset, { "Allocation offset", "wmx.ulmap.cqich_alloc.allocation_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_period, { "Period (p)", "wmx.ulmap.cqich_alloc.period", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_frame_offset, { "Frame offset", "wmx.ulmap.cqich_alloc.frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_duration, { "Duration (d)", "wmx.ulmap.cqich_alloc.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_report_configuration_included, { "Report configuration included", "wmx.ulmap.cqich_alloc.report_configuration_included", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_feedback_type, { "Feedback Type", "wmx.ulmap.cqich_alloc.feedback_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_report_type, { "Report type", "wmx.ulmap.cqich_alloc.report_type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_cinr_preamble_report_type, { "CINR preamble report type", "wmx.ulmap.cqich_alloc.cinr_preamble_report_type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_zone_permutation, { "Zone permutation", "wmx.ulmap.cqich_alloc.zone_permutation", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_zone_type, { "Zone type", "wmx.ulmap.cqich_alloc.zone_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_zone_prbs_id, { "Zone PRBS_ID", "wmx.ulmap.cqich_alloc.zone_prbs_id", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_major_group_indication, { "Major group indication", "wmx.ulmap.cqich_alloc.major_group_indication", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_pusc_major_group_bitmap, { "PUSC Major group bitmap", "wmx.ulmap.cqich_alloc.pusc_major_group_bitmap", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_cinr_zone_measurement_type, { "CINR zone measurement type", "wmx.ulmap.cqich_alloc.cinr_zone_measurement_type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_averaging_parameter_included, { "Averaging parameter included", "wmx.ulmap.cqich_alloc.averaging_parameter_included", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_averaging_parameter, { "Averaging parameter", "wmx.ulmap.cqich_alloc.averaging_parameter", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_alloc_mimo_permutation_feedback_cycle, { "MIMO_permutation_feedback_cycle", "wmx.ulmap.cqich_alloc.mimo_permutation_feedback_cycle", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_zone_extended_uiuc, { "Extended UIUC", "wmx.ulmap.zone.extended_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_zone_length, { "Length", "wmx.ulmap.zone.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_zone_ofdma_symbol_offset, { "OFDMA symbol offset", "wmx.ulmap.zone.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_zone_permutation, { "Permutation", "wmx.ulmap.zone.permutation", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_zone_ul_permbase, { "UL_PermBase", "wmx.ulmap.zone.ul_permbase", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_zone_amc_type, { "AMC type", "wmx.ulmap.zone.amc_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_zone_use_all_sc_indicator, { "Use All SC indicator", "wmx.ulmap.zone.use_all_sc_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_zone_disable_subchannel_rotation, { "Disable subchannel rotation", "wmx.ulmap.zone.disable_subchannel_rotation", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_phymod_ul_extended_uiuc, { "Extended UIUC", "wmx.ulmap.phymod_ul.extended_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_phymod_ul_length, { "Length", "wmx.ulmap.phymod_ul.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_phymod_ul_preamble_modifier_type, { "Preamble Modifier Type", "wmx.ulmap.phymod_ul.preamble_modifier_type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_phymod_ul_preamble_frequency_shift_index, { "Preamble frequency shift index", "wmx.ulmap.phymod_ul.preamble_frequency_shift_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_phymod_ul_preamble_time_shift_index, { "Preamble Time Shift index", "wmx.ulmap.phymod_ul.preamble_time_shift_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_phymod_ul_pilot_pattern_modifier, { "Pilot Pattern Modifier", "wmx.ulmap.phymod_ul.pilot_pattern_modifier", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_phymod_ul_pilot_pattern_index, { "Pilot Pattern Index", "wmx.ulmap.phymod_ul.pilot_pattern_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_tracking_extended_uiuc, { "Extended UIUC", "wmx.ulmap.fast_tracking.extended_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_tracking_length, { "Length", "wmx.ulmap.fast_tracking.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_tracking_map_index, { "Map Index", "wmx.ulmap.fast_tracking.map_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_tracking_power_correction, { "Power correction", "wmx.ulmap.fast_tracking.power_correction", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_tracking_frequency_correction, { "Frequency correction", "wmx.ulmap.fast_tracking.frequency_correction", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_tracking_time_correction, { "Time correction", "wmx.ulmap.fast_tracking.time_correction", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_pusc_burst_allocation_extended_uiuc, { "Extended UIUC", "wmx.ulmap.pusc_burst_allocation.extended_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_pusc_burst_allocation_length, { "Length", "wmx.ulmap.pusc_burst_allocation.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_pusc_burst_allocation_uiuc, { "UIUC", "wmx.ulmap.pusc_burst_allocation.uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_pusc_burst_allocation_segment, { "Segment", "wmx.ulmap.pusc_burst_allocation.segment", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_pusc_burst_allocation_ul_permbase, { "UL_PermBase", "wmx.ulmap.pusc_burst_allocation.ul_permbase", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_pusc_burst_allocation_ofdma_symbol_offset, { "OFDMA symbol offset", "wmx.ulmap.pusc_burst_allocation.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_pusc_burst_allocation_subchannel_offset, { "Subchannel offset", "wmx.ulmap.pusc_burst_allocation.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_pusc_burst_allocation_duration, { "Duration", "wmx.ulmap.pusc_burst_allocation.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_pusc_burst_allocation_repetition_coding_indication, { "Repetition coding indication", "wmx.ulmap.pusc_burst_allocation.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_ranging_extended_uiuc, { "Extended UIUC", "wmx.ulmap.fast_ranging.extended_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_ranging_length, { "Length", "wmx.ulmap.fast_ranging.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_ranging_ho_id_indicator, { "HO_ID indicator", "wmx.ulmap.fast_ranging.ho_id_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_ranging_ho_id, { "HO_ID", "wmx.ulmap.fast_ranging.ho_id", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_ranging_mac_address, { "MAC address", "wmx.ulmap.fast_ranging.mac_address", FT_ETHER, BASE_NONE, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_ranging_uiuc, { "UIUC", "wmx.ulmap.fast_ranging.uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_ranging_duration, { "Duration", "wmx.ulmap.fast_ranging.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_fast_ranging_repetition_coding_indication, { "Repetition coding indication", "wmx.ulmap.fast_ranging.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_allocation_start_extended_uiuc, { "Extended UIUC", "wmx.ulmap.allocation_start.extended_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_allocation_start_length, { "Length", "wmx.ulmap.allocation_start.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_allocation_start_ofdma_symbol_offset, { "OFDMA symbol offset", "wmx.ulmap.allocation_start.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_allocation_start_subchannel_offset, { "Subchannel offset", "wmx.ulmap.allocation_start.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_extended_2_uiuc, { "Extended-2 UIUC", "wmx.ulmap.cqich_enhanced_alloc.extended_2_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_length, { "Length", "wmx.ulmap.cqich_enhanced_alloc.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_cqich_id, { "CQICH_ID", "wmx.ulmap.cqich_enhanced_alloc.cqich_id", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_period, { "Period (p)", "wmx.ulmap.cqich_enhanced_alloc.period", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_frame_offset, { "Frame offset", "wmx.ulmap.cqich_enhanced_alloc.frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_duration, { "Duration (d)", "wmx.ulmap.cqich_enhanced_alloc.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_cqich_num, { "CQICH_Num", "wmx.ulmap.cqich_enhanced_alloc.cqich_num", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_feedback_type, { "Feedback Type", "wmx.ulmap.cqich_enhanced_alloc.feedback_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_allocation_index, { "Allocation Index", "wmx.ulmap.cqich_enhanced_alloc.allocation_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_cqich_type, { "CQICH Type", "wmx.ulmap.cqich_enhanced_alloc.cqich_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_sttd_indication, { "STTD indication", "wmx.ulmap.cqich_enhanced_alloc.sttd_indication", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_band_amc_precoding_mode, { "Band_AMC_Precoding_Mode", "wmx.ulmap.cqich_enhanced_alloc.band_amc_precoding_mode", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_cqich_enhanced_alloc_nr_precoders_feedback, { "Nr_Precoders_Feedback (=N)", "wmx.ulmap.cqich_enhanced_alloc.nr_precoders_feedback", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_extended_2_uiuc, { "Extended-2 UIUC", "wmx.ulmap.anchor_bs_switch.extended_2_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_length, { "Length", "wmx.ulmap.anchor_bs_switch.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_n_anchor_bs_switch, { "N_Anchor_BS_switch", "wmx.ulmap.anchor_bs_switch.n_anchor_bs_switch", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_reduced_cid, { "Reduced CID", "wmx.ulmap.anchor_bs_switch.reduced_cid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_action_code, { "Action Code", "wmx.ulmap.anchor_bs_switch.action_code", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_action_time, { "Action Time (A)", "wmx.ulmap.anchor_bs_switch.action_time", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_temp_bs_id, { "TEMP_BS_ID", "wmx.ulmap.anchor_bs_switch.temp_bs_id", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_ak_change_indicator, { "AK Change Indicator", "wmx.ulmap.anchor_bs_switch.ak_change_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_cqich_allocation_indicator, { "CQICH Allocation Indicator", "wmx.ulmap.anchor_bs_switch.cqich_allocation_indicator", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_feedback_channel_offset, { "Feedback channel offset", "wmx.ulmap.anchor_bs_switch.feedback_channel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_cqich_id, { "CQICH_ID", "wmx.ulmap.anchor_bs_switch.cqich_id", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_period, { "Period (=p)", "wmx.ulmap.anchor_bs_switch.period", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_frame_offset, { "Frame offset", "wmx.ulmap.anchor_bs_switch.frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_duration, { "Duration (=d)", "wmx.ulmap.anchor_bs_switch.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_anchor_bs_switch_mimo_permutation_feedback_code, { "MIMO_permutation_feedback_code", "wmx.ulmap.anchor_bs_switch.mimo_permutation_feedback_code", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_extended_2_uiuc, { "Extended-2 UIUC", "wmx.ulmap.sounding_command.extended_2_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_length, { "Length", "wmx.ulmap.sounding_command.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_type, { "Sounding_Type", "wmx.ulmap.sounding_command.sounding_command.type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_send_sounding_report_flag, { "Send Sounding Report Flag", "wmx.ulmap.sounding_command.send_sounding_report_flag", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_relevance_flag, { "Sounding Relevance Flag", "wmx.ulmap.sounding_command.relevance_flag", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_relevance, { "Sounding_Relevance", "wmx.ulmap.sounding_command.sounding_relevance", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_include_additional_feedback, { "Include additional feedback", "wmx.ulmap.sounding_command.include_additional_feedback", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_num_sounding_symbols, { "Num_Sounding_Symbols", "wmx.ulmap.sounding_command.num_sounding_symbols", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_separability_type, { "Separability Type", "wmx.ulmap.sounding_command.separability_type", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_max_cyclic_shift_index_p, { "Max Cyclic Shift Index P", "wmx.ulmap.sounding_command.max_cyclic_shift_index_p", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_decimation_value, { "Decimation Value D", "wmx.ulmap.sounding_command.decimation_value", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_decimation_offset_randomization, { "Decimation offset randomization", "wmx.ulmap.sounding_command.decimation_offset_randomization", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_symbol_index, { "Sounding symbol index", "wmx.ulmap.sounding_command.sounding_command.symbol_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_number_of_cids, { "Number of CIDs", "wmx.ulmap.sounding_command.number_of_cids", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_shorted_basic_cid, { "Shorted Basic CID", "wmx.ulmap.sounding_command.shorted_basic_cid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_power_assignment_method, { "Power Assignment Method", "wmx.ulmap.sounding_command.power_assignment_method", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_power_boost, { "Power boost", "wmx.ulmap.sounding_command.power_boost", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_multi_antenna_flag, { "Multi-Antenna Flag", "wmx.ulmap.sounding_command.multi_antenna_flag", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_allocation_mode, { "Allocation Mode", "wmx.ulmap.sounding_command.allocation_mode", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_band_bit_map, { "Band bit map", "wmx.ulmap.sounding_command.band_bit_map", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_starting_frequency_band, { "Starting frequency band", "wmx.ulmap.sounding_command.starting_frequency_band", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_number_of_frequency_bands, { "Number of frequency bands", "wmx.ulmap.sounding_command.number_of_frequency_bands", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_cyclic_time_shift_index, { "Cyclic time shift index m", "wmx.ulmap.sounding_command.cyclic_time_shift_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_decimation_offset, { "Decimation offset d", "wmx.ulmap.sounding_command.decimation_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_use_same_symbol_for_additional_feedback, { "Use same symbol for additional feedback", "wmx.ulmap.sounding_command.use_same_symbol_for_additional_feedback", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_periodicity, { "Periodicity", "wmx.ulmap.sounding_command.periodicity", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_permutation, { "Permutation", "wmx.ulmap.sounding_command.permutation", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_dl_permbase, { "DL_PermBase", "wmx.ulmap.sounding_command.dl_permbase", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_shortened_basic_cid, { "Shortened basic CID", "wmx.ulmap.sounding_command.shortened_basic_cid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_subchannel_offset, { "Subchannel offset", "wmx.ulmap.sounding_command.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_sounding_command_number_of_subchannels, { "Number of subchannels", "wmx.ulmap.sounding_command.number_of_subchannels", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ulmap_extended_2_uiuc, { "Extended-2 UIUC", "wmx.ulmap.harq_ulmap.extended_2_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ulmap_length, { "Length", "wmx.ulmap.harq_ulmap.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ulmap_rcid_type, { "RCID_Type", "wmx.ulmap.harq_ulmap.rcid_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ulmap_mode, { "Mode", "wmx.ulmap.harq_ulmap.mode", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ulmap_allocation_start_indication, { "Allocation Start Indication", "wmx.ulmap.harq_ulmap.allocation_start_indication", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ulmap_ofdma_symbol_offset, { "OFDMA Symbol offset", "wmx.ulmap.harq_ulmap.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ulmap_subchannel_offset, { "Subchannel offset", "wmx.ulmap.harq_ulmap.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ulmap_n_sub_burst, { "N sub Burst", "wmx.ulmap.harq_ulmap.n_sub_burst", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ackch_region_alloc_extended_2_uiuc, { "Extended-2 UIUC", "wmx.ulmap.harq_ackch_region_alloc.extended_2_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ackch_region_alloc_length, { "Length", "wmx.ulmap.harq_ackch_region_alloc.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ackch_region_alloc_ofdma_symbol_offset, { "OFDMA Symbol Offset", "wmx.ulmap.harq_ackch_region_alloc.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ackch_region_alloc_subchannel_offset, { "Subchannel Offset", "wmx.ulmap.harq_ackch_region_alloc.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ackch_region_alloc_num_ofdma_symbols, { "No. OFDMA Symbols", "wmx.ulmap.harq_ackch_region_alloc.num_ofdma_symbols", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_harq_ackch_region_alloc_num_subchannels, { "No. Subchannels", "wmx.ulmap.harq_ackch_region_alloc.num_subchannels", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_extended_2_uiuc, { "Extended-2 UIUC", "wmx.ulmap.aas_sdma.extended_2_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_length, { "Length", "wmx.ulmap.aas_sdma.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_rcid_type, { "RCID_Type", "wmx.ulmap.aas_sdma.rcid_type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_num_burst_region, { "Num Burst Region", "wmx.ulmap.aas_sdma.num_burst_region", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_slot_offset, { "Slot offset", "wmx.ulmap.aas_sdma.slot_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_slot_duration, { "Slot duration", "wmx.ulmap.aas_sdma.slot_duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_number_of_users, { "Number of users", "wmx.ulmap.aas_sdma.number_of_users", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_encoding_mode, { "Encoding Mode", "wmx.ulmap.aas_sdma.encoding_mode", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_power_adjust, { "Power Adjust", "wmx.ulmap.aas_sdma.power_adjust", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_pilot_pattern_modifier, { "Pilot Pattern Modifier", "wmx.ulmap.aas_sdma.pilot_pattern_modifier", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_preamble_modifier_index, { "Preamble Modifier Index", "wmx.ulmap.aas_sdma.preamble_modifier_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_pilot_pattern, { "Pilot Pattern", "wmx.ulmap.aas_sdma.pilot_pattern", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_diuc, { "DIUC", "wmx.ulmap.aas_sdma.diuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_repetition_coding_indication, { "Repetition Coding Indication", "wmx.ulmap.aas_sdma.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_acid, { "ACID", "wmx.ulmap.aas_sdma.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_ai_sn, { "AI_SN", "wmx.ulmap.aas_sdma.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_nep, { "N(EP)", "wmx.ulmap.aas_sdma.nep", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_nsch, { "N(SCH)", "wmx.ulmap.aas_sdma.nsch", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_spid, { "SPID", "wmx.ulmap.aas_sdma.spid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_aas_sdma_power_adjustment, { "Power Adjustment", "wmx.ulmap.aas_sdma.power_adjustment", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_extended_2_uiuc, { "Extended-2 UIUC", "wmx.ulmap.feedback_polling.extended_2_uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_length, { "Length", "wmx.ulmap.feedback_polling.length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_num_allocation, { "Num_Allocation", "wmx.ulmap.feedback_polling.num_allocation", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_dedicated_ul_allocation_included, { "Dedicated UL Allocation included", "wmx.ulmap.feedback_polling.dedicated_ul_allocation_included", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_basic_cid, { "Basic CID", "wmx.ulmap.feedback_polling.basic_cid", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_allocation_duration, { "Allocation Duration (d)", "wmx.ulmap.feedback_polling.allocation_duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_type, { "Feedback type", "wmx.ulmap.feedback_polling.feedback_polling.type", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_frame_offset, { "Frame Offset", "wmx.ulmap.feedback_polling.frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_period, { "Period (p)", "wmx.ulmap.feedback_polling.perio", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_uiuc, { "UIUC", "wmx.ulmap.feedback_polling.uiuc", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_ofdma_symbol_offset, { "OFDMA Symbol Offset", "wmx.ulmap.feedback_polling.ofdma_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_subchannel_offset, { "Subchannel offset", "wmx.ulmap.feedback_polling.subchannel_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_duration, { "Duration", "wmx.ulmap.feedback_polling.duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_feedback_polling_repetition_coding_indication, { "Repetition coding indication", "wmx.ulmap.feedback_polling.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_aas_zone_configuration_included, { "AAS zone configuration included", "wmx.ulmap.reduced_aas.aas_zone_configuration_included", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_aas_zone_position_included, { "AAS zone position included", "wmx.ulmap.reduced_aas.aas_zone_position_included", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_ul_map_information_included, { "UL-MAP information included", "wmx.ulmap.reduced_aas.ul_map_information_included", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_phy_modification_included, { "PHY modification included", "wmx.ulmap.reduced_aas.phy_modification_included", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_power_control_included, { "Power Control included", "wmx.ulmap.reduced_aas.power_control_included", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_include_feedback_header, { "Include Feedback Header", "wmx.ulmap.reduced_aas.include_feedback_header", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_encoding_mode, { "Encoding Mode", "wmx.ulmap.reduced_aas.encoding_mode", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_permutation, { "Permutation", "wmx.ulmap.reduced_aas.permutation", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_ul_permbase, { "UL_PermBase", "wmx.ulmap.reduced_aas.ul_permbase", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_preamble_indication, { "Preamble Indication", "wmx.ulmap.reduced_aas.preamble_indication", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_padding, { "Padding", "wmx.ulmap.reduced_aas.padding", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_zone_symbol_offset, { "Zone Symbol Offset", "wmx.ulmap.reduced_aas.zone_symbol_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_zone_length, { "Zone Length", "wmx.ulmap.reduced_aas.zone_length", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_ucd_count, { "UCD Count", "wmx.ulmap.reduced_aas.ucd_count", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_private_map_alloc_start_time, { "Private Map Allocation Start Time", "wmx.ulmap.reduced_aas.private_map_alloc_start_time", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_pilot_pattern_index, { "Pilot Pattern Index", "wmx.ulmap.reduced_aas.pilot_pattern_index", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_preamble_select, { "Preamble Select", "wmx.ulmap.reduced_aas.preamble_select", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_preamble_shift_index, { "Preamble Shift Index", "wmx.ulmap.reduced_aas.preamble_shift_index", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_pilot_pattern_modifier, { "Pilot Pattern Modifier", "wmx.ulmap.reduced_aas.pilot_pattern_modifier", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_power_control, { "Power Control", "wmx.ulmap.reduced_aas.power_control", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_ul_frame_offset, { "UL Frame Offset", "wmx.ulmap.reduced_aas.ul_frame_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_slot_offset, { "Slot Offset", "wmx.ulmap.reduced_aas.slot_offset", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_slot_duration, { "Slot Duration", "wmx.ulmap.reduced_aas.slot_duration", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_uiuc_nep, { "UIUC / N(EP)", "wmx.ulmap.reduced_aas.uiuc_nep", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_acid, { "ACID", "wmx.ulmap.reduced_aas.acid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_ai_sn, { "AI_SN", "wmx.ulmap.reduced_aas.ai_sn", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_nsch, { "N(SCH)", "wmx.ulmap.reduced_aas.nsch", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_spid, { "SPID", "wmx.ulmap.reduced_aas.spid", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }},
{ &hf_ulmap_reduced_aas_repetition_coding_indication, { "Repetition Coding Indication", "wmx.ulmap.reduced_aas.repetition_coding_indication", FT_UINT16, BASE_DEC, NULL, 0x00, 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,
};
static ei_register_info ei[] = {
{ &ei_ulmap_not_implemented, { "wmx.ulmap.not_implemented", PI_UNDECODED, PI_WARN, "Not implemented", EXPFILL }},
};
expert_module_t* expert_mac_mgmt_msg_ulmap;
proto_mac_mgmt_msg_ulmap_decoder = proto_register_protocol (
"WiMax ULMAP Messages", /* name */
"WiMax ULMAP", /* short name */
"wmx.ulmap" /* abbrev */
);
proto_register_field_array(proto_mac_mgmt_msg_ulmap_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_mac_mgmt_msg_ulmap = expert_register_protocol(proto_mac_mgmt_msg_ulmap_decoder);
expert_register_field_array(expert_mac_mgmt_msg_ulmap, ei, array_length(ei));
ulmap_handle = register_dissector("mac_mgmt_msg_ulmap_handler", dissect_mac_mgmt_msg_ulmap_decoder, proto_mac_mgmt_msg_ulmap_decoder);
}
void proto_reg_handoff_mac_mgmt_msg_ulmap(void)
{
dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_UL_MAP, ulmap_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/packet-m2m.c | /* packet-m2m.c
* Routines for WiMax MAC to MAC TLV packet disassembly
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include <epan/reassemble.h>
#include <epan/etypes.h>
#include <epan/expert.h>
#include "wimax_tlv.h"
/* forward reference */
void proto_reg_handoff_m2m(void);
void proto_register_m2m(void);
static void fch_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo);
static void cdma_code_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo);
static void pdu_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo, gint burst_number, gint frag_type, gint frag_number);
static void fast_feedback_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo);
static void harq_ack_bursts_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo);
static void physical_attributes_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo);
static void extended_tlv_decoder(packet_info *pinfo);
void proto_tree_add_tlv(tlv_info_t *self, tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree, gint hf, guint encoding);
/* Global variables */
static dissector_handle_t m2m_handle;
static dissector_handle_t wimax_cdma_code_burst_handle;
static dissector_handle_t wimax_ffb_burst_handle;
static dissector_handle_t wimax_fch_burst_handle;
static dissector_handle_t wimax_hack_burst_handle;
static dissector_handle_t wimax_pdu_burst_handle;
static dissector_handle_t wimax_phy_attributes_burst_handle;
static reassembly_table pdu_reassembly_table;
static gint proto_m2m = -1;
static gint ett_m2m = -1;
static gint ett_m2m_tlv = -1;
static gint ett_m2m_fch = -1;
static gint ett_m2m_cdma = -1;
static gint ett_m2m_ffb = -1;
/* TLV types (rev:0.2) */
#define TLV_PROTO_VER 1
#define TLV_FRAME_NUM 2
#define TLV_BURST_NUM 3
#define TLV_FRAG_TYPE 4
#define TLV_FRAG_NUM 5
#define TLV_CDMA_CODE 7
#define TLV_FCH_BURST 8
#define TLV_PDU_BURST 9
#define TLV_FAST_FB 10
#define TLV_CRC16_STATUS 11
#define TLV_BURST_POWER 12
#define TLV_BURST_CINR 13
#define TLV_PREAMBLE 14
#define TLV_HARQ_ACK_BURST 15
#define TLV_PHY_ATTRIBUTES 16
#define TLV_EXTENDED_TLV 255
/* TLV names */
static const value_string tlv_name[] =
{
{ TLV_PROTO_VER, "Protocol Version" },
{ TLV_FRAME_NUM, "Frame Number" },
{ TLV_BURST_NUM, "Burst Number" },
{ TLV_FRAG_TYPE, "Fragment Type" },
{ TLV_FRAG_NUM, "Fragment Number" },
{ TLV_CDMA_CODE, "CDMA Attribute" },
{ TLV_FCH_BURST, "FCH Burst" },
{ TLV_PDU_BURST, "PDU Burst" },
{ TLV_FAST_FB, "Fast Feedback Burst" },
{ TLV_CRC16_STATUS, "CRC16 Status" },
{ TLV_BURST_POWER, " Burst Power" },
{ TLV_BURST_CINR, "Burst CINR" },
{ TLV_PREAMBLE, "Preamble" },
{ TLV_HARQ_ACK_BURST, "HARQ ACK Bursts" },
{ TLV_PHY_ATTRIBUTES, "PDU Burst Physical Attributes" },
{ TLV_EXTENDED_TLV, "Extended TLV" },
{ 0, NULL }
};
/* TLV Fragment types */
#define TLV_NO_FRAG 0
#define TLV_FIRST_FRAG 1
#define TLV_MIDDLE_FRAG 2
#define TLV_LAST_FRAG 3
/* TLV Fragment Type names */
static const value_string tlv_frag_type_name[] =
{
{ TLV_NO_FRAG, "No TLV Fragment" },
{ TLV_FIRST_FRAG, "First TLV Fragment" },
{ TLV_MIDDLE_FRAG, "Middle TLV Fragment" },
{ TLV_LAST_FRAG, "Last TLV Fragment" },
{ 0, NULL }
};
/* TLV CRC16 Status */
static const value_string tlv_crc16_status[] =
{
{ 0, "No CRC-16 in burst" },
{ 1, "Good CRC-16 in burst" },
{ 2, "Bad CRC-16 in burst" },
{ 0, NULL }
};
static gint hf_m2m_sequence_number = -1;
static gint hf_m2m_frame_number = -1;
static gint hf_m2m_tlv_count = -1;
static gint hf_m2m_type = -1;
static gint hf_m2m_len = -1;
static gint hf_m2m_len_size = -1;
/* static gint hf_m2m_value_bytes = -1; */
static gint hf_wimax_invalid_tlv = -1;
static gint hf_m2m_value_protocol_vers_uint8 = -1;
static gint hf_m2m_value_burst_num_uint8 = -1;
static gint hf_m2m_value_frag_type_uint8 = -1;
static gint hf_m2m_value_frag_num_uint8 = -1;
static gint hf_m2m_value_pdu_burst = -1;
static gint hf_m2m_value_fast_fb = -1;
static gint hf_m2m_value_fch_burst_uint24 = -1;
static gint hf_m2m_value_cdma_code_uint24 = -1;
static gint hf_m2m_value_crc16_status_uint8 = -1;
static gint hf_m2m_value_burst_power_uint16 = -1;
static gint hf_m2m_value_burst_cinr_uint16 = -1;
static gint hf_m2m_value_preamble_uint16 = -1;
static gint hf_m2m_value_harq_ack_burst_bytes = -1;
static gint hf_m2m_phy_attributes = -1;
static expert_field ei_m2m_unexpected_length = EI_INIT;
/* WiMax MAC to MAC protocol dissector */
static int dissect_m2m(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *ti = NULL;
proto_item *m2m_item = NULL;
proto_tree *m2m_tree = NULL;
proto_tree *tlv_tree = NULL;
gint burst_number = 0;
gint length, offset = 0;
gint tlv_count;
gint tlv_type, tlv_len, tlv_offset, tlv_value;
gint tlv_frag_type = 0;
gint tlv_frag_number = 0;
tlv_info_t m2m_tlv_info;
gint hf;
guint encoding;
guint frame_number;
int expected_len;
/* display the M2M protocol name */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "WiMax");
/* Clear out stuff in the info column */
col_clear(pinfo->cinfo, COL_INFO);
{ /* we are being asked for details */
m2m_item = proto_tree_add_item(tree, proto_m2m, tvb, 0, -1, ENC_NA);
m2m_tree = proto_item_add_subtree(m2m_item, ett_m2m);
/* get the tvb reported length */
length = tvb_reported_length(tvb);
/* add the size info */
/*
proto_item_append_text(m2m_item, " (%u bytes) - Packet Sequence Number,Number of TLVs", length);
*/
proto_item_append_text(m2m_item, " (%u bytes)", length);
/* display the sequence number */
proto_tree_add_item(m2m_tree, hf_m2m_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* display the TLV count */
proto_tree_add_item(m2m_tree, hf_m2m_tlv_count, tvb, offset, 2, ENC_BIG_ENDIAN);
tlv_count = tvb_get_ntohs(tvb, offset);
offset += 2;
/* parses the TLVs within current packet */
while ( tlv_count > 0)
{ /* init MAC to MAC TLV information */
init_tlv_info(&m2m_tlv_info, tvb, offset);
/* get the TLV type */
tlv_type = get_tlv_type(&m2m_tlv_info);
/* get the TLV length */
tlv_len = get_tlv_length(&m2m_tlv_info);
if(tlv_type == -1 || tlv_len > 64000 || tlv_len < 1)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "M2M TLV error");
/* display the invalid TLV in HEX */
proto_tree_add_item(m2m_tree, hf_wimax_invalid_tlv, tvb, offset, (length - offset), ENC_NA);
break;
}
/* get the TLV value offset */
tlv_offset = get_tlv_value_offset(&m2m_tlv_info);
/* display TLV type */
ti = proto_tree_add_protocol_format(m2m_tree, proto_m2m, tvb, offset, (tlv_len + tlv_offset), "%s",
val_to_str_const(tlv_type, tlv_name, "Unknown TLV"));
/* add TLV subtree */
tlv_tree = proto_item_add_subtree(ti, ett_m2m_tlv);
/* update the offset */
offset += tlv_offset;
/* add the size info */
/* decode TLV content (TLV value) */
expected_len = 0;
hf = 0;
encoding = ENC_NA;
switch (tlv_type)
{
case TLV_PROTO_VER:
/* get the protocol version */
tlv_value = tvb_get_guint8( tvb, offset );
/* add the description */
proto_item_append_text(ti, ": %d", tlv_value);
hf = hf_m2m_value_protocol_vers_uint8;
encoding = ENC_BIG_ENDIAN;
expected_len = 1;
break;
case TLV_BURST_NUM:
/* get the burst number */
burst_number = tvb_get_guint8( tvb, offset );
/* add the description */
proto_item_append_text(ti, ": %d", burst_number);
hf = hf_m2m_value_burst_num_uint8;
encoding = ENC_BIG_ENDIAN;
expected_len = 1;
break;
case TLV_FRAG_TYPE:
/* add the description */
tlv_frag_type = tvb_get_guint8( tvb, offset );
proto_item_append_text(ti, ": %s", val_to_str_const(tlv_frag_type, tlv_frag_type_name, "Unknown"));
hf = hf_m2m_value_frag_type_uint8;
encoding = ENC_BIG_ENDIAN;
expected_len = 1;
break;
case TLV_FRAG_NUM:
/* get the fragment number */
tlv_frag_number = tvb_get_guint8( tvb, offset );
/* add the description */
proto_item_append_text(ti, ": %d", tlv_frag_number);
hf = hf_m2m_value_frag_num_uint8;
encoding = ENC_BIG_ENDIAN;
expected_len = 1;
break;
case TLV_PDU_BURST:
/* display PDU Burst length info */
proto_item_append_text(ti, " (%u bytes)", tlv_len);
/* decode and display the PDU Burst */
pdu_burst_decoder(tree, tvb, offset, tlv_len, pinfo, burst_number, tlv_frag_type, tlv_frag_number);
hf = hf_m2m_value_pdu_burst;
encoding = ENC_NA;
break;
case TLV_FAST_FB:
/* display the Fast Feedback Burst length info */
proto_item_append_text(ti, " (%u bytes)", tlv_len);
/* decode and display the Fast Feedback Burst */
fast_feedback_burst_decoder(tree, tvb, offset, tlv_len, pinfo);
hf = hf_m2m_value_fast_fb;
encoding = ENC_NA;
break;
case TLV_FRAME_NUM:
/* get the frame number */
frame_number = tvb_get_ntoh24( tvb, offset );
/* add the description */
proto_tree_add_item(tlv_tree, hf_m2m_frame_number, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_item_append_text(ti, ": %d", frame_number);
break;
case TLV_FCH_BURST:
/* add the description */
tlv_value = tvb_get_ntoh24( tvb, offset );
proto_item_append_text(ti, ": 0x%X", tlv_value);
/* decode and display the TLV FCH burst */
fch_burst_decoder(tree, tvb, offset, tlv_len, pinfo);
hf = hf_m2m_value_fch_burst_uint24;
encoding = ENC_BIG_ENDIAN;
expected_len = 3;
break;
case TLV_CDMA_CODE:
/* add the description */
tlv_value = tvb_get_ntoh24( tvb, offset );
proto_item_append_text(ti, ": 0x%X", tlv_value);
/* decode and display the CDMA Code */
cdma_code_decoder(tree, tvb, offset, tlv_len, pinfo);
hf = hf_m2m_value_cdma_code_uint24;
encoding = ENC_BIG_ENDIAN;
expected_len = 3;
break;
case TLV_CRC16_STATUS:
/* add the description */
tlv_value = tvb_get_guint8( tvb, offset );
proto_item_append_text(ti, ": %s", val_to_str_const(tlv_value, tlv_crc16_status, "Unknown"));
hf = hf_m2m_value_crc16_status_uint8;
encoding = ENC_BIG_ENDIAN;
expected_len = 1;
break;
case TLV_BURST_POWER:
/* add the description */
tlv_value = tvb_get_ntohs( tvb, offset );
proto_item_append_text(ti, ": %d", tlv_value);
hf = hf_m2m_value_burst_power_uint16;
encoding = ENC_BIG_ENDIAN;
expected_len = 2;
break;
case TLV_BURST_CINR:
/* add the description */
tlv_value = tvb_get_ntohs( tvb, offset );
proto_item_append_text(ti, ": 0x%X", tlv_value);
hf = hf_m2m_value_burst_cinr_uint16;
encoding = ENC_BIG_ENDIAN;
expected_len = 2;
break;
case TLV_PREAMBLE:
/* add the description */
tlv_value = tvb_get_ntohs( tvb, offset );
proto_item_append_text(ti, ": 0x%X", tlv_value);
hf = hf_m2m_value_preamble_uint16;
encoding = ENC_BIG_ENDIAN;
expected_len = 2;
break;
case TLV_HARQ_ACK_BURST:
/* display the Burst length info */
proto_item_append_text(ti, " (%u bytes)", tlv_len);
/* decode and display the HARQ ACK Bursts */
harq_ack_bursts_decoder(tree, tvb, offset, tlv_len, pinfo);
hf = hf_m2m_value_harq_ack_burst_bytes;
encoding = ENC_NA;
break;
case TLV_PHY_ATTRIBUTES:
/* display the Burst length info */
proto_item_append_text(ti, " (%u bytes)", tlv_len);
/* decode and display the PDU Burst Physical Attributes */
physical_attributes_decoder(tree, tvb, offset, tlv_len, pinfo);
hf = hf_m2m_phy_attributes;
encoding = ENC_NA;
break;
case TLV_EXTENDED_TLV:
/* display the Burst length info */
proto_item_append_text(ti, " (%u bytes)", tlv_len);
/* decode and display the Extended TLV */
extended_tlv_decoder(pinfo);
break;
default:
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "Unknown TLV Type");
break;
}
/* expand the TLV detail */
if (hf) {
if (offset - tlv_offset == expected_len) {
proto_tree_add_tlv(&m2m_tlv_info, tvb, offset - tlv_offset, pinfo, tlv_tree, hf, encoding);
} else {
expert_add_info_format(pinfo, NULL, &ei_m2m_unexpected_length, "Expected length %d, got %d.", expected_len, offset - tlv_offset);
}
}
offset += tlv_len;
/* update tlv_count */
tlv_count--;
}
}
return tvb_captured_length(tvb);
}
/* Decode and display the FCH burst */
static void fch_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo)
{
if(wimax_fch_burst_handle)
{ /* call FCH dissector */
call_dissector(wimax_fch_burst_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree);
}
else /* display FCH info */
{ /* update the info column */
col_append_str(pinfo->cinfo, COL_INFO, "FCH Burst: DL Frame Prefix");
}
}
/* Decode and display the CDMA Code Attribute */
static void cdma_code_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo)
{
if(wimax_cdma_code_burst_handle)
{ /* call CDMA dissector */
call_dissector(wimax_cdma_code_burst_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree);
}
else /* display CDMA Code Attribute info */
{ /* update the info column */
col_append_str(pinfo->cinfo, COL_INFO, "CDMA Code Attribute");
}
}
/* Decode and display the PDU Burst */
static void pdu_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo, gint burst_number, gint frag_type, gint frag_number)
{
fragment_head *pdu_frag;
tvbuff_t *pdu_tvb = NULL;
/* update the info column */
switch (frag_type)
{
case TLV_FIRST_FRAG:
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "First TLV Fragment (%d)", frag_number);
break;
case TLV_LAST_FRAG:
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Last TLV Fragment (%d)", frag_number);
break;
case TLV_MIDDLE_FRAG:
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Middle TLV Fragment %d", frag_number);
break;
}
if(frag_type == TLV_NO_FRAG)
{ /* not fragmented PDU */
pdu_tvb = tvb_new_subset_length(tvb, offset, length);
}
else /* fragmented PDU */
{ /* add the fragment */
pdu_frag = fragment_add_seq(&pdu_reassembly_table, tvb, offset, pinfo, burst_number, NULL, frag_number - 1, length, ((frag_type==TLV_LAST_FRAG)?0:1), 0);
if(pdu_frag && frag_type == TLV_LAST_FRAG)
{
/* create the new tvb for defragmented frame */
pdu_tvb = tvb_new_chain(tvb, pdu_frag->tvb_data);
/* add the defragmented data to the data source list */
add_new_data_source(pinfo, pdu_tvb, "Reassembled WiMax PDU Frame");
}
else
{
pdu_tvb = NULL;
if(frag_type == TLV_LAST_FRAG)
{ /* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "Incomplete PDU frame");
}
}
}
/* process the defragmented PDU burst */
if(pdu_tvb)
{
if(wimax_pdu_burst_handle)
{/* decode and display PDU Burst */
call_dissector(wimax_pdu_burst_handle, pdu_tvb, pinfo, tree);
}
else /* display PDU Burst info */
{ /* update the info column */
col_append_str(pinfo->cinfo, COL_INFO, "PDU Burst");
}
}
}
/* Decode and display the Fast Feedback Burst */
static void fast_feedback_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo)
{
if(wimax_ffb_burst_handle)
{ /* display the TLV Fast Feedback Burst dissector info */
call_dissector(wimax_ffb_burst_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree);
}
else /* display the Fast Feedback Burst info */
{ /* update the info column */
col_append_str(pinfo->cinfo, COL_INFO, "Fast Feedback Burst");
}
}
static void harq_ack_bursts_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo)
{
if(wimax_hack_burst_handle)
{ /* call the TLV HARQ ACK Bursts dissector */
call_dissector(wimax_hack_burst_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree);
}
else /* display the TLV HARQ ACK Bursts info */
{ /* update the info column */
col_append_str(pinfo->cinfo, COL_INFO, "HARQ ACK Bursts");
}
}
static void physical_attributes_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo)
{
if(wimax_phy_attributes_burst_handle)
{ /* call the TLV PDU Burst Physical Attributes dissector */
call_dissector(wimax_phy_attributes_burst_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree);
}
else /* display the TLV PDU Burst Physical Attributes info */
{ /* update the info column */
col_append_str(pinfo->cinfo, COL_INFO, "PHY-attr");
}
}
static void extended_tlv_decoder(packet_info *pinfo)
{
/* display the Extended TLV info */
/* update the info column */
col_append_str(pinfo->cinfo, COL_INFO, "Extended TLV");
}
/* Display the raw WiMax TLV */
void proto_tree_add_tlv(tlv_info_t *self, tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree, gint hf, guint encoding)
{
guint tlv_offset;
gint tlv_type, tlv_len;
/* make sure the TLV information is valid */
if(!self->valid)
{ /* invalid TLV info */
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Invalid TLV");
return;
}
tlv_offset = offset;
/* display TLV type */
proto_tree_add_item(tree, hf_m2m_type, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
tlv_offset++;
/* check the TLV length type */
if( self->length_type )
{ /* multiple bytes TLV length */
/* display the length of the TLV length with MSB */
proto_tree_add_item(tree, hf_m2m_len_size, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
tlv_offset++;
if(self->size_of_length)
/* display the multiple byte TLV length */
proto_tree_add_item(tree, hf_m2m_len, tvb, tlv_offset, self->size_of_length, ENC_BIG_ENDIAN);
else
return;
}
else /* display the single byte TLV length */
proto_tree_add_item(tree, hf_m2m_len, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
tlv_type = get_tlv_type(self);
/* Display Frame Number as special case for filter */
if ( tlv_type == TLV_FRAME_NUM )
{
return;
}
/* get the TLV length */
tlv_len = get_tlv_length(self);
proto_tree_add_item(tree, hf, tvb, (offset + self->value_offset), tlv_len, encoding);
}
/* Register Wimax Mac to Mac Protocol */
void proto_register_m2m(void)
{
/* M2M TLV display */
static hf_register_info hf[] =
{
{
&hf_m2m_sequence_number,
{
"Packet Sequence Number", "m2m.seq_number",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_frame_number,
{
"Value", "m2m.frame_number",
FT_UINT24, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_tlv_count,
{
"Number of TLVs in the packet", "m2m.tlv_count",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
}
};
/* WiMax TLV display */
static hf_register_info hf_tlv[] =
{
{
&hf_m2m_type,
{
"Type", "m2m.tlv_type",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_len,
{
"Length", "m2m.tlv_len",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_len_size,
{
"Length Size", "m2m.tlv_len_size",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL
}
},
#if 0
{
&hf_m2m_value_bytes,
{
"Value (hex)", "m2m.multibyte_tlv_value",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL
}
},
#endif
{
&hf_m2m_value_protocol_vers_uint8,
{
"Value", "m2m.protocol_vers_tlv_value",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_value_burst_num_uint8,
{
"Value", "m2m.burst_num_tlv_value",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_value_frag_type_uint8,
{
"Value", "m2m.frag_type_tlv_value",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_value_frag_num_uint8,
{
"Value", "m2m.frag_num_tlv_value",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_value_pdu_burst,
{
"Value (hex)", "m2m.pdu_burst_tlv_value",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_value_fast_fb,
{
"Value (hex)", "m2m.fast_fb_tlv_value",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_value_fch_burst_uint24,
{
"Value", "m2m.fch_burst_tlv_value",
FT_UINT24, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_value_cdma_code_uint24,
{
"Value", "m2m.cdma_code_tlv_value",
FT_UINT24, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_value_crc16_status_uint8,
{
"Value", "m2m.crc16_status_tlv_value",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_value_burst_power_uint16,
{
"Value", "m2m.burst_power_tlv_value",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_value_burst_cinr_uint16,
{
"Value", "m2m.burst_cinr_tlv_value",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_value_preamble_uint16,
{
"Value", "m2m.preamble_tlv_value",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_value_harq_ack_burst_bytes,
{
"Value (hex)", "m2m.harq_ack_burst_tlv_value",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_m2m_phy_attributes,
{
"Value (hex)", "m2m.phy_attributes",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_wimax_invalid_tlv,
{
"Invalid TLV (hex)", "m2m.invalid_tlv",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL
}
}
};
static gint *ett[] =
{
&ett_m2m,
&ett_m2m_tlv,
&ett_m2m_fch,
&ett_m2m_cdma,
&ett_m2m_ffb,
};
static ei_register_info ei[] = {
{ &ei_m2m_unexpected_length, { "m2m.unexpected_length", PI_MALFORMED, PI_ERROR, "Unexpected length", EXPFILL }},
};
expert_module_t* expert_m2m;
proto_m2m = proto_register_protocol (
"WiMax Mac to Mac Packet", /* name */
"M2M (m2m)", /* short name */
"m2m" /* abbrev */
);
proto_register_field_array(proto_m2m, hf, array_length(hf));
proto_register_field_array(proto_m2m, hf_tlv, array_length(hf_tlv));
proto_register_subtree_array(ett, array_length(ett));
expert_m2m = expert_register_protocol(proto_m2m);
expert_register_field_array(expert_m2m, ei, array_length(ei));
m2m_handle = register_dissector("mac_mgmt_msg_m2m_handler", dissect_m2m, proto_m2m);
/* Register reassembly table */
reassembly_table_register(&pdu_reassembly_table,
&addresses_reassembly_table_functions);
}
/* Register Wimax Mac to Mac Protocol handler */
void proto_reg_handoff_m2m(void)
{
dissector_add_uint("ethertype", ETHERTYPE_WMX_M2M, m2m_handle);
/* find the wimax handlers */
wimax_cdma_code_burst_handle = find_dissector("wimax_cdma_code_burst_handler");
wimax_fch_burst_handle = find_dissector("wimax_fch_burst_handler");
wimax_ffb_burst_handle = find_dissector("wimax_ffb_burst_handler");
wimax_hack_burst_handle = find_dissector("wimax_hack_burst_handler");
wimax_pdu_burst_handle = find_dissector("wimax_pdu_burst_handler");
wimax_phy_attributes_burst_handle = find_dissector("wimax_phy_attributes_burst_handler");
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/packet-wmx.c | /* packet-wmx.c
* WiMax Protocol and dissectors
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <string.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include "wimax-int.h"
#include "wimax_tlv.h"
#include "wimax_utils.h"
void proto_register_wimax(void);
void proto_reg_handoff_wimax(void);
/* Global variables */
gint proto_wimax = -1;
gint8 arq_enabled = 0;
gint scheduling_service_type = 0;
gint mac_sdu_length = 49; /* default SDU size is 49 bytes (11.13.16) */
extern guint global_cid_max_basic;
extern gboolean include_cor2_changes;
address bs_address = ADDRESS_INIT_NONE;
static int hf_tlv_type = -1;
static int hf_tlv_length = -1;
static int hf_tlv_length_size = -1;
#define MAX_NUM_TLVS 256
/* Global TLV array to retrieve unique subtree identifiers */
static gint ett_tlv[MAX_NUM_TLVS];
static const gchar tlv_val_1byte[] = "TLV value: %s (0x%02x)";
static const gchar tlv_val_2byte[] = "TLV value: %s (0x%04x)";
static const gchar tlv_val_3byte[] = "TLV value: %s (0x%06x)";
static const gchar tlv_val_4byte[] = "TLV value: %s (0x%08x)";
static const gchar tlv_val_5byte[] = "TLV value: %s (0x%08x...)";
/*************************************************************/
/* add_tlv_subtree() */
/* Return a pointer to a proto_item of a TLV value that */
/* already contains the type and length of the given TLV. */
/* tree - the parent to which the new tree will */
/* be attached */
/* hfindex - the index of the item to be attached */
/* tvb - a pointer to the packet data */
/* start - offset within the packet */
/* length - length of this item */
/* encoding - encoding for proto_tree_add_item */
/* return: */
/* pointer to a proto_item */
/*************************************************************/
proto_item *add_tlv_subtree(tlv_info_t *self, proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, const guint encoding)
{
header_field_info *hf;
proto_tree *tlv_tree;
proto_item *tlv_item;
gint tlv_value_length, tlv_val_offset;
guint8 size_of_tlv_length_field;
guint8 tlv_type;
/* Make sure we're dealing with a valid TLV here */
if (get_tlv_type(self) < 0)
return tree;
/* Retrieve the necessary TLV information */
tlv_val_offset = get_tlv_value_offset(self);
tlv_value_length = get_tlv_length(self);
size_of_tlv_length_field = get_tlv_size_of_length(self);
tlv_type = get_tlv_type(self);
hf = proto_registrar_get_nth(hfindex);
tlv_tree = proto_tree_add_subtree(tree, tvb, start, tlv_value_length+tlv_val_offset, ett_tlv[tlv_type], NULL, hf->name);
proto_tree_add_uint(tlv_tree, hf_tlv_type, tvb, start, 1, tlv_type);
if (size_of_tlv_length_field > 0) /* It is */
{
/* display the length of the length field TLV */
proto_tree_add_uint(tlv_tree, hf_tlv_length_size, tvb, start+1, 1, size_of_tlv_length_field);
/* display the TLV length */
proto_tree_add_uint(tlv_tree, hf_tlv_length, tvb, start+2, size_of_tlv_length_field, tlv_value_length);
} else { /* It is not */
/* display the TLV length */
proto_tree_add_uint(tlv_tree, hf_tlv_length, tvb, start+1, 1, tlv_value_length);
}
tlv_item = proto_tree_add_item(tlv_tree, hfindex, tvb, start+tlv_val_offset, tlv_value_length, encoding);
/* Return a pointer to the value level */
return tlv_item;
}
/*************************************************************/
/* add_tlv_subtree_no_item() */
/* Return a pointer to a proto_tree of a TLV value that */
/* already contains the type and length, but no value */
/* tree - the parent to which the new tree will */
/* be attached */
/* hfindex - the index of the item to be attached */
/* tvb - a pointer to the packet data */
/* start - offset within the packet */
/* length - length of this item */
/* return: */
/* pointer to a proto_tree (to then add value) */
/*************************************************************/
proto_tree *add_tlv_subtree_no_item(tlv_info_t *self, proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start)
{
header_field_info *hf;
proto_tree *tlv_tree;
gint tlv_value_length, tlv_val_offset;
guint8 size_of_tlv_length_field;
guint8 tlv_type;
/* Make sure we're dealing with a valid TLV here */
if (get_tlv_type(self) < 0)
return tree;
/* Retrieve the necessary TLV information */
tlv_val_offset = get_tlv_value_offset(self);
tlv_value_length = get_tlv_length(self);
size_of_tlv_length_field = get_tlv_size_of_length(self);
tlv_type = get_tlv_type(self);
hf = proto_registrar_get_nth(hfindex);
tlv_tree = proto_tree_add_subtree(tree, tvb, start, tlv_value_length+tlv_val_offset, ett_tlv[tlv_type], NULL, hf->name);
proto_tree_add_uint(tlv_tree, hf_tlv_type, tvb, start, 1, tlv_type);
if (size_of_tlv_length_field > 0) /* It is */
{
/* display the length of the length field TLV */
proto_tree_add_uint(tlv_tree, hf_tlv_length_size, tvb, start+1, 1, size_of_tlv_length_field);
/* display the TLV length */
proto_tree_add_uint(tlv_tree, hf_tlv_length, tvb, start+2, size_of_tlv_length_field, tlv_value_length);
} else { /* It is not */
/* display the TLV length */
proto_tree_add_uint(tlv_tree, hf_tlv_length, tvb, start+1, 1, tlv_value_length);
}
/* Return a pointer to the tree level (to manually add item) */
return tlv_tree;
}
/*************************************************************/
/* add_protocol_subtree() */
/* Return a pointer to a proto_tree that already contains */
/* the type and length of a given TLV. */
/* tree - the parent to which the new tree will */
/* be attached */
/* hfindex - the index of the item to be attached */
/* tvb - a pointer to the packet data */
/* start - offset within the packet */
/* length - length of this item */
/* format - printf style formatting string */
/* ... - arguments to format */
/* return: */
/* pointer to a proto_tree */
/*************************************************************/
proto_tree *add_protocol_subtree(tlv_info_t *self, gint idx, proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length _U_, const char *label)
{
/* Declare local variables */
proto_tree *tlv_tree;
proto_item *tlv_item;
gint tlv_value_length, tlv_val_offset;
guint8 size_of_tlv_length_field;
guint8 tlv_type;
guint32 tlv_value;
const gchar *hex_fmt;
/* Make sure we're dealing with a valid TLV here */
if (get_tlv_type(self) < 0)
return tree;
/* Retrieve the necessary TLV information */
tlv_val_offset = get_tlv_value_offset(self);
tlv_value_length = get_tlv_length(self);
size_of_tlv_length_field = get_tlv_size_of_length(self);
tlv_type = get_tlv_type(self);
/* display the TLV name and display the value in hex. Highlight type, length, and value. */
tlv_item = proto_tree_add_protocol_format(tree, hfindex, tvb, start, tlv_value_length+tlv_val_offset, "%s (%u byte(s))", label, tlv_value_length);
tlv_tree = proto_item_add_subtree(tlv_item, ett_tlv[tlv_type]);
proto_tree_add_uint(tlv_tree, hf_tlv_type, tvb, start, 1, tlv_type);
if (size_of_tlv_length_field > 0) /* It is */
{
/* display the length of the length field TLV */
proto_tree_add_uint(tlv_tree, hf_tlv_length_size, tvb, start+1, 1, size_of_tlv_length_field);
/* display the TLV length */
proto_tree_add_uint(tlv_tree, hf_tlv_length, tvb, start+2, size_of_tlv_length_field, tlv_value_length);
} else { /* It is not */
/* display the TLV length */
proto_tree_add_uint(tlv_tree, hf_tlv_length, tvb, start+1, 1, tlv_value_length);
}
/* display the TLV value and make it a subtree */
switch (tlv_value_length)
{
case 1:
tlv_value = tvb_get_guint8(tvb, start+tlv_val_offset);
hex_fmt = tlv_val_1byte;
break;
case 2:
tlv_value = tvb_get_ntohs(tvb, start+tlv_val_offset);
hex_fmt = tlv_val_2byte;
break;
case 3:
tlv_value = tvb_get_ntoh24(tvb, start+tlv_val_offset);
hex_fmt = tlv_val_3byte;
break;
case 4:
tlv_value = tvb_get_ntohl(tvb, start+tlv_val_offset);
hex_fmt = tlv_val_4byte;
break;
default:
tlv_value = tvb_get_ntohl(tvb, start+tlv_val_offset);
hex_fmt = tlv_val_5byte;
break;
}
/* Show "TLV value: " */
tlv_tree = proto_tree_add_subtree_format(tlv_tree, tvb, start+tlv_val_offset, tlv_value_length, idx, NULL, hex_fmt, label, tlv_value);
/* Return a pointer to the value level */
return tlv_tree;
}
/* WiMax protocol dissector */
static int dissect_wimax(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree _U_, void* data _U_)
{
/* display the WiMax protocol name */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "WiMax");
/* Clear out stuff in the info column */
col_clear(pinfo->cinfo, COL_INFO);
return tvb_captured_length(tvb);
}
gboolean is_down_link(packet_info *pinfo)
{
if (pinfo->p2p_dir == P2P_DIR_RECV)
return TRUE;
if (pinfo->p2p_dir == P2P_DIR_UNKNOWN)
if(bs_address.len && !cmp_address(&bs_address, &pinfo->src))
return TRUE;
return FALSE;
}
/* Register Wimax Protocol */
void proto_register_wimax(void)
{
int i;
module_t *wimax_module;
static hf_register_info hf[] = {
{ &hf_tlv_type, { "TLV type", "wmx.tlv_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_tlv_length, { "TLV length", "wmx.tlv_length", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_tlv_length_size, { "Size of TLV length field", "wmx.tlv_length_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
};
gint *ett_reg[MAX_NUM_TLVS];
/* Register the WiMax protocols here */
proto_wimax = proto_register_protocol (
"WiMax Protocol", /* name */
"WiMax (wmx)", /* short name */
"wmx" /* abbrev */
);
proto_register_field_array(proto_wimax, hf, array_length(hf));
/* Register the ett TLV array to retrieve unique subtree identifiers */
for (i = 0; i < MAX_NUM_TLVS; i++)
{
ett_tlv[i] = -1;
ett_reg[i] = &ett_tlv[i];
}
proto_register_subtree_array(ett_reg, array_length(ett_reg));
/* Register the WiMax dissector */
register_dissector("wmx", dissect_wimax, proto_wimax);
wimax_module = prefs_register_protocol(proto_wimax, NULL);
prefs_register_uint_preference(wimax_module, "basic_cid_max",
"Maximum Basic CID",
"Set the maximum Basic CID"
" used in the Wimax decoder"
" (if other than the default of 320)."
" Note: The maximum Primary CID is"
" double the maximum Basic CID.",
10, &global_cid_max_basic);
prefs_register_bool_preference(wimax_module, "corrigendum_2_version",
"Corrigendum 2 Version",
"Set to TRUE to use the Corrigendum"
" 2 version of Wimax message decoding."
" Set to FALSE to use the 802.16e-2005"
" version.",
&include_cor2_changes);
prefs_register_obsolete_preference(wimax_module, "wimax.basic_cid_max");
prefs_register_obsolete_preference(wimax_module, "wimax.corrigendum_2_version");
/*
* Call sub-registrations in the correct order because they depend
* on proto_register_wimax() being run first.
*/
wimax_proto_register_wimax_cdma();
wimax_proto_register_wimax_compact_dlmap_ie();
wimax_proto_register_wimax_compact_ulmap_ie();
wimax_proto_register_wimax_fch();
wimax_proto_register_wimax_ffb();
wimax_proto_register_wimax_hack();
wimax_proto_register_wimax_harq_map();
wimax_proto_register_wimax_pdu();
wimax_proto_register_wimax_phy_attributes();
wimax_proto_register_wimax_utility_decoders();
wimax_proto_register_mac_header_generic();
wimax_proto_register_mac_header_type_1();
wimax_proto_register_mac_header_type_2();
}
/*
* If we're going to give the register routines for the above files special
* names to ensure that they're called in the above order in the above
* routine, we have to do the same with their handoff routines, if they
* have any - that's the way the registration generation stuff now works.
*/
void proto_reg_handoff_wimax(void)
{
wimax_proto_reg_handoff_wimax_pdu();
wimax_proto_reg_handoff_mac_header_generic();
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
wireshark/plugins/epan/wimax/README.wimax | This document is an attempt, to explain how to use the wimax plugin
in this directory.
Overview
--------
The wimax plugin is a standalone Wireshark plugin that contains a set
of WiMax Protocol dissectors. The plugin registers the WiMax Protocol
dissectors without attached to any packet type. So none of the
dissectors will be called by the Wireshark because there is no any
packet type hookup to the plugin. However, it is very simple to add
the WiMax Protocol decoding capability into any of the packet decoder
by searching and calling the WiMax Protocol dissectors since they are
registered to Wireshark already (see WiMAX M2M Encapsulation Protocol
for an example).
WiMax Protocol dissector list
-------------
WiMax Burst Dissectors:
1. wimax_cdma_code_burst_handler - WiMax CDMA Code Attribute Burst dissector.
2. wimax_fch_burst_handler - WiMax FCH Burst dissector.
3. wimax_ffb_burst_handler - WiMax Fast Feedback Burst dissector.
4. wimax_pdu_burst_handler - WiMax PDU Burst dissector.
5. wimax_hack_burst_handler - WiMax HACK Burst dissector.
6. wimax_phy_attributes_burst_handler - WiMax PHY Attributes Burst dissector.
WiMax MAC dissectors:
7. mac_header_type_1_handler - WiMax TYPE I MAC Header PDU dissector.
8. mac_header_type_2_handler - WiMax TYPE II MAC Header PDU dissector.
9. mac_header_generic_handler - WiMax Generic MAC Header PDU dissector.
10. mac_mgmt_msg_handler - WiMax MAC Management Messages dissector.
WiMax Utility dissectors:
11. wimax_service_flow_encodings_decoder - WiMax Service Flow Encodings dissector.
12. wimax_error_parameter_set_decoder - WiMax Error Parameter Set dissector.
13. wimax_security_negotiation_parameters_decoder - WiMax Security Negotiation Parameter dissector.
14. wimax_pkm_tlv_encoded_attributes_decoder - WiMax PKM TLV Encoded Attributes dissector.
15. wimax_tek_parameters_decoder - WiMax TEK Parameters dissector.
16. wimax_pkm_configuration_settings_decoder - WiMax PKM Configuration Settings dissector.
17. wimax_sa_descriptor_decoder - WiMax SA Descriptor dissector.
18. wimax_cryptographic_suite_list_decoder - WiMax Cryptographic Suite List dissector.
19. wimax_security_capabilities_decoder - WiMax Security Capabilities dissector.
20. wimax_common_tlv_encoding_decoder - WiMax Common TLV Encoding dissector.
19. wimax_vendor_specific_information_decoder - WiMax Vendor-Specific Information dissector.
Usages
--------
To use any of the dissectors listed above:
1. Call Wireshark function: handle = find_dissector("dissector_name")
to get the dissector's handler.
Example: mgt_msg_handle = find_dissector("mac_mgmt_msg_handler");
2. If find_dissector() finds the dissector successfully a non-NULL
handle will be returned. Then call another Wireshark function:
call_dissector(handle, tvb, pinfo, tree) to call the dissector
corresponding to the handle.
Here, handle is the value returned by find_dissector() function.
tvb is the pointer of the data buffer which contains the exact
content defined by the IEEE 802.16 standards for the dissector.
pinfo is the pointer to the packet information from Wireshark.
tree is the pointer to the display tree or sub-tree.
Example: call_dissector(mgt_msg_handle, mgt_msg_tvb, pinfo, mgt_msg_tree);
3. The WiMax Utility dissectors should be called directly.
Notes
--------
1. All the burst data has to be defraged before passing it to the
WiMax burst dissectors.
2. The wimax_pdu_burst_handler will automatically call
mac_header_generic_handler, mac_header_type_1_handler and
mac_header_type_2_handler based on the PDU contents.
3. The mac_header_generic_handler will automatically call
mac_mgmt_msg_handler based on the PDU payload.
4. All the dissectors can be called independently but the data passed
to the dissectors has to contain exact content defined by the
IEEE 802.16 standards. |
|
C/C++ | wireshark/plugins/epan/wimax/wimax-int.h | /* wimax-int.h
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef __WIMAX_INT_H__
#define __WIMAX_INT_H__
void wimax_proto_register_wimax_cdma(void);
void wimax_proto_register_wimax_compact_dlmap_ie(void);
void wimax_proto_register_wimax_compact_ulmap_ie(void);
void wimax_proto_register_wimax_fch(void);
void wimax_proto_register_wimax_ffb(void);
void wimax_proto_register_wimax_hack(void);
void wimax_proto_register_wimax_harq_map(void);
void wimax_proto_register_wimax_pdu(void);
void wimax_proto_register_wimax_phy_attributes(void);
void wimax_proto_register_wimax_utility_decoders(void);
void wimax_proto_register_mac_header_generic(void);
void wimax_proto_register_mac_header_type_1(void);
void wimax_proto_register_mac_header_type_2(void);
void wimax_proto_reg_handoff_wimax_pdu(void);
void wimax_proto_reg_handoff_mac_header_generic(void);
#endif |
C/C++ | wireshark/plugins/epan/wimax/wimax_bits.h | /* wimax_bits.h
* WiMax MAC Management UL-MAP Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Mike Harvey <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef __wimax_bits_h__
#define __wimax_bits_h__
#include <wsutil/pint.h>
/********************************************************************
* Functions for working with nibbles and bits
*/
/* SWAR functions */
#define _BITS(n,hi,lo) (((n)>>(lo))&((1<<(((hi)-(lo))+1))-1))
#define _ADD_SWAP(x,y) { (x) = (x) + (y); (y) = (x) - (y); (x) = (x) - (y); }
#define _XOR_SWAP(x,y) { (x) ^= (y); (y) ^= (x); (x) ^= (y); }
#define _SWAP(x,y) do { int t = (x); (x) = (y); (y) = t; } while(0)
/********************************************************************
* Functions for working with nibbles
*
*/
#define NIBBLE_MASK 0x0F
#define BYTE_MASK 0xFF
/* extract the nibble at the given nibble address 'n' of tvbuff_t 't' */
#define TVB_NIB_NIBBLE(n,t) \
(((n) & 1) \
? tvb_get_guint8((t), (n)/2) & NIBBLE_MASK \
: (tvb_get_guint8((t), (n)/2) >> 4) & NIBBLE_MASK)
/* extract the byte at the given nibble address 'n' of tvbuff_t 't' */
#define TVB_NIB_BYTE(n,t) \
(n) & 1 \
? (tvb_get_ntohs((t), (n)/2) >> 4) & BYTE_MASK \
: tvb_get_guint8((t), (n)/2)
/* extract 12 bits at the given nibble address */
#define TVB_NIB_BITS12(n,t) \
(TVB_NIB_NIBBLE(n+2,t) | (TVB_NIB_BYTE(n,t) << 4))
/* extract the word at the given nibble address 'n' of tvbuff_t 't' */
#define TVB_NIB_WORD(n,t) \
(n) & 1 \
? (gint)((tvb_get_ntohl((t), (n)/2) >> 12) & 0x0000FFFF) \
: tvb_get_ntohs((t), (n)/2)
/* extract the word at the given nibble address 'n' of tvbuff_t 't' */
#define TVB_NIB_LONG(n,t) \
(n) & 1 \
? (tvb_get_ntohl((t), (n)/2) << 4) | ((tvb_get_guint8((t), (n)/2 + 4) >> 4) & NIBBLE_MASK) \
: tvb_get_ntohl((t), (n)/2)
/* Only currently used with nib == 1 or 2 */
#define TVB_NIB_NIBS(nib, t, num) \
((num) == 1 ? TVB_NIB_NIBBLE(nib,t) : \
((num) == 2 ? TVB_NIB_BYTE(nib,t) : \
((num) == 3 ? TVB_NIB_BITS12(nib,t) : \
((num) == 4 ? TVB_NIB_WORD(nib,t) : \
0))))
/* to highlight nibfields correctly in wireshark
* AddItem(..., WSADDR(buf,bit), WSLEN(bit), ...) */
/* determine starting byte to highlight a series of nibbles */
#define NIB_ADDR(nib) ((nib)/2)
/* determine number of bytes to highlight a series of nibbles */
#define NIB_LEN(nib,len) ((1 + ((nib) &1) + (len))/2)
#define NIBHI(nib,len) NIB_ADDR(nib),NIB_LEN(nib,len)
/********************************************************************
* bitfield functions - for extracting bitfields from a buffer
*
* TODO: 64 bit functions use two 32-bit values;
* would be better to use 32+8 bits to avoid overrunning buffers
*
*/
/* find the byte-address for the bitfield */
#define ADDR(bit) ((bit) / 8)
#define ADDR16(bit) ((bit) / 8)
#define ADDR32(bit) ((bit) / 8)
/* find the offset (from the MSB) to the start of the bitfield */
#define OFFSET(bit) ((bit) % 8)
#define OFFSET16(bit) ((bit) % 8)
#define OFFSET32(bit) ((bit) % 8)
/* find the number of bits to shift right (SHIFT64 is upper dword) */
#define SHIFT(bit,num) ( 8 - ((bit)%8) - (num))
#define SHIFT16(bit,num) (16 - ((bit)%8) - (num))
#define SHIFT32(bit,num) (32 - ((bit)%8) - (num))
#define SHIFT64a(bit,num) (num - (32 - OFFSET32(bit)))
#define SHIFT64b(bit,num) (32 - ((num) - (32 - OFFSET32(bit))))
/* create a mask to mask off the bitfield */
#define MASK8(num) (0xFF >> (8 - (num)))
#define MASK16(num) (0xFFFF >> (16 - (num)))
#define MASK32(num) (0xFFFFFFFF >> (32 - (num)))
#define MASK64a(bit) (MASK32(32 - OFFSET32(bit)))
#define MASK64b(bit,num) (MASK32(num - (32 - OFFSET32(bit))))
/* note that if you have a bitfield of length 2 or more, it may cross a
* byte boundary so you should use TVB_BIT_BITS16 */
/* extract a single bit
* bit ... bit address
* tvb ... tvbuff_t
*/
#define TVB_BIT_BIT(bit, tvb) \
(( tvb_get_guint8(tvb, ADDR(bit)) >> SHIFT(bit,1) ) & 0x1)
/* extract bitfield up to 9 bits
* bit ... bit address
* tvb ... tvbuff_t
* num ... length of bitfield
*/
#define TVB_BIT_BITS16(bit, tvb, num) \
(( tvb_get_ntohs(tvb, ADDR16(bit)) >> SHIFT16(bit,num) ) & MASK16(num))
/* extract bitfield up to 24 bits
* bit ... bit address
* tvb ... tvbuff_t
* num ... length of bitfield
*/
#define TVB_BIT_BITS32(bit, tvb, num) \
((tvb_get_ntohl(tvb, ADDR32(bit)) >> SHIFT32(bit,num) ) & MASK32(num))
/* bitfield up to 32 bits */
#define TVB_BIT_BITS64a(bit, tvb, num) \
((tvb_get_ntohl(tvb, ADDR32(bit)) & MASK64a(bit)) << SHIFT64a(bit,num))
#define TVB_BIT_BITS64b(bit, tvb, num) \
((tvb_get_ntohl(tvb, ADDR32(bit)+4) >> SHIFT64b(bit,num) ) & MASK64b(bit,num))
#define TVB_BIT_BITS64(bit, tvb, num) \
( (OFFSET32(bit)+(num)) <= 32 \
? TVB_BIT_BITS32(bit,tvb,num) \
: TVB_BIT_BITS64a(bit,tvb,num) \
| TVB_BIT_BITS64b(bit,tvb,num) )
#define TVB_BIT_BITS(bit, tvb, num) \
((num) == 1 ? (gint)TVB_BIT_BIT(bit,tvb) : \
((num) <= 9 ? (gint)TVB_BIT_BITS16(bit,tvb,num) : \
((num) <= 24 ? (gint)TVB_BIT_BITS32(bit,tvb,num) : \
((num) <= 32 ? (gint)TVB_BIT_BITS64(bit,tvb,num) : \
(gint)0 ))))
/* to highlight bitfields correctly in wireshark
* AddItem(..., WSADDR(buf,bit), WSLEN(bit), ...) */
/* determine starting byte to highlight a series of nibbles */
#define BIT_ADDR(bit) (ADDR(bit))
/* determine number of bytes to highlight */
#define BIT_LEN(bit,len) (1 + ((OFFSET(bit) + len - 1) / 8))
#define BITHI(bit,len) BIT_ADDR(bit),BIT_LEN(bit,len)
/********************************************************************
* padding functions - return number of nibbles/bits needed to
* pad to a byte boundary */
#define BIT_PADDING(bit, bits) ((bit) % (bits)) ? ((bits) - ((bit) % (bits))) : 0
#define NIB_PADDING(nib) ((nib) & 0x1)
/********************************************************************
* conversion functions - between bytes, nibbles, and bits */
#define BYTE_TO_BIT(n) ((n) * 8)
#define BYTE_TO_NIB(n) ((n) * 2)
#define BIT_TO_BYTE(n) ((n) / 8)
#define BIT_TO_NIB(n) ((n) / 4)
#define NIB_TO_BYTE(n) ((n) / 2)
#define NIB_TO_BIT(n) ((n) * 4)
#endif |
C | wireshark/plugins/epan/wimax/wimax_cdma_code_decoder.c | /* wimax_cdma_code_decoder.c
* WiMax CDMA CODE Attribute decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax-int.h"
static int proto_wimax_cdma_code_decoder = -1;
static gint ett_wimax_cdma_code_decoder = -1;
static int hf_wimax_ranging_code = -1;
static int hf_wimax_ranging_symbol_offset = -1;
static int hf_wimax_ranging_subchannel_offset = -1;
static int dissect_wimax_cdma_code_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
gint offset = 0;
proto_item *cdma_item;
proto_tree *cdma_tree;
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CDMA Code Attribute");
if (tree)
{ /* we are being asked for details */
/* display CDMA dissector info */
cdma_item = proto_tree_add_item(tree, proto_wimax_cdma_code_decoder, tvb, offset, -1, ENC_NA);
/* 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, ENC_BIG_ENDIAN);
/* display the 2nd CDMA Code */
proto_tree_add_item(cdma_tree, hf_wimax_ranging_symbol_offset, tvb, offset+1, 1, ENC_BIG_ENDIAN);
/* display the 3rd CDMA Code */
proto_tree_add_item(cdma_tree, hf_wimax_ranging_subchannel_offset, tvb, offset+2, 1, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
/* Register Wimax CDMA Protocol */
void wimax_proto_register_wimax_cdma(void)
{
/* TLV display */
static hf_register_info hf[] =
{
{
&hf_wimax_ranging_code,
{
"Ranging Code", "wmx.cdma.ranging_code",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_wimax_ranging_symbol_offset,
{
"Ranging Symbol Offset", "wmx.cdma.ranging_symbol_offset",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_wimax_ranging_subchannel_offset,
{
"Ranging Sub-Channel Offset", "wmx.cdma.ranging_subchannel_offset",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL
}
}
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_wimax_cdma_code_decoder,
};
proto_wimax_cdma_code_decoder = proto_register_protocol (
"WiMax CDMA Code Attribute", /* name */
"CDMA Code Attribute", /* short name */
"wmx.cdma" /* abbrev */
);
/* 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, proto_wimax_cdma_code_decoder);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/wimax_compact_dlmap_ie_decoder.c | /* wimax_compact_dlmap_ie_decoder.c
* WiMax HARQ Map Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax-int.h"
#include "wimax_compact_dlmap_ie_decoder.h"
extern gint proto_wimax;
/* MASKs */
#define MSB_NIBBLE_MASK 0xF0
#define LSB_NIBBLE_MASK 0x0F
#define CID_TYPE_NORMAL 0
#define CID_TYPE_RCID11 1
#define CID_TYPE_RCID7 2
#define CID_TYPE_RCID3 3
/* Global Variables */
guint cid_type = 0;
guint band_amc_subchannel_type = 0;
guint max_logical_bands = 12;
guint num_of_broadcast_symbols = 0;
guint num_of_dl_band_amc_symbols = 0;
guint num_of_ul_band_amc_symbols = 0;
/* from switch HARQ mode extension IE */
guint harq_mode = 0;
/* forward reference */
static guint wimax_compact_dlmap_format_configuration_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
static guint wimax_compact_dlmap_rcid_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
static guint wimax_compact_dlmap_harq_control_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
static guint wimax_compact_dlmap_cqich_control_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
static guint wimax_cdlmap_extension_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
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;
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;
#endif
/* New Format Indications */
static const true_false_string tfs_indication =
{
"New format",
"No new format"
};
/* Prefixes */
static const true_false_string tfs_prefix =
{
"Enable HARQ",
"Temporary Disable HARQ"
};
/* CQICH Indicator */
static const true_false_string tfs_cqich_ind =
{
"With CQICH Control IE",
"No CQICH Control IE"
};
/* CID types */
static const value_string vals_cid_types[] =
{
{ 0, "Normal CID" },
{ 1, "RCID11 (default)" },
{ 2, "RCID7" },
{ 3, "RCID3" },
{ 0, NULL }
};
/* Subchannel Types */
static const value_string vals_subchannel_types[] =
{
{ 0, "Default Type" },
{ 1, "1 bin x 6 symbols Type" },
{ 2, "2 bin x 3 symbols Type" },
{ 3, "3 bin x 2 symbols Type" },
{ 0, NULL }
};
/* Max Logical Bands */
static const value_string vals_max_logical_bands[] =
{
{ 0, "3 Bands" },
{ 1, "6 Bands" },
{ 2, "12 Bands (default)" },
{ 3, "24 Bands" },
{ 0, NULL }
};
/* Repetition Coding Indications */
static const value_string rep_msgs[] =
{
{ 0, "No Repetition Coding" },
{ 1, "Repetition Coding of 2 Used" },
{ 2, "Repetition Coding of 4 Used" },
{ 3, "Repetition Coding of 6 Used" },
{ 0, NULL }
};
/* Repetition Coding Indications */
static const value_string vals_allocation_modes[] =
{
{ 0, "Same Number Of Subchannels For The Selected Bands" },
{ 1, "Different Same Number Of Subchannels For The Selected Bands" },
{ 2, "Total Number Of Subchannels For The Selected Bands Determined by Nsch Code and Nep Code" },
{ 3, "Reserved" },
{ 0, NULL }
};
/* Masks */
#define DL_MAP_TYPE_MASK 0xE0
#define UL_MAP_APPEND_MASK 0x10
#define SHORTENED_DIUC_MASK 0xE0
#define COMPANDED_SC_MASK 0x1F
#define DL_MAP_TYPE_MASK_1 0x0E
#define UL_MAP_APPEND_MASK_1 0x01
#define SHORTENED_DIUC_MASK_1 0x0E00
#define COMPANDED_SC_MASK_1 0x01F0
/* display indexies */
static gint hf_cdlmap_dl_map_type = -1;
static gint hf_cdlmap_ul_map_append = -1;
static gint hf_cdlmap_reserved = -1;
static gint hf_cdlmap_nep_code = -1;
static gint hf_cdlmap_nsch_code = -1;
static gint hf_cdlmap_num_bands = -1;
static gint hf_cdlmap_band_index = -1;
static gint hf_cdlmap_nb_bitmap = -1;
static gint hf_cdlmap_dl_map_type_1 = -1;
static gint hf_cdlmap_ul_map_append_1 = -1;
static gint hf_cdlmap_reserved_1 = -1;
static gint hf_cdlmap_nep_code_1 = -1;
static gint hf_cdlmap_nsch_code_1 = -1;
static gint hf_cdlmap_num_bands_1 = -1;
/*static gint hf_cdlmap_band_index_1 = -1;*/
static gint hf_cdlmap_nb_bitmap_1 = -1;
static gint hf_cdlmap_shortened_diuc = -1;
static gint hf_cdlmap_companded_sc = -1;
static gint hf_cdlmap_shortened_uiuc = -1;
static gint hf_cdlmap_shortened_diuc_1 = -1;
static gint hf_cdlmap_companded_sc_1 = -1;
static gint hf_cdlmap_shortened_uiuc_1 = -1;
static gint hf_cdlmap_bin_offset = -1;
static gint hf_cdlmap_bin_offset_1 = -1;
static gint hf_cdlmap_diuc_num_of_subchannels = -1;
static gint hf_cdlmap_diuc_num_of_subchannels_1 = -1;
static gint hf_cdlmap_diuc_repetition_coding_indication = -1;
static gint hf_cdlmap_diuc_repetition_coding_indication_1 = -1;
static gint hf_cdlmap_diuc_reserved = -1;
static gint hf_cdlmap_diuc_reserved_1 = -1;
static gint hf_cdlmap_bit_map_length = -1;
static gint hf_cdlmap_bit_map_length_1 = -1;
static gint hf_cdlmap_bit_map = -1;
static gint hf_cdlmap_diuc = -1;
static gint hf_cdlmap_diuc_1 = -1;
static gint hf_cdlmap_allocation_mode = -1;
static gint hf_cdlmap_allocation_mode_rsvd = -1;
static gint hf_cdlmap_num_subchannels = -1;
static gint hf_cdlmap_allocation_mode_1 = -1;
static gint hf_cdlmap_allocation_mode_rsvd_1 = -1;
static gint hf_cdlmap_num_subchannels_1 = -1;
/* static gint hf_cdlmap_reserved_type = -1; */
static gint hf_cdlmap_reserved_type_1 = -1;
/* display indexies */
static gint hf_format_config_ie_dl_map_type = -1;
static gint hf_format_config_ie_dl_map_type_1 = -1;
static gint hf_format_config_ie_dl_map_type_32 = -1;
static gint hf_format_config_ie_new_format_indication = -1;
static gint hf_format_config_ie_new_format_indication_1 = -1;
static gint hf_format_config_ie_new_format_indication_32 = -1;
static gint hf_format_config_ie_cid_type = -1;
static gint hf_format_config_ie_cid_type_1 = -1;
static gint hf_format_config_ie_safety_pattern = -1;
static gint hf_format_config_ie_safety_pattern_1 = -1;
static gint hf_format_config_ie_subchannel_type = -1;
static gint hf_format_config_ie_subchannel_type_1 = -1;
static gint hf_format_config_ie_max_logical_bands = -1;
static gint hf_format_config_ie_max_logical_bands_1 = -1;
static gint hf_format_config_ie_num_of_broadcast_symbol = -1;
static gint hf_format_config_ie_num_of_broadcast_symbol_1 = -1;
static gint hf_format_config_ie_num_of_dl_band_amc_symbol = -1;
static gint hf_format_config_ie_num_of_dl_band_amc_symbol_1 = -1;
static gint hf_format_config_ie_num_of_ul_band_amc_symbol = -1;
static gint hf_format_config_ie_num_of_ul_band_amc_symbol_1 = -1;
/* Format Configuration IE Masks */
#define FORMAT_CONFIG_IE_DL_MAP_TYPE_MASK 0xE0000000
#define FORMAT_CONFIG_IE_NEW_FORMAT_IND_MASK 0x10000000
#define CID_TYPE_MASK_1 0x0C000000
#define SAFETY_PATTERN_MASK_1 0x03E00000
#define BAND_AMC_SUBCHANNEL_TYPE_MASK_1 0x00180000
#define MAX_LOGICAL_BANDS_MASK_1 0x00060000
#define NUM_BROADCAST_SYMBOLS_MASK_1 0x0001F000
#define NUM_DL_AMC_SYMBOLS_MASK_1 0x00000FC0
#define NUM_UL_AMC_SYMBOLS_MASK_1 0x0000003F
#define CID_TYPE_MASK 0xC0000000
#define SAFETY_PATTERN_MASK 0x3E000000
#define BAND_AMC_SUBCHANNEL_TYPE_MASK 0x01800000
#define MAX_LOGICAL_BANDS_MASK 0x00600000
#define NUM_BROADCAST_SYMBOLS_MASK 0x001F0000
#define NUM_DL_AMC_SYMBOLS_MASK 0x0000FC00
#define NUM_UL_AMC_SYMBOLS_MASK 0x000003F0
/* display indexies */
static gint hf_harq_rcid_ie_prefix = -1;
static gint hf_harq_rcid_ie_prefix_1 = -1;
static gint hf_harq_rcid_ie_normal_cid = -1;
static gint hf_harq_rcid_ie_normal_cid_1 = -1;
static gint hf_harq_rcid_ie_cid3 = -1;
static gint hf_harq_rcid_ie_cid3_1 = -1;
static gint hf_harq_rcid_ie_cid7 = -1;
static gint hf_harq_rcid_ie_cid7_1 = -1;
static gint hf_harq_rcid_ie_cid11 = -1;
static gint hf_harq_rcid_ie_cid11_1 = -1;
static gint hf_harq_rcid_ie_cid11_2 = -1;
static gint hf_harq_rcid_ie_cid11_3 = -1;
/* Masks */
#define WIMAX_RCID_IE_NORMAL_CID_MASK_1 0x0FFFF0
#define WIMAX_RCID_IE_PREFIX_MASK 0x8000
#define WIMAX_RCID_IE_PREFIX_MASK_1 0x0800
#define WIMAX_RCID_IE_CID3_MASK 0x7000
#define WIMAX_RCID_IE_CID3_MASK_1 0x0700
#define WIMAX_RCID_IE_CID7_MASK 0x7F00
#define WIMAX_RCID_IE_CID7_MASK_1 0x07F0
#define WIMAX_RCID_IE_CID11_MASK 0x7FF0
#define WIMAX_RCID_IE_CID11_MASK_1 0x07FF
/* HARQ MAP HARQ Control IE display indexies */
static gint hf_harq_control_ie_prefix = -1;
static gint hf_harq_control_ie_ai_sn = -1;
static gint hf_harq_control_ie_spid = -1;
static gint hf_harq_control_ie_acid = -1;
static gint hf_harq_control_ie_reserved = -1;
static gint hf_harq_control_ie_prefix_1 = -1;
static gint hf_harq_control_ie_ai_sn_1 = -1;
static gint hf_harq_control_ie_spid_1 = -1;
static gint hf_harq_control_ie_acid_1 = -1;
static gint hf_harq_control_ie_reserved_1 = -1;
/* Masks */
#define WIMAX_HARQ_CONTROL_IE_PREFIX_MASK 0x80
#define WIMAX_HARQ_CONTROL_IE_AI_SN_MASK 0x40
#define WIMAX_HARQ_CONTROL_IE_SPID_MASK 0x30
#define WIMAX_HARQ_CONTROL_IE_ACID_MASK 0x0F
#define WIMAX_HARQ_CONTROL_IE_RESERVED_MASK 0x70
#define WIMAX_HARQ_CONTROL_IE_PREFIX_MASK_1 0x0800
#define WIMAX_HARQ_CONTROL_IE_AI_SN_MASK_1 0x0400
#define WIMAX_HARQ_CONTROL_IE_SPID_MASK_1 0x0300
#define WIMAX_HARQ_CONTROL_IE_ACID_MASK_1 0x00F0
#define WIMAX_HARQ_CONTROL_IE_RESERVED_MASK_1 0x0700
/* HARQ MAP CQICH Control IE display indexies */
static gint hf_cqich_control_ie_indicator = -1;
static gint hf_cqich_control_ie_alloc_id = -1;
static gint hf_cqich_control_ie_period = -1;
static gint hf_cqich_control_ie_frame_offset = -1;
static gint hf_cqich_control_ie_duration = -1;
static gint hf_cqich_control_ie_cqi_rep_threshold = -1;
static gint hf_cqich_control_ie_indicator_1 = -1;
static gint hf_cqich_control_ie_alloc_id_1 = -1;
static gint hf_cqich_control_ie_period_1 = -1;
static gint hf_cqich_control_ie_frame_offset_1 = -1;
static gint hf_cqich_control_ie_duration_1 = -1;
static gint hf_cqich_control_ie_cqi_rep_threshold_1 = -1;
/* Masks */
#define WIMAX_CQICH_CONTROL_IE_INDICATOR_MASK 0x8000
#define WIMAX_CQICH_CONTROL_IE_ALLOCATION_INDEX_MASK 0x7E00
#define WIMAX_CQICH_CONTROL_IE_PERIOD_MASK 0x0180
#define WIMAX_CQICH_CONTROL_IE_FRAME_OFFSET_MASK 0x0070
#define WIMAX_CQICH_CONTROL_IE_DURATION_MASK 0x000F
#define WIMAX_CQICH_CONTROL_IE_CQI_REP_THRESHOLD_MASK 0x7000
#define WIMAX_CQICH_CONTROL_IE_INDICATOR_MASK_1 0x080000
#define WIMAX_CQICH_CONTROL_IE_ALLOCATION_INDEX_MASK_1 0x07E000
#define WIMAX_CQICH_CONTROL_IE_PERIOD_MASK_1 0x001800
#define WIMAX_CQICH_CONTROL_IE_FRAME_OFFSET_MASK_1 0x000700
#define WIMAX_CQICH_CONTROL_IE_DURATION_MASK_1 0x0000F0
#define WIMAX_CQICH_CONTROL_IE_CQI_REP_THRESHOLD_MASK_1 0x070000
/* Extension Type */
#define EXTENSION_TYPE_MASK 0xE000
#define EXTENSION_TYPE_MASK_1 0x0E00
#define EXTENSION_SUBTYPE_MASK 0x1F00
#define EXTENSION_SUBTYPE_MASK_1 0x01F0
#define EXTENSION_LENGTH_MASK 0x00F0
#define EXTENSION_LENGTH_MASK_1 0x000F
static gint hf_cdlmap_extension_type = -1;
static gint hf_cdlmap_extension_subtype = -1;
static gint hf_cdlmap_extension_length = -1;
static gint hf_cdlmap_extension_type_1 = -1;
static gint hf_cdlmap_extension_subtype_1 = -1;
static gint hf_cdlmap_extension_length_1 = -1;
static gint hf_cdlmap_extension_time_diversity_mbs = -1;
static gint hf_cdlmap_extension_harq_mode = -1;
static gint hf_cdlmap_extension_unknown_sub_type = -1;
static gint hf_cdlmap_extension_time_diversity_mbs_1 = -1;
static gint hf_cdlmap_extension_harq_mode_1 = -1;
static gint hf_cdlmap_extension_unknown_sub_type_1 = -1;
/* Extended DIUC dependent IE display indexies */
static gint hf_extended_diuc_dependent_ie_diuc = -1;
static gint hf_extended_diuc_dependent_ie_diuc_1 = -1;
static gint hf_extended_diuc_dependent_ie_length = -1;
static gint hf_extended_diuc_dependent_ie_length_1 = -1;
static gint hf_extended_diuc_dependent_ie_channel_measurement = -1;
static gint hf_extended_diuc_dependent_ie_stc_zone = -1;
static gint hf_extended_diuc_dependent_ie_aas_dl = -1;
static gint hf_extended_diuc_dependent_ie_data_location = -1;
static gint hf_extended_diuc_dependent_ie_cid_switch = -1;
static gint hf_extended_diuc_dependent_ie_mimo_dl_basic = -1;
static gint hf_extended_diuc_dependent_ie_mimo_dl_enhanced = -1;
static gint hf_extended_diuc_dependent_ie_harq_map_pointer = -1;
static gint hf_extended_diuc_dependent_ie_phymod_dl = -1;
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;
/* Compact DL-MAP IE Types (table 89) */
#define COMPACT_DL_MAP_TYPE_NORMAL_SUBCHANNEL 0
#define COMPACT_DL_MAP_TYPE_BAND_AMC 1
#define COMPACT_DL_MAP_TYPE_SAFETY 2
#define COMPACT_DL_MAP_TYPE_UIUC 3
#define COMPACT_DL_MAP_TYPE_FORMAT_CONF_IE 4
#define COMPACT_DL_MAP_TYPE_HARQ_ACK_BITMAP_IE 5
#define COMPACT_DL_MAP_TYPE_RESERVED 6
#define COMPACT_DL_MAP_TYPE_EXTENSION 7
/* Compact DL-MAP IE decoder */
guint wimax_compact_dlmap_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
guint diuc, byte, length = 0;
guint dl_map_type, ul_map_append;
guint dl_map_offset, nibble_length, bit_map_length;
guint nband, band_count, i, allocation_mode;
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compact DL-MAP IEs");
#endif
/* set the local offset */
dl_map_offset = offset;
/* Get the first byte */
byte = tvb_get_guint8(tvb, dl_map_offset);
if(nibble_offset & 1)
{
dl_map_type = ((byte & DL_MAP_TYPE_MASK_1) >> 1);
ul_map_append = (byte & UL_MAP_APPEND_MASK_1);
}
else
{
dl_map_type = ((byte & DL_MAP_TYPE_MASK) >> 5);
ul_map_append = (byte & UL_MAP_APPEND_MASK);
}
switch (dl_map_type)
{
case COMPACT_DL_MAP_TYPE_NORMAL_SUBCHANNEL:/* 6.3.2.3.43.6.1 */
if(nibble_offset & 1)
{ /* display the DL-MAP type */
proto_tree_add_item(tree, hf_cdlmap_dl_map_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display the UL-MAP append */
proto_tree_add_item(tree, hf_cdlmap_ul_map_append_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
nibble_offset = 0;
}
else
{ /* display the DL-MAP type */
proto_tree_add_item(tree, hf_cdlmap_dl_map_type, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display the UL-MAP append */
proto_tree_add_item(tree, hf_cdlmap_ul_map_append, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
}
length = 1;
/* decode RCID IE */
nibble_length = wimax_compact_dlmap_rcid_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
dl_map_offset += (nibble_length >> 1);
nibble_offset = (nibble_length & 1);
/* check harq mode */
if(!harq_mode)
{ /* display the Nep and Nsch Code */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_nep_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
proto_tree_add_item(tree, hf_cdlmap_nsch_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_nep_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_nsch_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
}
length += 2;
}
else if(harq_mode == 1)
{ /* display the Shortened DIUC and Companded SC */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_shortened_diuc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_companded_sc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_shortened_diuc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_companded_sc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
/* move to next byte */
dl_map_offset++;
length += 2;
}
/* decode HARQ Control IE */
nibble_length = wimax_compact_dlmap_harq_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
dl_map_offset += ((nibble_offset + nibble_length) >> 1);
nibble_offset = ((nibble_offset + nibble_length) & 1);
/* decode CQICH Control IE */
nibble_length = wimax_compact_dlmap_cqich_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
dl_map_offset += ((nibble_offset + nibble_length) >> 1);
nibble_offset = ((nibble_offset + nibble_length) & 1);
if(ul_map_append)
{ /* check harq mode */
if(harq_mode == 1)
{ /* display the Shortened UIUC and Companded SC */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_shortened_uiuc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_companded_sc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_shortened_uiuc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_companded_sc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
/* move to next byte */
dl_map_offset++;
length += 2;
}
else if(!harq_mode)
{ /* display the Nep and Nsch Code */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_nep_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
proto_tree_add_item(tree, hf_cdlmap_nsch_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_nep_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_nsch_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
}
length += 2;
}
/* decode HARQ Control IE */
nibble_length = wimax_compact_dlmap_harq_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
}
break;
case COMPACT_DL_MAP_TYPE_BAND_AMC:/* 6.3.2.3.43.6.2 */
if(nibble_offset & 1)
{ /* display the DL-MAP type */
proto_tree_add_item(tree, hf_cdlmap_dl_map_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_cdlmap_reserved_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
nibble_offset = 0;
}
else
{ /* display the DL-MAP type */
proto_tree_add_item(tree, hf_cdlmap_dl_map_type, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_cdlmap_reserved, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
}
length = 1;
/* decode RCID IE */
nibble_length = wimax_compact_dlmap_rcid_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
dl_map_offset += (nibble_length >> 1);
nibble_offset = (nibble_length & 1);
/* check harq mode */
if(!harq_mode)
{ /* display the Nep and Nsch Code */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_nep_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
proto_tree_add_item(tree, hf_cdlmap_nsch_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_nep_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_nsch_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
}
length += 2;
}
else if(harq_mode == 1)
{ /* display the Shortened DIUC and Companded SC */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_shortened_diuc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_companded_sc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_shortened_diuc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_companded_sc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
/* move to next byte */
dl_map_offset++;
length += 2;
}
/* get the Nband */
if(max_logical_bands)
{ /* get and display the Nband */
nband = tvb_get_guint8(tvb, dl_map_offset);
if(nibble_offset & 1)
{
nband = (nband & LSB_NIBBLE_MASK);
/* display the Nband */
proto_tree_add_item(tree, hf_cdlmap_num_bands_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
nibble_offset = 0;
if(max_logical_bands == 3)
{
proto_tree_add_item(tree, hf_cdlmap_band_index, tvb, dl_map_offset, nband, ENC_NA);
length += (nband * 2);
/* update offset */
dl_map_offset += nband;
}
else
{
nibble_offset = (nband & 1);
proto_tree_add_item(tree, hf_cdlmap_band_index, tvb, dl_map_offset, ((nband >> 1) + nibble_offset), ENC_NA);
length += nband;
/* update offset */
dl_map_offset += (nband >> 1);
}
}
else
{
nband = ((nband & MSB_NIBBLE_MASK) >> 4);
/* display the Nband */
proto_tree_add_item(tree, hf_cdlmap_num_bands, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
if(max_logical_bands == 3)
{
proto_tree_add_item(tree, hf_cdlmap_band_index, tvb, dl_map_offset, (nband + nibble_offset), ENC_NA);
length += (nband * 2);
/* update offset */
dl_map_offset += nband;
}
else
{
proto_tree_add_item(tree, hf_cdlmap_band_index, tvb, dl_map_offset, ((nband >> 1) + nibble_offset), ENC_NA);
length += nband;
/* update offset */
dl_map_offset += ((nband + nibble_offset) >> 1);
if(nband & 1)
nibble_offset = 0;
}
}
length++;
band_count = nband;
}
else
{
band_count = 1;
/* display the Nb-BITMAP */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_nb_bitmap_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
nibble_offset = 0;
}
else
{
proto_tree_add_item(tree, hf_cdlmap_nb_bitmap, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
}
length++;
}
/* Get the Allocation Mode */
byte = tvb_get_guint8(tvb, dl_map_offset);
if(nibble_offset & 1)
{
allocation_mode = ((byte & 0x0C) >> 2);
proto_tree_add_item(tree, hf_cdlmap_allocation_mode_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_allocation_mode_rsvd_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 0;
dl_map_offset++;
}
else
{
allocation_mode = ((byte & 0xC0) >> 6);
proto_tree_add_item(tree, hf_cdlmap_allocation_mode, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_allocation_mode_rsvd, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
}
/* Decode Allocation Mode - need to be done */
if(!allocation_mode)
{
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_num_subchannels_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_num_subchannels, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
dl_map_offset++;
}
else if(allocation_mode == 1)
{
for(i=0; i<band_count; i++)
{
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_num_subchannels_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_num_subchannels, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
dl_map_offset++;
}
}
/* decode HARQ Control IE */
nibble_length = wimax_compact_dlmap_harq_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
dl_map_offset += ((nibble_offset + nibble_length) >> 1);
nibble_offset = ((nibble_offset + nibble_length) & 1);
/* decode CQICH Control IE */
nibble_length = wimax_compact_dlmap_cqich_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
break;
case COMPACT_DL_MAP_TYPE_SAFETY:/* 6.3.2.3.43.6.3 */
if(nibble_offset & 1)
{ /* display the DL-MAP type */
proto_tree_add_item(tree, hf_cdlmap_dl_map_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display the UL-MAP append */
proto_tree_add_item(tree, hf_cdlmap_ul_map_append_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
nibble_offset = 0;
}
else
{ /* display the DL-MAP type */
proto_tree_add_item(tree, hf_cdlmap_dl_map_type, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display the UL-MAP append */
proto_tree_add_item(tree, hf_cdlmap_ul_map_append, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
}
length = 1;
/* decode RCID IE */
nibble_length = wimax_compact_dlmap_rcid_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
dl_map_offset += (nibble_length >> 1);
nibble_offset = (nibble_length & 1);
/* check harq mode */
if(!harq_mode)
{ /* display the Nep and Nsch Code */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_nep_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
proto_tree_add_item(tree, hf_cdlmap_nsch_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_nep_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_nsch_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
}
length += 2;
}
else if(harq_mode == 1)
{ /* display the Shortened DIUC and Companded SC */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_shortened_diuc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_companded_sc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_shortened_diuc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_companded_sc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
/* move to next byte */
dl_map_offset++;
length += 2;
}
/* display BIN offset */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_bin_offset_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
}
else
{
proto_tree_add_item(tree, hf_cdlmap_bin_offset, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
}
length += 2;
/* decode HARQ Control IE */
nibble_length = wimax_compact_dlmap_harq_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
dl_map_offset += ((nibble_offset + nibble_length) >> 1);
nibble_offset = ((nibble_offset + nibble_length) & 1);
/* decode CQICH Control IE */
nibble_length = wimax_compact_dlmap_cqich_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
dl_map_offset += ((nibble_offset + nibble_length) >> 1);
nibble_offset = ((nibble_offset + nibble_length) & 1);
if(ul_map_append)
{ /* check harq mode */
if(harq_mode == 1)
{ /* display the Shortened DIUC and Companded SC */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_shortened_diuc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_companded_sc_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_shortened_diuc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_companded_sc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
/* move to next byte */
dl_map_offset++;
length += 2;
}
else if(!harq_mode)
{ /* display the Nep and Nsch Code */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_nep_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
proto_tree_add_item(tree, hf_cdlmap_nsch_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_nep_code, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_nsch_code_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
}
length += 2;
}
/* display BIN offset */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_bin_offset_1, tvb, dl_map_offset, 2, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
}
else
{
proto_tree_add_item(tree, hf_cdlmap_bin_offset, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
}
length += 2;
/* decode HARQ Control IE */
nibble_length = wimax_compact_dlmap_harq_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
}
break;
case COMPACT_DL_MAP_TYPE_UIUC:/* 6.3.2.3.43.6.4 */
if(nibble_offset & 1)
{ /* display the DL-MAP type */
proto_tree_add_item(tree, hf_cdlmap_dl_map_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_cdlmap_reserved_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
/* get the new byte */
byte = tvb_get_guint8(tvb, dl_map_offset);
/* get the DIUC */
diuc = ((byte & MSB_NIBBLE_MASK) >> 4);
/* display the DIUC */
proto_tree_add_item(tree, hf_cdlmap_diuc, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
else
{
/* display the DL-MAP type */
proto_tree_add_item(tree, hf_cdlmap_dl_map_type, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_cdlmap_reserved, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* get the DIUC */
diuc = (tvb_get_guint8(tvb, dl_map_offset) & LSB_NIBBLE_MASK);
/* display the DIUC */
proto_tree_add_item(tree, hf_cdlmap_diuc_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
dl_map_offset++;
}
length = 2;
if(diuc == 15)
{ /* Extended DIUC dependent IE */
nibble_length = wimax_extended_diuc_dependent_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
dl_map_offset += (nibble_length >> 1);
nibble_offset = (nibble_length & 1);
}
else
{ /* decode RCID IE */
nibble_length = wimax_compact_dlmap_rcid_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
dl_map_offset += (nibble_length >> 1);
nibble_offset = (nibble_length & 1);
/* display Number of subchannels */
if(nibble_offset & 1)
proto_tree_add_item(tree, hf_cdlmap_diuc_num_of_subchannels_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
else
proto_tree_add_item(tree, hf_cdlmap_diuc_num_of_subchannels, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
length += 2;
/* display the repetition coding indication and reserved bits */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_cdlmap_diuc_repetition_coding_indication_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_diuc_reserved_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_cdlmap_diuc_repetition_coding_indication, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_cdlmap_diuc_reserved, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
}
length += 1;
}
/* decode HARQ Control IE */
nibble_length = wimax_compact_dlmap_harq_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
dl_map_offset += ((nibble_offset + nibble_length) >> 1);
nibble_offset = ((nibble_offset + nibble_length) & 1);
/* decode CQICH Control IE */
nibble_length = wimax_compact_dlmap_cqich_control_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length += nibble_length;
break;
case COMPACT_DL_MAP_TYPE_FORMAT_CONF_IE:/* 6.3.2.3.43.2 */
/* decode the format configuration IE */
nibble_length = wimax_compact_dlmap_format_configuration_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);
length = nibble_length;
break;
case COMPACT_DL_MAP_TYPE_HARQ_ACK_BITMAP_IE:/* 6.3.2.3.43.6.5 */
if(nibble_offset & 1)
{ /* display the DL-MAP type */
proto_tree_add_item(tree, hf_cdlmap_dl_map_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_cdlmap_reserved_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
length = 1;
/* move to next byte */
dl_map_offset++;
/* get the bit map length */
byte = tvb_get_guint8(tvb, dl_map_offset);
bit_map_length = ((byte & MSB_NIBBLE_MASK) >> 4);
/* display BITMAP Length */
proto_tree_add_item(tree, hf_cdlmap_bit_map_length, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display BITMAP */
proto_tree_add_item(tree, hf_cdlmap_bit_map, tvb, dl_map_offset, bit_map_length + 1, ENC_NA);
length += (1 + bit_map_length * 2);
}
else
{
/* display the DL-MAP type */
proto_tree_add_item(tree, hf_cdlmap_dl_map_type, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_cdlmap_reserved, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display BITMAP Length */
proto_tree_add_item(tree, hf_cdlmap_bit_map_length_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
length = 2;
/* get the bit map length */
bit_map_length = (byte & LSB_NIBBLE_MASK);
/* move to next byte */
dl_map_offset++;
/* display BITMAP */
proto_tree_add_item(tree, hf_cdlmap_bit_map, tvb, dl_map_offset, bit_map_length, ENC_NA);
length += (bit_map_length * 2);
}
break;
case COMPACT_DL_MAP_TYPE_EXTENSION:/* 6.3.2.3.43.6.6 */
/* decode the Compact DL-MAP externsion IE */
nibble_length = wimax_cdlmap_extension_ie_decoder(tree, pinfo, tvb, dl_map_offset, nibble_offset);/*, cqich_indicator);*/
length = nibble_length;
break;
default:/* Reserved Type */
/* display the reserved type */
proto_tree_add_item(tree, hf_cdlmap_reserved_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
length = 1;
break;
}
/* Update the nibble_offset and length */
return length;
}
/* Format Configuration IE shifts */
#define CID_TYPE_SHIFT 30
#define SAFETY_PATTERN_SHIFT 25
#define BAND_AMC_SUBCHANNEL_TYPE_SHIFT 23
#define MAX_LOGICAL_BANDS_SHIFT 21
#define NUM_BROADCAST_SYMBOLS_SHIFT 16
#define NUM_DL_AMC_SYMBOLS_SHIFT 10
#define NUM_UL_AMC_SYMBOLS_SHIFT 4
#define CID_TYPE_SHIFT_1 (CID_TYPE_SHIFT-NUM_UL_AMC_SYMBOLS_SHIFT)
#define SAFETY_PATTERN_SHIFT_1 (SAFETY_PATTERN_SHIFT-NUM_UL_AMC_SYMBOLS_SHIFT)
#define BAND_AMC_SUBCHANNEL_TYPE_SHIFT_1 (BAND_AMC_SUBCHANNEL_TYPE_SHIFT-NUM_UL_AMC_SYMBOLS_SHIFT)
#define MAX_LOGICAL_BANDS_SHIFT_1 (MAX_LOGICAL_BANDS_SHIFT-NUM_UL_AMC_SYMBOLS_SHIFT)
#define NUM_BROADCAST_SYMBOLS_SHIFT_1 (NUM_BROADCAST_SYMBOLS_SHIFT-NUM_UL_AMC_SYMBOLS_SHIFT)
#define NUM_DL_AMC_SYMBOLS_SHIFT_1 (NUM_DL_AMC_SYMBOLS_SHIFT-NUM_UL_AMC_SYMBOLS_SHIFT)
/*#define NUM_UL_AMC_SYMBOLS_SHIFT_1 0*/
/* Compact DL-MAP Format Configuration IE (6.3.2.3.43.2) decoder */
static guint wimax_compact_dlmap_format_configuration_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
guint length = 0;
guint dl_map_type, new_format_ind;
guint dl_map_offset;
guint32 tvb_value;
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Format Configuration IE");
#endif
/* set the local offset */
dl_map_offset = offset;
/* Get the first byte */
tvb_value = tvb_get_guint8(tvb, dl_map_offset);
if(nibble_offset & 1)
{ /* get the DL-MAP type */
dl_map_type = ((tvb_value & DL_MAP_TYPE_MASK_1) >> 1);
/* ensure the dl-map type is Format Configuration IE */
if(dl_map_type != COMPACT_DL_MAP_TYPE_FORMAT_CONF_IE)
return 0;
new_format_ind = (tvb_value & 0x01);
/* display the DL-MAP type */
proto_tree_add_item(tree, hf_format_config_ie_dl_map_type_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display the New format Indication */
proto_tree_add_item(tree, hf_format_config_ie_new_format_indication_1, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* update the length in nibble */
length = 1;
/* move to next byte */
dl_map_offset++;
if(new_format_ind)
{ /* display the CID Type */
proto_tree_add_item(tree, hf_format_config_ie_cid_type, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the Safety Pattern */
proto_tree_add_item(tree, hf_format_config_ie_safety_pattern, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the Subchannel pattern */
proto_tree_add_item(tree, hf_format_config_ie_subchannel_type, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the max logical bands */
proto_tree_add_item(tree, hf_format_config_ie_max_logical_bands, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the number of broadcast symbols */
proto_tree_add_item(tree, hf_format_config_ie_num_of_broadcast_symbol, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the number of dl band AMC symbols */
proto_tree_add_item(tree, hf_format_config_ie_num_of_dl_band_amc_symbol, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the number of ul band AMC symbols */
proto_tree_add_item(tree, hf_format_config_ie_num_of_ul_band_amc_symbol, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* update the length in nibble */
length += 7;
/* Get the next 32-bit word */
tvb_value = tvb_get_ntohl(tvb, dl_map_offset);
/* get the CID type */
cid_type = ((tvb_value & CID_TYPE_MASK) >> CID_TYPE_SHIFT);
/* get the subchannel type for band AMC */
band_amc_subchannel_type = ((tvb_value & BAND_AMC_SUBCHANNEL_TYPE_MASK) >> BAND_AMC_SUBCHANNEL_TYPE_SHIFT);
/* get the max logical bands */
max_logical_bands = ((tvb_value & MAX_LOGICAL_BANDS_MASK) >> MAX_LOGICAL_BANDS_SHIFT);
/* get the number of symbols for broadcast */
num_of_broadcast_symbols = ((tvb_value & NUM_BROADCAST_SYMBOLS_MASK) >> NUM_BROADCAST_SYMBOLS_SHIFT);
/* get the number of symbols for DL band AMC */
num_of_dl_band_amc_symbols = ((tvb_value & NUM_DL_AMC_SYMBOLS_MASK) >> NUM_DL_AMC_SYMBOLS_SHIFT);
/* get the number of symbols for UL band AMC */
num_of_ul_band_amc_symbols = ((tvb_value & NUM_UL_AMC_SYMBOLS_MASK) >> NUM_UL_AMC_SYMBOLS_SHIFT);
}
}
else
{
dl_map_type = ((tvb_value & DL_MAP_TYPE_MASK) >> 5);
/* ensure the dl-map type is Format Configuration IE */
if(dl_map_type != COMPACT_DL_MAP_TYPE_FORMAT_CONF_IE)
return 0;
new_format_ind = (tvb_value & 0x10);
if(new_format_ind)
{ /* display the DL-MAP type */
proto_tree_add_item(tree, hf_format_config_ie_dl_map_type_32, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the New format Indication */
proto_tree_add_item(tree, hf_format_config_ie_new_format_indication_32, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the CID Type */
proto_tree_add_item(tree, hf_format_config_ie_cid_type_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the Safety Pattern */
proto_tree_add_item(tree, hf_format_config_ie_safety_pattern_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the Subchannel pattern */
proto_tree_add_item(tree, hf_format_config_ie_subchannel_type_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the max logical bands */
proto_tree_add_item(tree, hf_format_config_ie_max_logical_bands_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the number of broadcast symbols */
proto_tree_add_item(tree, hf_format_config_ie_num_of_broadcast_symbol_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the number of dl band AMC symbols */
proto_tree_add_item(tree, hf_format_config_ie_num_of_dl_band_amc_symbol_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* display the number of ul band AMC symbols */
proto_tree_add_item(tree, hf_format_config_ie_num_of_ul_band_amc_symbol_1, tvb, dl_map_offset, 4, ENC_BIG_ENDIAN);
/* update the length in nibble */
length = 8;
/* Get the next 32-bit word */
tvb_value = tvb_get_ntohl(tvb, dl_map_offset);
/* get the CID type */
cid_type = ((tvb_value & CID_TYPE_MASK_1) >> CID_TYPE_SHIFT_1);
/* get the subchannel type for band AMC */
band_amc_subchannel_type = ((tvb_value & BAND_AMC_SUBCHANNEL_TYPE_MASK_1) >> BAND_AMC_SUBCHANNEL_TYPE_SHIFT_1);
/* get the max logical bands */
max_logical_bands = ((tvb_value & MAX_LOGICAL_BANDS_MASK_1) >> MAX_LOGICAL_BANDS_SHIFT_1);
/* get the number of symbols for broadcast */
num_of_broadcast_symbols = ((tvb_value & NUM_BROADCAST_SYMBOLS_MASK_1) >> NUM_BROADCAST_SYMBOLS_SHIFT_1);
/* get the number of symbols for DL band AMC */
num_of_dl_band_amc_symbols = ((tvb_value & NUM_DL_AMC_SYMBOLS_MASK_1) >> NUM_DL_AMC_SYMBOLS_SHIFT_1);
/* get the number of symbols for UL band AMC */
num_of_ul_band_amc_symbols = (tvb_value & NUM_UL_AMC_SYMBOLS_MASK_1);
}
else
{ /* display the DL-MAP type */
proto_tree_add_item(tree, hf_format_config_ie_dl_map_type, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* display the New format Indication */
proto_tree_add_item(tree, hf_format_config_ie_new_format_indication, tvb, dl_map_offset, 1, ENC_BIG_ENDIAN);
/* update the length in nibble */
length = 1;
}
}
/* return the IE length in nibbles */
return length;
}
/* Compact DL-MAP Reduced CID IE (6.3.2.3.43.3) decoder */
static guint wimax_compact_dlmap_rcid_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
guint length = 0;
guint prefix;
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RCID IE");
#endif
if(nibble_offset & 1)
{
if(cid_type == CID_TYPE_NORMAL)
{ /* display the normal CID */
proto_tree_add_item(tree, hf_harq_rcid_ie_normal_cid_1, tvb, offset, 3, ENC_BIG_ENDIAN);
length = 4;
}
else
{ /* Get the prefix bit */
prefix = (tvb_get_guint8(tvb, offset) & 0x08);
/* display the prefix */
proto_tree_add_item(tree, hf_harq_rcid_ie_prefix_1, tvb, offset, 2, ENC_BIG_ENDIAN);
if(prefix)
{ /* display the CID11 */
proto_tree_add_item(tree, hf_harq_rcid_ie_cid11_3, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 3;
}
else
{
if(cid_type == CID_TYPE_RCID11)
{ /* display the CID11 */
proto_tree_add_item(tree, hf_harq_rcid_ie_cid11_1, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 3;
}
else if(cid_type == CID_TYPE_RCID7)
{ /* display the normal CID7 */
proto_tree_add_item(tree, hf_harq_rcid_ie_cid7_1, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 2;
}
else if(cid_type == CID_TYPE_RCID3)
{ /* display the CID3 */
proto_tree_add_item(tree, hf_harq_rcid_ie_cid3_1, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 1;
}
}
}
}
else
{
if(cid_type == CID_TYPE_NORMAL)
{ /* display the normal CID */
proto_tree_add_item(tree, hf_harq_rcid_ie_normal_cid, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 4;
}
else
{ /* Get the prefix bit */
prefix = (tvb_get_guint8(tvb, offset) & 0x08);
/* display the prefix */
proto_tree_add_item(tree, hf_harq_rcid_ie_prefix, tvb, offset, 2, ENC_BIG_ENDIAN);
if(prefix || (cid_type == CID_TYPE_RCID11))
{ /* display the CID11 */
proto_tree_add_item(tree, hf_harq_rcid_ie_cid11_2, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 3;
}
else
{
if(cid_type == CID_TYPE_RCID11)
{ /* display the CID11 */
proto_tree_add_item(tree, hf_harq_rcid_ie_cid11, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 3;
}
else if(cid_type == CID_TYPE_RCID7)
{ /* display the CID7 */
proto_tree_add_item(tree, hf_harq_rcid_ie_cid7, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 2;
}
else if(cid_type == CID_TYPE_RCID3)
{ /* display the CID3 */
proto_tree_add_item(tree, hf_harq_rcid_ie_cid3, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 1;
}
}
}
}
/* return the IE length in nibbles */
return length;
}
/* Compact DL-MAP HARQ Control IE (6.3.2.3.43.4) decoder */
static guint wimax_compact_dlmap_harq_control_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
guint byte, prefix, length = 0;
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "HARQ Control IE");
#endif
/* Get the first byte */
byte = tvb_get_guint8(tvb, offset);
if(nibble_offset & 1)
{ /* Get the prefix bit */
prefix = (byte & 0x08);
/* display the prefix */
proto_tree_add_item(tree, hf_harq_control_ie_prefix_1, tvb, offset, 2, ENC_BIG_ENDIAN);
if(prefix)
{ /* display the ai_sn */
proto_tree_add_item(tree, hf_harq_control_ie_ai_sn_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the spid */
proto_tree_add_item(tree, hf_harq_control_ie_spid_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the acid */
proto_tree_add_item(tree, hf_harq_control_ie_acid_1, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 2;
}
else
{ /* display the reserved bits */
proto_tree_add_item(tree, hf_harq_control_ie_reserved_1, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 1;
}
}
else
{ /* Get the prefix bit */
prefix = (byte & 0x80);
/* display the prefix */
proto_tree_add_item(tree, hf_harq_control_ie_prefix, tvb, offset, 1, ENC_BIG_ENDIAN);
if(prefix)
{ /* display the ai_sn */
proto_tree_add_item(tree, hf_harq_control_ie_ai_sn, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the spid */
proto_tree_add_item(tree, hf_harq_control_ie_spid, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the acid */
proto_tree_add_item(tree, hf_harq_control_ie_acid, tvb, offset, 1, ENC_BIG_ENDIAN);
length = 2;
}
else
{ /* display the reserved bits */
proto_tree_add_item(tree, hf_harq_control_ie_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
length = 1;
}
}
/* return the IE length in nibbles */
return length;
}
/* Compact DL-MAP CQICH Control IE (6.3.2.3.43.5) decoder */
static guint wimax_compact_dlmap_cqich_control_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
guint byte, cqich_indicator, length = 0;
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CQICH Control IE");
#endif
/* Get the first byte */
byte = tvb_get_guint8(tvb, offset);
if(nibble_offset & 1)
{ /* Get the CQICH indicator */
cqich_indicator = (byte & 0x08);
if(cqich_indicator)
{ /* display the CQICH indicator */
proto_tree_add_item(tree, hf_cqich_control_ie_indicator_1, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the allocation index */
proto_tree_add_item(tree, hf_cqich_control_ie_alloc_id_1, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the period */
proto_tree_add_item(tree, hf_cqich_control_ie_period_1, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the frame offset */
proto_tree_add_item(tree, hf_cqich_control_ie_frame_offset_1, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the duration */
proto_tree_add_item(tree, hf_cqich_control_ie_duration_1, tvb, offset, 3, ENC_BIG_ENDIAN);
length = 4;
}
else
{ /* display the CQICH indicator */
proto_tree_add_item(tree, hf_cqich_control_ie_indicator_1, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the CQI reporting threshold */
proto_tree_add_item(tree, hf_cqich_control_ie_cqi_rep_threshold_1, tvb, offset, 1, ENC_BIG_ENDIAN);
length = 1;
}
}
else
{ /* Get the CQICH indicator */
cqich_indicator = (byte & 0x80);
if(cqich_indicator)
{ /* display the CQICH indicator */
proto_tree_add_item(tree, hf_cqich_control_ie_indicator, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the allocation index */
proto_tree_add_item(tree, hf_cqich_control_ie_alloc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the period */
proto_tree_add_item(tree, hf_cqich_control_ie_period, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the frame offset */
proto_tree_add_item(tree, hf_cqich_control_ie_frame_offset, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the duration */
proto_tree_add_item(tree, hf_cqich_control_ie_duration, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 4;
}
else
{ /* display the CQICH indicator */
proto_tree_add_item(tree, hf_cqich_control_ie_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the CQI reporting threshold */
proto_tree_add_item(tree, hf_cqich_control_ie_cqi_rep_threshold, tvb, offset, 1, ENC_BIG_ENDIAN);
length = 1;
}
}
/* return the IE length in nibbles */
return length;
}
/* DL-MAP Extension IE sub-types */
#define TIME_DIVERSITY_MBS 0
#define HARQ_MODE_SWITCH 1
/* Compact DL-MAP Extension IE (6.3.2.3.43.6.6) decoder */
static guint wimax_cdlmap_extension_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
guint tvb_value, dl_map_type, sub_type, length;
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "DL-MAP Extension IE");
#endif
/* Get the first 16-bit word */
tvb_value = tvb_get_ntohs(tvb, offset);
if(nibble_offset & 1)
{ /* Get the dl-map type */
dl_map_type = ((tvb_value & 0x0E00) >> 9);
if(dl_map_type != COMPACT_DL_MAP_TYPE_EXTENSION)
return 0;
/* Get the sub-type */
sub_type = ((tvb_value & 0x01F0) >> 4);
/* Get the IE length */
length = (tvb_value & 0x000F);
/* display the DL-MAP type */
proto_tree_add_item(tree, hf_cdlmap_extension_type_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the DL-MAP extension subtype */
proto_tree_add_item(tree, hf_cdlmap_extension_subtype_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the IE length */
proto_tree_add_item(tree, hf_cdlmap_extension_length_1, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
switch (sub_type)
{
case TIME_DIVERSITY_MBS:
/* display the time-diversity MBS in HEX */
proto_tree_add_item(tree, hf_cdlmap_extension_time_diversity_mbs_1, tvb, offset, (length - 2), ENC_NA);
break;
case HARQ_MODE_SWITCH:
/* display the HARQ mode */
proto_tree_add_item(tree, hf_cdlmap_extension_harq_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
/* Get the next byte */
tvb_value = tvb_get_guint8(tvb, offset);
/* get the HARQ mode */
harq_mode = ((tvb_value & MSB_NIBBLE_MASK) >> 4);
break;
default:
/* display the unknown sub-type in HEX */
proto_tree_add_item(tree, hf_cdlmap_extension_unknown_sub_type_1, tvb, offset, (length - 2), ENC_NA);
break;
}
}
else
{ /* Get the dl-map type */
dl_map_type = ((tvb_value & 0xE000) >> 13);
if(dl_map_type != COMPACT_DL_MAP_TYPE_EXTENSION)
return 0;
/* Get the sub-type */
sub_type = ((tvb_value & 0x1F00) >> 8);
/* Get the IE length */
length = ((tvb_value & 0x00F0) >> 4);
/* display the DL-MAP type */
proto_tree_add_item(tree, hf_cdlmap_extension_type, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the DL-MAP extension subtype */
proto_tree_add_item(tree, hf_cdlmap_extension_subtype, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the IE length */
proto_tree_add_item(tree, hf_cdlmap_extension_length, tvb, offset, 2, ENC_BIG_ENDIAN);
switch (sub_type)
{
case TIME_DIVERSITY_MBS:
/* display the time-diversity MBS in HEX */
proto_tree_add_item(tree, hf_cdlmap_extension_time_diversity_mbs, tvb, (offset + 1), (length - 1), ENC_NA);
break;
case HARQ_MODE_SWITCH:
/* display the HARQ mode */
proto_tree_add_item(tree, hf_cdlmap_extension_harq_mode_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* get the HARQ mode */
harq_mode = (tvb_value & 0x000F);
break;
default:
/* display the unknown sub-type in HEX */
proto_tree_add_item(tree, hf_cdlmap_extension_unknown_sub_type, tvb, (offset + 1), (length - 1), ENC_NA);
break;
}
}
/* return the IE length in nibbles */
return (length * 2);
}
/* Extended DIUCs (table 277a) */
#define CHANNEL_MEASUREMENT_IE 0
#define STC_ZONE_IE 1
#define AAS_DL_IE 2
#define DATA_LOCATION_IN_ANOTHER_BS_IE 3
#define CID_SWITCH_IE 4
#define MIMO_DL_BASIC_IE 5
#define MIMO_DL_ENHANCED_IE 6
#define HARQ_MAP_POINTER_IE 7
#define PHYMOD_DL_IE 8
#define DL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE 11
#define UL_INTERFERENCE_AND_NOISE_LEVEL_IE 15
/* Extended DIUC IE (8.4.5.3.2) */
guint wimax_extended_diuc_dependent_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
guint ext_diuc, length;
guint8 byte;
/* get the first byte */
byte = tvb_get_guint8(tvb, offset);
if(nibble_offset & 1)
{ /* get the extended DIUC */
ext_diuc = (byte & LSB_NIBBLE_MASK);
/* display extended DIUC */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_diuc_1, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
offset++;
/* get the 2nd byte */
byte = tvb_get_guint8(tvb, offset);
/* get the length */
length = ((byte & MSB_NIBBLE_MASK) >> 4);
/* display extended DIUC length */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
/* 8.4.5.3.2.1 (table 277a) */
switch (ext_diuc)
{
case CHANNEL_MEASUREMENT_IE:
/* 8.4.5.3.? Channel_Measurement_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_channel_measurement, tvb, offset, (length + 1), ENC_NA);
break;
case STC_ZONE_IE:
/* 8.4.5.3.4 STC_Zone_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_stc_zone, tvb, offset, (length + 1), ENC_NA);
break;
case AAS_DL_IE:
/* 8.4.5.3.3 AAS_DL_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_aas_dl, tvb, offset, (length + 1), ENC_NA);
break;
case DATA_LOCATION_IN_ANOTHER_BS_IE:
/* 8.4.5.3.6 Data_location_in_another_BS_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_data_location, tvb, offset, (length + 1), ENC_NA);
break;
case CID_SWITCH_IE:
/* 8.4.5.3.7 CID_Switch_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_cid_switch, tvb, offset, (length + 1), ENC_NA);
break;
case MIMO_DL_BASIC_IE:
/* 8.4.5.3.8 MIMO_DL_Basic_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_basic, tvb, offset, (length + 1), ENC_NA);
break;
case MIMO_DL_ENHANCED_IE:
/* 8.4.5.3.9 MIMO_DL_Enhanced_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_enhanced, tvb, offset, (length + 1), ENC_NA);
break;
case HARQ_MAP_POINTER_IE:
/* 8.4.5.3.10 HARQ_Map_Pointer_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_harq_map_pointer, tvb, offset, (length + 1), ENC_NA);
break;
case PHYMOD_DL_IE:
/* 8.4.5.3.11 PHYMOD_DL_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_phymod_dl, tvb, offset, (length + 1), ENC_NA);
break;
case DL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE:
/* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation, tvb, offset, (length + 1), ENC_NA);
break;
case UL_INTERFERENCE_AND_NOISE_LEVEL_IE:
/* 8.4.5.3.19 UL_interference_and_noise_level_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_ul_interference_and_noise_level, tvb, offset, (length + 1), ENC_NA);
break;
default:
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_unknown_diuc, tvb, offset, (length + 1), ENC_NA);
break;
}
}
else
{ /* get the extended DIUC */
ext_diuc = ((byte & MSB_NIBBLE_MASK) >> 4);
/* get the length */
length = (byte & LSB_NIBBLE_MASK);
/* display extended DIUC */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_diuc, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display extended DIUC length */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_length_1, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
offset++;
/* 8.4.5.3.2.1 (table 277a) */
switch (ext_diuc)
{
case CHANNEL_MEASUREMENT_IE:
/* 8.4.5.3.? Channel_Measurement_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_channel_measurement, tvb, offset, length, ENC_NA);
break;
case STC_ZONE_IE:
/* 8.4.5.3.4 STC_Zone_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_stc_zone, tvb, offset, length, ENC_NA);
break;
case AAS_DL_IE:
/* 8.4.5.3.3 AAS_DL_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_aas_dl, tvb, offset, length, ENC_NA);
break;
case DATA_LOCATION_IN_ANOTHER_BS_IE:
/* 8.4.5.3.6 Data_location_in_another_BS_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_data_location, tvb, offset, length, ENC_NA);
break;
case CID_SWITCH_IE:
/* 8.4.5.3.7 CID_Switch_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_cid_switch, tvb, offset, length, ENC_NA);
break;
case MIMO_DL_BASIC_IE:
/* 8.4.5.3.8 MIMO_DL_Basic_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_basic, tvb, offset, length, ENC_NA);
break;
case MIMO_DL_ENHANCED_IE:
/* 8.4.5.3.9 MIMO_DL_Enhanced_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_mimo_dl_enhanced, tvb, offset, length, ENC_NA);
break;
case HARQ_MAP_POINTER_IE:
/* 8.4.5.3.10 HARQ_Map_Pointer_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_harq_map_pointer, tvb, offset, length, ENC_NA);
break;
case PHYMOD_DL_IE:
/* 8.4.5.3.11 PHYMOD_DL_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_phymod_dl, tvb, offset, length, ENC_NA);
break;
case DL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE:
/* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_dl_pusc_burst_allocation, tvb, offset, length, ENC_NA);
break;
case UL_INTERFERENCE_AND_NOISE_LEVEL_IE:
/* 8.4.5.3.19 UL_interference_and_noise_level_IE */
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_ul_interference_and_noise_level, tvb, offset, length, ENC_NA);
break;
default:
proto_tree_add_item(tree, hf_extended_diuc_dependent_ie_unknown_diuc, tvb, offset, length, ENC_NA);
break;
}
}
return ((length + 1) * 2 ); /* length in nibbles */
}
/* Register Wimax Compact DL-MAP IE Protocol */
void wimax_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}
},
#if 0
{
&hf_cdlmap_reserved_type,
{"DL-MAP Reserved Type", "wmx.compact_dlmap.reserved_type", FT_UINT8, BASE_DEC, NULL, DL_MAP_TYPE_MASK, NULL, HFILL}
},
#endif
{
&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));
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C/C++ | wireshark/plugins/epan/wimax/wimax_compact_dlmap_ie_decoder.h | /* wimax_compact_dlmap_ie_decoder.h
* Declarations of routines exported by WiMax HARQ Map Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _WIMAX_COMPACT_DLMAP_IE_DECODER_H_
#define _WIMAX_COMPACT_DLMAP_IE_DECODER_H_
extern guint wimax_compact_dlmap_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
#endif /* _WIMAX_COMPACT_DLMAP_IE_DECODER_H_ */ |
C | wireshark/plugins/epan/wimax/wimax_compact_ulmap_ie_decoder.c | /* wimax_compact_ulmap_ie_decoder.c
* WiMax Compact UL-MAP IE decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax-int.h"
#include "wimax_compact_ulmap_ie_decoder.h"
/* MASKs */
#define MSB_NIBBLE_MASK 0xF0
#define LSB_NIBBLE_MASK 0x0F
#define CID_TYPE_NORMAL 0
#define CID_TYPE_RCID11 1
#define CID_TYPE_RCID7 2
#define CID_TYPE_RCID3 3
/* Global Variables */
extern guint cid_type;
extern guint band_amc_subchannel_type;
extern guint max_logical_bands;
extern guint num_of_broadcast_symbols;
extern guint num_of_dl_band_amc_symbols;
extern guint num_of_ul_band_amc_symbols;
extern guint harq_mode;
extern gint proto_wimax;
/* forward reference */
guint wimax_cdma_allocation_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
guint wimax_extended_uiuc_dependent_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
static guint wimax_compact_ulmap_rcid_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
static guint wimax_compact_ulmap_harq_control_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
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;
#endif
/* Prefixes */
static const true_false_string tfs_prefix =
{
"Enable HARQ",
"Temporary Disable HARQ"
};
/* Region Changes */
static const true_false_string tfs_region_change =
{
"Region Changed",
"No Region Change"
};
/* Region Changes */
static const true_false_string tfs_yes_no_ie =
{
"Yes",
"No"
};
/* Repetition Coding Indications */
static const value_string vals_repetitions[] =
{
{ 0, "No Repetition Coding" },
{ 1, "Repetition Coding of 2 Used" },
{ 2, "Repetition Coding of 4 Used" },
{ 3, "Repetition Coding of 6 Used" },
{ 0, NULL }
};
/* Allocation Modes */
static const value_string vals_allocation_modes[] =
{
{ 0, "Same Number Of Subchannels For The Selected Bands" },
{ 1, "Different Same Number Of Subchannels For The Selected Bands" },
{ 2, "Total Number Of Subchannels For The Selected Bands Determined by Nsch Code and Nep Code" },
{ 3, "Reserved" },
{ 0, NULL }
};
/* CTypes */
static const value_string vals_ctypes[] =
{
{ 0, "2 Mini-subchannels (defines M=2)" },
{ 1, "2 Mini-subchannels (defines M=2)" },
{ 2, "3 Mini-subchannels (defines M=3)" },
{ 3, "6 Mini-subchannels (defines M=6)" },
{ 0, NULL }
};
/* Masks */
#define UL_MAP_TYPE_MASK 0xE0
#define UL_MAP_RESERVED_MASK 0x10
#define SHORTENED_UIUC_MASK 0xE0
#define COMPANDED_SC_MASK 0x1F
#define UL_MAP_TYPE_MASK_1 0x0E
#define UL_MAP_RESERVED_MASK_1 0x01
#define SHORTENED_UIUC_MASK_1 0x0E00
#define COMPANDED_SC_MASK_1 0x01F0
#define MIDDLE_BYTE_MASK 0x0FF0
#define ALLOCATION_MODE_MASK 0xC0
#define ALLOCATION_MODE_MASK_1 0x0C
/* display indexies */
static gint hf_culmap_ul_map_type = -1;
static gint hf_culmap_reserved = -1;
static gint hf_culmap_nep_code = -1;
static gint hf_culmap_nsch_code = -1;
static gint hf_culmap_num_bands = -1;
static gint hf_culmap_band_index = -1;
static gint hf_culmap_nb_bitmap = -1;
static gint hf_culmap_ul_map_type_1 = -1;
static gint hf_culmap_reserved_1 = -1;
static gint hf_culmap_nep_code_1 = -1;
static gint hf_culmap_nsch_code_1 = -1;
static gint hf_culmap_num_bands_1 = -1;
/*static gint hf_culmap_band_index_1 = -1;*/
static gint hf_culmap_nb_bitmap_1 = -1;
static gint hf_culmap_shortened_uiuc = -1;
static gint hf_culmap_companded_sc = -1;
static gint hf_culmap_shortened_uiuc_1 = -1;
static gint hf_culmap_companded_sc_1 = -1;
static gint hf_culmap_bin_offset = -1;
static gint hf_culmap_bin_offset_1 = -1;
static gint hf_culmap_uiuc_ofdma_symbol_offset = -1;
static gint hf_culmap_uiuc_ofdma_symbol_offset_1 = -1;
static gint hf_culmap_uiuc_subchannel_offset_7 = -1;
static gint hf_culmap_uiuc_num_of_ofdma_symbols_7 = -1;
static gint hf_culmap_uiuc_num_of_subchannels_7 = -1;
static gint hf_culmap_uiuc_ranging_method = -1;
static gint hf_culmap_uiuc_reserved = -1;
static gint hf_culmap_uiuc_subchannel_offset_7_1 = -1;
static gint hf_culmap_uiuc_num_of_ofdma_symbols_7_1 = -1;
static gint hf_culmap_uiuc_num_of_subchannels_7_1 = -1;
static gint hf_culmap_uiuc_ranging_method_1 = -1;
static gint hf_culmap_uiuc_reserved_1 = -1;
static gint hf_culmap_uiuc_repetition_coding_indication = -1;
static gint hf_culmap_uiuc_repetition_coding_indication_1 = -1;
/* static gint hf_culmap_uiuc_reserved1 = -1; */
/* static gint hf_culmap_uiuc_reserved11_1 = -1; */
static gint hf_culmap_uiuc_subchannel_offset = -1;
static gint hf_culmap_uiuc_subchannel_offset_1 = -1;
static gint hf_culmap_uiuc_num_of_ofdma_symbols = -1;
static gint hf_culmap_uiuc_num_of_ofdma_symbols_1 = -1;
static gint hf_culmap_uiuc_num_of_subchannels = -1;
static gint hf_culmap_uiuc_num_of_subchannels_1 = -1;
static gint hf_culmap_harq_region_change_indication = -1;
static gint hf_culmap_harq_region_change_indication_1 = -1;
static gint hf_culmap_cqi_region_change_indication = -1;
static gint hf_culmap_cqi_region_change_indication_1 = -1;
static gint hf_culmap_uiuc = -1;
static gint hf_culmap_uiuc_1 = -1;
static gint hf_culmap_allocation_mode = -1;
static gint hf_culmap_allocation_mode_rsvd = -1;
static gint hf_culmap_num_subchannels = -1;
static gint hf_culmap_allocation_mode_1 = -1;
static gint hf_culmap_allocation_mode_rsvd_1 = -1;
static gint hf_culmap_num_subchannels_1 = -1;
/* static gint hf_culmap_reserved_type = -1; */
static gint hf_culmap_reserved_type_1 = -1;
/* display indexies */
static gint hf_rcid_ie_prefix = -1;
static gint hf_rcid_ie_prefix_1 = -1;
static gint hf_rcid_ie_normal_cid = -1;
static gint hf_rcid_ie_normal_cid_1 = -1;
static gint hf_rcid_ie_cid3 = -1;
static gint hf_rcid_ie_cid3_1 = -1;
static gint hf_rcid_ie_cid7 = -1;
static gint hf_rcid_ie_cid7_1 = -1;
static gint hf_rcid_ie_cid11 = -1;
static gint hf_rcid_ie_cid11_1 = -1;
static gint hf_rcid_ie_cid11_2 = -1;
static gint hf_rcid_ie_cid11_3 = -1;
/* Masks */
#define WIMAX_RCID_IE_NORMAL_CID_MASK_1 0x0FFFF0
#define WIMAX_RCID_IE_PREFIX_MASK 0x8000
#define WIMAX_RCID_IE_PREFIX_MASK_1 0x0800
#define WIMAX_RCID_IE_CID3_MASK 0x7000
#define WIMAX_RCID_IE_CID3_MASK_1 0x0700
#define WIMAX_RCID_IE_CID7_MASK 0x7F00
#define WIMAX_RCID_IE_CID7_MASK_1 0x07F0
#define WIMAX_RCID_IE_CID11_MASK 0x7FF0
#define WIMAX_RCID_IE_CID11_MASK_1 0x07FF
/* HARQ MAP HARQ Control IE display indexies */
static gint hf_harq_control_ie_prefix = -1;
static gint hf_harq_control_ie_ai_sn = -1;
static gint hf_harq_control_ie_spid = -1;
static gint hf_harq_control_ie_acid = -1;
static gint hf_harq_control_ie_reserved = -1;
static gint hf_harq_control_ie_prefix_1 = -1;
static gint hf_harq_control_ie_ai_sn_1 = -1;
static gint hf_harq_control_ie_spid_1 = -1;
static gint hf_harq_control_ie_acid_1 = -1;
static gint hf_harq_control_ie_reserved_1 = -1;
/* Masks */
#define WIMAX_HARQ_CONTROL_IE_PREFIX_MASK 0x80
#define WIMAX_HARQ_CONTROL_IE_AI_SN_MASK 0x40
#define WIMAX_HARQ_CONTROL_IE_SPID_MASK 0x30
#define WIMAX_HARQ_CONTROL_IE_ACID_MASK 0x0F
#define WIMAX_HARQ_CONTROL_IE_RESERVED_MASK 0x70
#define WIMAX_HARQ_CONTROL_IE_PREFIX_MASK_1 0x0800
#define WIMAX_HARQ_CONTROL_IE_AI_SN_MASK_1 0x0400
#define WIMAX_HARQ_CONTROL_IE_SPID_MASK_1 0x0300
#define WIMAX_HARQ_CONTROL_IE_ACID_MASK_1 0x00F0
#define WIMAX_HARQ_CONTROL_IE_RESERVED_MASK_1 0x0700
/* Extension Type */
#define EXTENSION_TYPE_MASK 0xE000
#define EXTENSION_TYPE_MASK_1 0x0E00
#define EXTENSION_SUBTYPE_MASK 0x1F00
#define EXTENSION_SUBTYPE_MASK_1 0x01F0
#define EXTENSION_LENGTH_MASK 0x00F0
#define EXTENSION_LENGTH_MASK_1 0x000F
static gint hf_culmap_extension_type = -1;
static gint hf_culmap_extension_subtype = -1;
static gint hf_culmap_extension_length = -1;
static gint hf_culmap_extension_type_1 = -1;
static gint hf_culmap_extension_subtype_1 = -1;
static gint hf_culmap_extension_length_1 = -1;
/* static gint hf_culmap_extension_time_diversity_mbs = -1; */
static gint hf_culmap_extension_harq_mode = -1;
static gint hf_culmap_extension_unknown_sub_type = -1;
/* static gint hf_culmap_extension_time_diversity_mbs_1 = -1; */
static gint hf_culmap_extension_harq_mode_1 = -1;
static gint hf_culmap_extension_unknown_sub_type_1 = -1;
/* UL-MAP CDMA Allocation IE */
#define CDMA_ALLOCATION_DURATION_MASK 0xFC00
#define CDMA_ALLOCATION_UIUC_MASK 0x03C0
#define CDMA_ALLOCATION_REPETITION_CODE_MASK 0x0030
#define CDMA_ALLOCATION_FRAME_NUMBER_INDEX_MASK 0x000F
#define CDMA_ALLOCATION_RANGING_SUBCHANNEL_MASK 0xFE
#define CDMA_ALLOCATION_BW_REQUEST_MANDATORY_MASK 0x01
#define CDMA_ALLOCATION_DURATION_MASK_1 0x0FC0
#define CDMA_ALLOCATION_UIUC_MASK_1 0x003C
#define CDMA_ALLOCATION_REPETITION_CODE_MASK_1 0x0003
#define CDMA_ALLOCATION_FRAME_NUMBER_INDEX_MASK_1 0xF0000000
#define CDMA_ALLOCATION_RANGING_CODE_MASK_1 0x0FF00000
#define CDMA_ALLOCATION_RANGING_SYMBOL_MASK_1 0x000FF000
#define CDMA_ALLOCATION_RANGING_SUBCHANNEL_MASK_1 0x00000FE0
#define CDMA_ALLOCATION_BW_REQUEST_MANDATORY_MASK_1 0x00000010
static gint hf_cdma_allocation_duration = -1;
static gint hf_cdma_allocation_uiuc = -1;
static gint hf_cdma_allocation_repetition = -1;
static gint hf_cdma_allocation_frame_number_index = -1;
static gint hf_cdma_allocation_ranging_code = -1;
static gint hf_cdma_allocation_ranging_symbol = -1;
static gint hf_cdma_allocation_ranging_subchannel = -1;
static gint hf_cdma_allocation_bw_req = -1;
static gint hf_cdma_allocation_duration_1 = -1;
static gint hf_cdma_allocation_uiuc_1 = -1;
static gint hf_cdma_allocation_repetition_1 = -1;
static gint hf_cdma_allocation_frame_number_index_1 = -1;
static gint hf_cdma_allocation_ranging_code_1 = -1;
static gint hf_cdma_allocation_ranging_symbol_1 = -1;
static gint hf_cdma_allocation_ranging_subchannel_1 = -1;
static gint hf_cdma_allocation_bw_req_1 = -1;
/* UL-MAP Extended UIUCs (table 290a) */
#define MINI_SUBCHANNEL_CTYPE_MASK 0xC0
#define MINI_SUBCHANNEL_CTYPE_MASK_16 0x0C00
#define MINI_SUBCHANNEL_DURATION_MASK 0x3F
#define MINI_SUBCHANNEL_DURATION_MASK_16 0x03F0
#define MINI_SUBCHANNEL_CID_MASK 0xFFFF00
#define MINI_SUBCHANNEL_UIUC_MASK 0x0000F0
#define MINI_SUBCHANNEL_REPETITION_MASK 0x00000C
#define MINI_SUBCHANNEL_CID_MASK_1 0x0FFFF000
#define MINI_SUBCHANNEL_UIUC_MASK_1 0x00000F00
#define MINI_SUBCHANNEL_REPETITION_MASK_1 0x000000C0
#define MINI_SUBCHANNEL_CID_MASK_2 0x03FFFF00
#define MINI_SUBCHANNEL_UIUC_MASK_2 0x000000F0
#define MINI_SUBCHANNEL_REPETITION_MASK_2 0x0000000C
#define MINI_SUBCHANNEL_CID_MASK_3 0x3FFFF000
#define MINI_SUBCHANNEL_UIUC_MASK_3 0x00000F00
#define MINI_SUBCHANNEL_REPETITION_MASK_3 0x000000C0
#define MINI_SUBCHANNEL_PADDING_MASK 0xF0
#define MINI_SUBCHANNEL_PADDING_MASK_1 0x0000000F
static gint hf_extended_uiuc_ie_uiuc = -1;
static gint hf_extended_uiuc_ie_length = -1;
static gint hf_extended_uiuc_ie_uiuc_1 = -1;
static gint hf_extended_uiuc_ie_length_1 = -1;
static gint hf_extended_uiuc_ie_power_control = -1;
static gint hf_extended_uiuc_ie_power_measurement_frame = -1;
static gint hf_extended_uiuc_ie_power_control_24 = -1;
static gint hf_extended_uiuc_ie_power_measurement_frame_24 = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_ctype = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_duration = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_ctype_16 = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_duration_16 = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_cid = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_repetition = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_padding = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_cid_1 = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc_1 = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_repetition_1 = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_cid_2 = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc_2 = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_repetition_2 = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_cid_3 = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc_3 = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_repetition_3 = -1;
static gint hf_extended_uiuc_ie_mini_subchannel_alloc_padding_1 = -1;
static gint hf_extended_uiuc_ie_aas_ul = -1;
static gint hf_extended_uiuc_ie_cqich_alloc = -1;
static gint hf_extended_uiuc_ie_ul_zone = -1;
static gint hf_extended_uiuc_ie_phymod_ul = -1;
static gint hf_extended_uiuc_ie_mimo_ul_basic = -1;
static gint hf_extended_uiuc_ie_fast_tracking = -1;
static gint hf_extended_uiuc_ie_ul_pusc_burst_allocation = -1;
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;
/* Compact UL-MAP IE Types (table 90) */
#define COMPACT_UL_MAP_TYPE_NORMAL_SUBCHANNEL 0
#define COMPACT_UL_MAP_TYPE_BAND_AMC 1
#define COMPACT_UL_MAP_TYPE_SAFETY 2
#define COMPACT_UL_MAP_TYPE_UIUC 3
#define COMPACT_UL_MAP_TYPE_HARQ_REGION_IE 4
#define COMPACT_UL_MAP_TYPE_CQICH_REGION_IE 5
#define COMPACT_UL_MAP_TYPE_RESERVED 6
#define COMPACT_UL_MAP_TYPE_EXTENSION 7
/* Compact UL-MAP IE decoder */
guint wimax_compact_ulmap_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
guint uiuc, byte, length = 0;
guint ul_map_type;
guint harq_region_change_indication;
guint cqi_region_change_indication;
guint ul_map_offset, nibble_length;
guint nband, band_count, i, allocation_mode;
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compact UL-MAP IEs");
#endif
/* set the local offset */
ul_map_offset = offset;
/* Get the first byte */
byte = tvb_get_guint8(tvb, ul_map_offset);
/* get the ul-map type */
if(nibble_offset & 1)
{
ul_map_type = ((byte & UL_MAP_TYPE_MASK_1) >> 1);
}
else
{
ul_map_type = ((byte & UL_MAP_TYPE_MASK) >> 5);
}
/* process the Compact UL-MAP IE (table 90) */
switch (ul_map_type)
{
case COMPACT_UL_MAP_TYPE_NORMAL_SUBCHANNEL:/* 6.3.2.3.43.7.1 */
/* display the UL-MAP type and reserved bit */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_culmap_reserved_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
nibble_offset = 0;
}
else
{
proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_culmap_reserved, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
}
length = 1;
/* decode RCID IE */
nibble_length = wimax_compact_ulmap_rcid_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);
length += nibble_length;
ul_map_offset += (nibble_length >> 1);
nibble_offset = (nibble_length & 1);
/* check harq mode */
if(!harq_mode)
{ /* display the Nep and Nsch Code */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_nep_code_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
proto_tree_add_item(tree, hf_culmap_nsch_code, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_culmap_nep_code, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_nsch_code_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
}
length += 2;
}
else if(harq_mode == 1)
{ /* display the Shortened UIUC and Companded SC */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_shortened_uiuc_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_companded_sc_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_culmap_shortened_uiuc, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_companded_sc, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
}
/* move to next byte */
ul_map_offset++;
length += 2;
}
/* decode HARQ Control IE */
nibble_length = wimax_compact_ulmap_harq_control_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);
length += nibble_length;
break;
case COMPACT_UL_MAP_TYPE_BAND_AMC:/* 6.3.2.3.43.7.2 */
/* display the UL-MAP type and reserved bit */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_culmap_reserved_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
nibble_offset = 0;
}
else
{
proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_culmap_reserved, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
}
length = 1;
/* decode RCID IE */
nibble_length = wimax_compact_ulmap_rcid_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);
length += nibble_length;
ul_map_offset += (nibble_length >> 1);
nibble_offset = (nibble_length & 1);
/* check harq mode */
if(!harq_mode)
{ /* display the Nep and Nsch Code */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_nep_code_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
proto_tree_add_item(tree, hf_culmap_nsch_code, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_culmap_nep_code, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_nsch_code_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
}
length += 2;
}
else if(harq_mode == 1)
{ /* display the Shortened UIUC and Companded SC */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_shortened_uiuc_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_companded_sc_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_culmap_shortened_uiuc, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_companded_sc, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
}
/* move to next byte */
ul_map_offset++;
length += 2;
}
/* get the Nband */
if(max_logical_bands)
{ /* get and display the Nband */
nband = tvb_get_guint8(tvb, ul_map_offset);
length++;
if(nibble_offset & 1)
{
nband = (nband & LSB_NIBBLE_MASK);
/* display the Nband */
proto_tree_add_item(tree, hf_culmap_num_bands_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
nibble_offset = 0;
if(max_logical_bands == 3)
{
proto_tree_add_item(tree, hf_culmap_band_index, tvb, ul_map_offset, nband, ENC_NA);
length += (nband * 2);
/* update offset */
ul_map_offset += nband;
}
else
{
nibble_offset = (nband & 1);
proto_tree_add_item(tree, hf_culmap_band_index, tvb, ul_map_offset, ((nband >> 1) + nibble_offset), ENC_NA);
length += nband;
/* update offset */
ul_map_offset += (nband >> 1);
}
}
else
{
nband = ((nband & MSB_NIBBLE_MASK) >> 4);
/* display the Nband */
proto_tree_add_item(tree, hf_culmap_num_bands, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
if(max_logical_bands == 3)
{
proto_tree_add_item(tree, hf_culmap_band_index, tvb, ul_map_offset, (nband + nibble_offset), ENC_NA);
length += (nband * 2);
/* update offset */
ul_map_offset += nband;
}
else
{
proto_tree_add_item(tree, hf_culmap_band_index, tvb, ul_map_offset, ((nband >> 1) + nibble_offset), ENC_NA);
length += nband;
/* update offset */
ul_map_offset += ((nband + nibble_offset) >> 1);
if(nband & 1)
nibble_offset = 0;
}
}
band_count = nband;
}
else
{
band_count = 1;
/* display the Nb-BITMAP */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_nb_bitmap_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
nibble_offset = 0;
}
else
{
proto_tree_add_item(tree, hf_culmap_nb_bitmap, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
}
length++;
}
/* Get the Allocation Mode */
byte = tvb_get_guint8(tvb, ul_map_offset);
if(nibble_offset & 1)
{
allocation_mode = ((byte & ALLOCATION_MODE_MASK_1) >> 2);
proto_tree_add_item(tree, hf_culmap_allocation_mode_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_allocation_mode_rsvd_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 0;
ul_map_offset++;
}
else
{
allocation_mode = ((byte & ALLOCATION_MODE_MASK) >> 6);
proto_tree_add_item(tree, hf_culmap_allocation_mode, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_allocation_mode_rsvd, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
}
length++;
/* Decode Allocation Mode - need to be done */
if(!allocation_mode)
{
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_num_subchannels_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_culmap_num_subchannels, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
}
ul_map_offset++;
length += 2;
}
else if(allocation_mode == 1)
{
for(i=0; i<band_count; i++)
{
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_num_subchannels_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_culmap_num_subchannels, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
}
ul_map_offset++;
}
length += (band_count * 2);
}
/* decode HARQ Control IE */
nibble_length = wimax_compact_ulmap_harq_control_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);
length += nibble_length;
break;
case COMPACT_UL_MAP_TYPE_SAFETY:/* 6.3.2.3.43.7.3 */
/* display the UL-MAP type and reserved bit */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_culmap_reserved_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
nibble_offset = 0;
}
else
{
proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_culmap_reserved, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
}
length = 1;
/* decode RCID IE */
nibble_length = wimax_compact_ulmap_rcid_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);
length += nibble_length;
ul_map_offset += (nibble_length >> 1);
nibble_offset = (nibble_length & 1);
/* check harq mode */
if(!harq_mode)
{ /* display the Nep and Nsch Code */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_nep_code_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
proto_tree_add_item(tree, hf_culmap_nsch_code, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_culmap_nep_code, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_nsch_code_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
}
length += 2;
}
else if(harq_mode == 1)
{ /* display the Shortened UIUC and Companded SC */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_shortened_uiuc_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_companded_sc_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tree, hf_culmap_shortened_uiuc, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_companded_sc, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
}
/* move to next byte */
ul_map_offset++;
length += 2;
}
/* display BIN offset */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_bin_offset_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
}
else
{
proto_tree_add_item(tree, hf_culmap_bin_offset, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
}
length += 2;
/* decode HARQ Control IE */
nibble_length = wimax_compact_ulmap_harq_control_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);
length += nibble_length;
break;
case COMPACT_UL_MAP_TYPE_UIUC:/* 6.3.2.3.43.7.4 */
/* display the UL-MAP type and reserved bit */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_culmap_reserved_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
ul_map_offset++;
/* get the new byte */
byte = tvb_get_guint8(tvb, ul_map_offset);
/* get the UIUC */
uiuc = ((byte & MSB_NIBBLE_MASK) >> 4);
/* display the UIUC */
proto_tree_add_item(tree, hf_culmap_uiuc, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
}
else
{
/* display the UL-MAP type */
proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_culmap_reserved, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* get the UIUC */
uiuc = (byte & LSB_NIBBLE_MASK);
/* display the UIUC */
proto_tree_add_item(tree, hf_culmap_uiuc_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
}
length = 2;
/* decode RCID IE */
nibble_length = wimax_compact_ulmap_rcid_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);
length += nibble_length;
ul_map_offset += (nibble_length >> 1);
nibble_offset = (nibble_length & 1);
if(uiuc == 15)
{ /* Extended UIUC dependent IE */
nibble_length = wimax_extended_uiuc_dependent_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);
length += nibble_length;
ul_map_offset += (nibble_length >> 1);
nibble_offset = (nibble_length & 1);
}
else if(uiuc == 14)
{ /* CDMA Allocation IE */
nibble_length = wimax_cdma_allocation_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);
length += nibble_length;
ul_map_offset += (nibble_length >> 1);
nibble_offset = (nibble_length & 1);
}
else if(uiuc == 12)
{
if(nibble_offset & 1)
{
/* display the OFDMA symbol offset */
proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the subchannel offset */
proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset_7_1, tvb, ul_map_offset, 4, ENC_BIG_ENDIAN);
/* display the number of OFDMA symbols */
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols_7_1, tvb, ul_map_offset, 4, ENC_BIG_ENDIAN);
/* display the number of subchannels */
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_7_1, tvb, ul_map_offset, 4, ENC_BIG_ENDIAN);
/* display the ranging method */
proto_tree_add_item(tree, hf_culmap_uiuc_ranging_method_1, tvb, ul_map_offset, 4, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_culmap_uiuc_reserved_1, tvb, ul_map_offset, 4, ENC_BIG_ENDIAN);
ul_map_offset += 3;
}
else
{ /* display the OFDMA symbol offset */
proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the subchannel offset */
proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset_7, tvb, ul_map_offset, 3, ENC_BIG_ENDIAN);
/* display the number of OFDMA symbols */
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols_7, tvb, ul_map_offset, 3, ENC_BIG_ENDIAN);
/* display the number of subchannels */
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_7, tvb, ul_map_offset, 3, ENC_BIG_ENDIAN);
/* display the ranging method */
proto_tree_add_item(tree, hf_culmap_uiuc_ranging_method, tvb, ul_map_offset, 3, ENC_BIG_ENDIAN);
/* display the reserved */
proto_tree_add_item(tree, hf_culmap_uiuc_reserved, tvb, ul_map_offset, 3, ENC_BIG_ENDIAN);
ul_map_offset += 3;
}
length += 8;
}
else
{ /* display Number of subchannels */
if(nibble_offset & 1)
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
else
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
length += 2;
/* display the repetition coding indication and reserved bits */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_culmap_uiuc_repetition_coding_indication_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_uiuc_reserved_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 0;
}
else
{
proto_tree_add_item(tree, hf_culmap_uiuc_repetition_coding_indication, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_culmap_uiuc_reserved, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
nibble_offset = 1;
}
length += 1;
}
/* decode HARQ Control IE */
nibble_length = wimax_compact_ulmap_harq_control_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);
length += nibble_length;
break;
case COMPACT_UL_MAP_TYPE_HARQ_REGION_IE:/* 6.3.2.3.43.7.5 */
if(nibble_offset & 1)
{ /* display the UL-MAP type */
proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* display the HARQ Region Change Indication */
proto_tree_add_item(tree, hf_culmap_harq_region_change_indication_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* get the HARQ Region Change Indication */
harq_region_change_indication = (byte & 0x01);
/* move to next byte */
ul_map_offset++;
nibble_offset = 0;
}
else
{ /* display the UL-MAP type */
proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* display the HARQ Region Change Indication */
proto_tree_add_item(tree, hf_culmap_harq_region_change_indication, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* get the HARQ Region Change Indication */
harq_region_change_indication = (byte & 0x10);
nibble_offset = 1;
}
length = 1;
if(harq_region_change_indication == 1)
{
if(nibble_offset & 1)
{
/* display the OFDMA symbol offset */
proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the subchannel offset */
proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the number of OFDMA symbols */
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the number of subchannels */
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
ul_map_offset++;
}
else
{ /* display the OFDMA symbol offset */
proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the subchannel offset */
proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the number of OFDMA symbols */
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the number of subchannels */
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
ul_map_offset++;
}
length += 8;
}
break;
case COMPACT_UL_MAP_TYPE_CQICH_REGION_IE:/* 6.3.2.3.43.7.6 */
if(nibble_offset & 1)
{ /* display the UL-MAP type */
proto_tree_add_item(tree, hf_culmap_ul_map_type_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* display the CQI Region Change Indication */
proto_tree_add_item(tree, hf_culmap_cqi_region_change_indication_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* get the CQI Region Change Indication */
cqi_region_change_indication = (byte & 0x01);
/* move to next byte */
ul_map_offset++;
nibble_offset = 0;
}
else
{ /* display the UL-MAP type */
proto_tree_add_item(tree, hf_culmap_ul_map_type, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* display the CQI Region Change Indication */
proto_tree_add_item(tree, hf_culmap_cqi_region_change_indication, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
/* get the CQI Region Change Indication */
cqi_region_change_indication = (byte & 0x10);
nibble_offset = 1;
}
length = 1;
if(cqi_region_change_indication == 1)
{
if(nibble_offset & 1)
{
/* display the OFDMA symbol offset */
proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the subchannel offset */
proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the number of OFDMA symbols */
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the number of subchannels */
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels_1, tvb, ul_map_offset, 2, ENC_BIG_ENDIAN);
ul_map_offset++;
}
else
{ /* display the OFDMA symbol offset */
proto_tree_add_item(tree, hf_culmap_uiuc_ofdma_symbol_offset, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the subchannel offset */
proto_tree_add_item(tree, hf_culmap_uiuc_subchannel_offset, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the number of OFDMA symbols */
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_ofdma_symbols, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
ul_map_offset++;
/* display the number of subchannels */
proto_tree_add_item(tree, hf_culmap_uiuc_num_of_subchannels, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
ul_map_offset++;
}
length += 8;
}
break;
case COMPACT_UL_MAP_TYPE_EXTENSION:/* 6.3.2.3.43.7.7 */
/* decode the Compact UL-MAP externsion IE */
nibble_length = wimax_culmap_extension_ie_decoder(tree, pinfo, tvb, ul_map_offset, nibble_offset);/*, cqich_indicator);*/
length = nibble_length;
break;
default:/* Reserved Type */
/* display the reserved type */
proto_tree_add_item(tree, hf_culmap_reserved_type_1, tvb, ul_map_offset, 1, ENC_BIG_ENDIAN);
length = 1;
break;
}
/* Update the nibble_offset and length */
return length;
}
/* Compact UL-MAP Reduced CID IE (6.3.2.3.43.3) decoder */
static guint wimax_compact_ulmap_rcid_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
guint length = 0;
guint prefix;
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RCID IE");
#endif
if(nibble_offset & 1)
{
if(cid_type == CID_TYPE_NORMAL)
{ /* display the normal CID */
proto_tree_add_item(tree, hf_rcid_ie_normal_cid_1, tvb, offset, 3, ENC_BIG_ENDIAN);
length = 4;
}
else
{ /* Get the prefix bit */
prefix = (tvb_get_guint8(tvb, offset) & 0x08);
/* display the prefix */
proto_tree_add_item(tree, hf_rcid_ie_prefix_1, tvb, offset, 2, ENC_BIG_ENDIAN);
if(prefix)
{ /* display the CID11 */
proto_tree_add_item(tree, hf_rcid_ie_cid11_3, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 3;
}
else
{
if(cid_type == CID_TYPE_RCID11)
{ /* display the CID11 */
proto_tree_add_item(tree, hf_rcid_ie_cid11_1, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 3;
}
else if(cid_type == CID_TYPE_RCID7)
{ /* display the normal CID7 */
proto_tree_add_item(tree, hf_rcid_ie_cid7_1, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 2;
}
else if(cid_type == CID_TYPE_RCID3)
{ /* display the CID3 */
proto_tree_add_item(tree, hf_rcid_ie_cid3_1, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 1;
}
}
}
}
else
{
if(cid_type == CID_TYPE_NORMAL)
{ /* display the normal CID */
proto_tree_add_item(tree, hf_rcid_ie_normal_cid, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 4;
}
else
{ /* Get the prefix bit */
prefix = (tvb_get_guint8(tvb, offset) & 0x08);
/* display the prefix */
proto_tree_add_item(tree, hf_rcid_ie_prefix, tvb, offset, 2, ENC_BIG_ENDIAN);
if(prefix || (cid_type == CID_TYPE_RCID11))
{ /* display the CID11 */
proto_tree_add_item(tree, hf_rcid_ie_cid11_2, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 3;
}
else
{
if(cid_type == CID_TYPE_RCID11)
{ /* display the CID11 */
proto_tree_add_item(tree, hf_rcid_ie_cid11, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 3;
}
else if(cid_type == CID_TYPE_RCID7)
{ /* display the CID7 */
proto_tree_add_item(tree, hf_rcid_ie_cid7, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 2;
}
else if(cid_type == CID_TYPE_RCID3)
{ /* display the CID3 */
proto_tree_add_item(tree, hf_rcid_ie_cid3, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 1;
}
}
}
}
/* return the IE length in nibbles */
return length;
}
/* Compact UL-MAP HARQ Control IE (6.3.2.3.43.4) decoder */
static guint wimax_compact_ulmap_harq_control_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
guint byte, prefix, length = 0;
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "HARQ Control IE");
#endif
/* Get the first byte */
byte = tvb_get_guint8(tvb, offset);
if(nibble_offset & 1)
{ /* Get the prefix bit */
prefix = (byte & 0x08);
/* display the prefix */
proto_tree_add_item(tree, hf_harq_control_ie_prefix_1, tvb, offset, 2, ENC_BIG_ENDIAN);
if(prefix)
{ /* display the ai_sn */
proto_tree_add_item(tree, hf_harq_control_ie_ai_sn_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the spid */
proto_tree_add_item(tree, hf_harq_control_ie_spid_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the acid */
proto_tree_add_item(tree, hf_harq_control_ie_acid_1, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 2;
}
else
{ /* display the reserved bits */
proto_tree_add_item(tree, hf_harq_control_ie_reserved_1, tvb, offset, 2, ENC_BIG_ENDIAN);
length = 1;
}
}
else
{ /* Get the prefix bit */
prefix = (byte & 0x80);
/* display the prefix */
proto_tree_add_item(tree, hf_harq_control_ie_prefix, tvb, offset, 1, ENC_BIG_ENDIAN);
if(prefix)
{ /* display the ai_sn */
proto_tree_add_item(tree, hf_harq_control_ie_ai_sn, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the spid */
proto_tree_add_item(tree, hf_harq_control_ie_spid, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the acid */
proto_tree_add_item(tree, hf_harq_control_ie_acid, tvb, offset, 1, ENC_BIG_ENDIAN);
length = 2;
}
else
{ /* display the reserved bits */
proto_tree_add_item(tree, hf_harq_control_ie_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
length = 1;
}
}
/* return the IE length in nibbles */
return length;
}
/* UL-MAP Extension IE sub-types */
#define HARQ_MODE_SWITCH 0
#define EXTENSION_TYPE_SHIFT 13
#define EXTENSION_TYPE_SHIFT_1 9
#define EXTENSION_SUBTYPE_SHIFT 8
#define EXTENSION_SUBTYPE_SHIFT_1 4
#define EXTENSION_LENGTH_SHIFT 4
/* Compact UL-MAP Extension IE (6.3.2.3.43.7.7) decoder */
static guint wimax_culmap_extension_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
guint tvb_value, ul_map_type, sub_type, length;
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "UL-MAP Extension IE");
#endif
/* Get the first 16-bit word */
tvb_value = tvb_get_ntohs(tvb, offset);
if(nibble_offset & 1)
{ /* Get the ul-map type */
ul_map_type = ((tvb_value & EXTENSION_TYPE_MASK_1) >> EXTENSION_TYPE_SHIFT_1);
if(ul_map_type != COMPACT_UL_MAP_TYPE_EXTENSION)
return 0;
/* Get the sub-type */
sub_type = ((tvb_value & EXTENSION_SUBTYPE_MASK_1) >> EXTENSION_SUBTYPE_SHIFT_1);
/* Get the IE length */
length = (tvb_value & EXTENSION_LENGTH_MASK_1);
/* display the UL-MAP type */
proto_tree_add_item(tree, hf_culmap_extension_type_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the UL-MAP extension subtype */
proto_tree_add_item(tree, hf_culmap_extension_subtype_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the IE length */
proto_tree_add_item(tree, hf_culmap_extension_length_1, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
switch (sub_type)
{
case HARQ_MODE_SWITCH:
/* display the HARQ mode */
proto_tree_add_item(tree, hf_culmap_extension_harq_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
/* Get the next byte */
tvb_value = tvb_get_guint8(tvb, offset);
/* get the HARQ mode */
harq_mode = ((tvb_value & MSB_NIBBLE_MASK) >> 4);
break;
default:
/* display the unknown sub-type in HEX */
proto_tree_add_item(tree, hf_culmap_extension_unknown_sub_type_1, tvb, offset, (length - 2), ENC_NA);
break;
}
}
else
{ /* Get the UL-MAp type */
ul_map_type = ((tvb_value & EXTENSION_TYPE_MASK) >> EXTENSION_TYPE_SHIFT);
if(ul_map_type != COMPACT_UL_MAP_TYPE_EXTENSION)
return 0;
/* Get the sub-type */
sub_type = ((tvb_value & EXTENSION_SUBTYPE_MASK) >> EXTENSION_SUBTYPE_SHIFT);
/* Get the IE length */
length = ((tvb_value & EXTENSION_LENGTH_MASK) >> EXTENSION_LENGTH_SHIFT);
/* display the UL-MAP type */
proto_tree_add_item(tree, hf_culmap_extension_type, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the UL-MAP extension subtype */
proto_tree_add_item(tree, hf_culmap_extension_subtype, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the IE length */
proto_tree_add_item(tree, hf_culmap_extension_length, tvb, offset, 2, ENC_BIG_ENDIAN);
switch (sub_type)
{
case HARQ_MODE_SWITCH:
/* display the HARQ mode */
proto_tree_add_item(tree, hf_culmap_extension_harq_mode_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* get the HARQ mode */
harq_mode = (tvb_value & LSB_NIBBLE_MASK);
break;
default:
/* display the unknown sub-type in HEX */
proto_tree_add_item(tree, hf_culmap_extension_unknown_sub_type, tvb, (offset + 1), (length - 1), ENC_NA);
break;
}
}
/* return the IE length in nibbles */
return (length * 2);
}
/* 8.4.5.4.3 (table 290) */
guint wimax_cdma_allocation_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CDMA Allocation IE");
#endif
if(nibble_offset & 1)
{ /* display the Duration */
proto_tree_add_item(tree, hf_cdma_allocation_duration_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the UIUC */
proto_tree_add_item(tree, hf_cdma_allocation_uiuc_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the Repetition Coding Indication */
proto_tree_add_item(tree, hf_cdma_allocation_repetition_1, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the frame number index */
proto_tree_add_item(tree, hf_cdma_allocation_frame_number_index_1, tvb, offset, 4, ENC_BIG_ENDIAN);
/* display the Ranging Code */
proto_tree_add_item(tree, hf_cdma_allocation_ranging_code_1, tvb, offset, 4, ENC_BIG_ENDIAN);
/* display the Ranging Symbol */
proto_tree_add_item(tree, hf_cdma_allocation_ranging_symbol_1, tvb, offset, 4, ENC_BIG_ENDIAN);
/* display the Ranging Subchannel */
proto_tree_add_item(tree, hf_cdma_allocation_ranging_subchannel_1, tvb, offset, 4, ENC_BIG_ENDIAN);
/* display the BW Request Mandatory */
proto_tree_add_item(tree, hf_cdma_allocation_bw_req_1, tvb, offset, 4, ENC_BIG_ENDIAN);
}
else
{ /* display the Duration */
proto_tree_add_item(tree, hf_cdma_allocation_duration, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the UIUC */
proto_tree_add_item(tree, hf_cdma_allocation_uiuc, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the Repetition Coding Indication */
proto_tree_add_item(tree, hf_cdma_allocation_repetition, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the frame number index */
proto_tree_add_item(tree, hf_cdma_allocation_frame_number_index, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display the Ranging Code */
proto_tree_add_item(tree, hf_cdma_allocation_ranging_code, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the Ranging Symbol */
proto_tree_add_item(tree, hf_cdma_allocation_ranging_symbol, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the Ranging Subchannel */
proto_tree_add_item(tree, hf_cdma_allocation_ranging_subchannel, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display the BW Request Mandatory */
proto_tree_add_item(tree, hf_cdma_allocation_bw_req, tvb, offset, 1, ENC_BIG_ENDIAN);
}
/* return the IE length in nibbles */
return 8;
}
/* Extended UIUCs (table 290a) */
#define POWER_CONTROL_IE 0
#define MINI_SUBCHANNEL_ALLOCATION_IE 1
#define AAS_UL_IE 2
#define CQICH_ALLOC_IE 3
#define UL_ZONE_IE 4
#define PHYMOD_UL_IE 5
#define MIMO_UL_BASIC_IE 6
#define UL_MAP_FAST_TRACKING_IE 7
#define UL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE 8
#define FAST_RANGING_IE 9
#define UL_ALLOCATION_START_IE 10
/* 8.4.5.4.4.1 (table 290b) */
guint wimax_extended_uiuc_dependent_ie_decoder(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, guint nibble_offset)
{
guint ext_uiuc, length, m, i;
guint8 byte;
#ifdef DEBUG
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Extended UIUC IE");
#endif
/* get the first byte */
byte = tvb_get_guint8(tvb, offset);
if(nibble_offset & 1)
{ /* get the extended UIUC */
ext_uiuc = (byte & LSB_NIBBLE_MASK);
/* display extended UIUC */
proto_tree_add_item(tree, hf_extended_uiuc_ie_uiuc_1, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
offset++;
/* get the 2nd byte */
byte = tvb_get_guint8(tvb, offset);
/* get the length */
length = ((byte & MSB_NIBBLE_MASK) >> 4);
/* display extended UIUC length */
proto_tree_add_item(tree, hf_extended_uiuc_ie_length_1, tvb, offset, 1, ENC_BIG_ENDIAN);
}
else
{ /* get the extended UIUC */
ext_uiuc = ((byte & MSB_NIBBLE_MASK) >> 4);
/* get the length */
length = (byte & LSB_NIBBLE_MASK);
/* display extended UIUC */
proto_tree_add_item(tree, hf_extended_uiuc_ie_uiuc, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display extended UIUC length */
proto_tree_add_item(tree, hf_extended_uiuc_ie_length, tvb, offset, 1, ENC_BIG_ENDIAN);
/* move to next byte */
offset++;
}
/* 8.4.5.4.4.1 (table 290b) */
switch (ext_uiuc)
{
case POWER_CONTROL_IE:
/* 8.4.5.4.5 Power Control IE */
if(nibble_offset & 1)
{ /* display power control value */
proto_tree_add_item(tree, hf_extended_uiuc_ie_power_control_24, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display power measurement frame value */
proto_tree_add_item(tree, hf_extended_uiuc_ie_power_measurement_frame_24, tvb, offset, 3, ENC_BIG_ENDIAN);
}
else
{ /* display power control value */
proto_tree_add_item(tree, hf_extended_uiuc_ie_power_control, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display power measurement frame value */
proto_tree_add_item(tree, hf_extended_uiuc_ie_power_measurement_frame, tvb, (offset + 1), 1, ENC_BIG_ENDIAN);
}
break;
case MINI_SUBCHANNEL_ALLOCATION_IE:
/* 8.4.5.4.8 Mini Subchannel Allocation IE */
/* set the M value */
switch (length)
{
case 15:
m = 6;
break;
case 9:
m = 3;
break;
case 7:
default:
m = 2;
break;
}
if(nibble_offset & 1)
{
/* display MINI Subchannel Allocation CType value */
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_ctype_16, tvb, offset, 2, ENC_BIG_ENDIAN);
/* display MINI Subchannel Allocation Duration value */
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_duration_16, tvb, offset, 2, ENC_BIG_ENDIAN);
}
else
{ /* display MINI Subchannel Allocation CType value */
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_ctype, tvb, offset, 1, ENC_BIG_ENDIAN);
/* display MINI Subchannel Allocation Duration value */
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_duration, tvb, offset, 1, ENC_BIG_ENDIAN);
}
offset++;
/* decode and display CIDs, UIUCs, and Repetitions */
for(i=0; i<m; i+=2)
{
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_cid_1, tvb, offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc_1, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_repetition_1, tvb, offset, 4, ENC_BIG_ENDIAN);
if(i < (m-2))
{
offset += 3;
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_cid_3, tvb, offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc_3, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_repetition_3, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 3;
}
else if(m == 3)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_padding_1, tvb, offset, 4, ENC_BIG_ENDIAN);
}
}
else
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_cid, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_repetition, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 3;
if(i < (m-2))
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_cid_2, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_uiuc_2, tvb, offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_repetition_2, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
}
else if(m == 3)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_mini_subchannel_alloc_padding, tvb, offset, 1, ENC_BIG_ENDIAN);
}
}
}
break;
case AAS_UL_IE:
/* 8.4.5.4.6 AAS UL IE */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_aas_ul, tvb, offset, (length + 1), ENC_NA);
}
else
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_aas_ul, tvb, offset, length, ENC_NA);
}
break;
case CQICH_ALLOC_IE:
/* 8.4.5.4.12 CQICH_ALLOC_IE */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_cqich_alloc, tvb, offset, (length + 1), ENC_NA);
}
else
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_cqich_alloc, tvb, offset, length, ENC_NA);
}
break;
case UL_ZONE_IE:
/* 8.4.5.4.7 UL Zone Switch IE */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_ul_zone, tvb, offset, (length + 1), ENC_NA);
}
else
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_ul_zone, tvb, offset, length, ENC_NA);
}
break;
case PHYMOD_UL_IE:
/* 8.4.5.4.14 PHYMOD_UL_IE */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_phymod_ul, tvb, offset, (length + 1), ENC_NA);
}
else
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_phymod_ul, tvb, offset, length, ENC_NA);
}
break;
case MIMO_UL_BASIC_IE:
/* 8.4.5.4.11 MIMO_UL_BASIC_IE */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_mimo_ul_basic, tvb, offset, (length + 1), ENC_NA);
}
else
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_mimo_ul_basic, tvb, offset, length, ENC_NA);
}
break;
case UL_MAP_FAST_TRACKING_IE:
/* 8.4.5.4.22 UL_MAP_FAST_TRACKING_IE */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_fast_tracking, tvb, offset, (length + 1), ENC_NA);
}
else
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_fast_tracking, tvb, offset, length, ENC_NA);
}
break;
case UL_PUSC_BURST_ALLOCATION_IN_OTHER_SEGMENT_IE:
/* 8.4.5.4.17 UL PUSC Burst Allocation in Other Segment IE */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_ul_pusc_burst_allocation, tvb, offset, (length + 1), ENC_NA);
}
else
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_ul_pusc_burst_allocation, tvb, offset, length, ENC_NA);
}
break;
case FAST_RANGING_IE:
/* 8.4.5.4.21 FAST_RANGING_IE */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_fast_ranging, tvb, offset, (length + 1), ENC_NA);
}
else
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_fast_ranging, tvb, offset, length, ENC_NA);
}
break;
case UL_ALLOCATION_START_IE:
/* 8.4.5.4.15`UL_ALLOCATION_START_IE */
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_ul_allocation_start, tvb, offset, (length + 1), ENC_NA);
}
else
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_ul_allocation_start, tvb, offset, length, ENC_NA);
}
break;
default:
if(nibble_offset & 1)
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_unknown_uiuc, tvb, offset, (length + 1), ENC_NA);
}
else
{
proto_tree_add_item(tree, hf_extended_uiuc_ie_unknown_uiuc, tvb, offset, length, ENC_NA);
}
break;
}
return ((length + 1) * 2 ); /* length in nibbles */
}
/* Register Wimax Compact UL-MAP IE Protocol */
void wimax_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}
},
#if 0
{
&hf_culmap_uiuc_reserved1,
{"Reserved", "wmx.compact_ulmap.uiuc_reserved1", FT_UINT8, BASE_HEX, NULL, 0x30, NULL, HFILL}
},
#endif
#if 0
{
&hf_culmap_uiuc_reserved11_1,
{"Reserved", "wmx.compact_ulmap.uiuc_reserved1", FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL}
},
#endif
{
&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}
},
#if 0
{
&hf_culmap_reserved_type,
{"UL-MAP Reserved Type", "wmx.compact_ulmap.reserved_type", FT_UINT8, BASE_DEC, NULL, UL_MAP_TYPE_MASK, NULL, HFILL}
},
#endif
{
&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}
},
#if 0
{
&hf_culmap_extension_time_diversity_mbs,
{"Time Diversity MBS", "wmx.extension_type.time_diversity_mbs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#endif
#if 0
{
&hf_culmap_extension_time_diversity_mbs_1,
{"Time Diversity MBS", "wmx.extension_type.time_diversity_mbs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#endif
{
&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));
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C/C++ | wireshark/plugins/epan/wimax/wimax_compact_ulmap_ie_decoder.h | /* wimax_compact_ulmap_ie_decoder.h
* WiMax HARQ Map Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _WIMAX_COMPACT_ULMAP_IE_DECODER_H_
#define _WIMAX_COMPACT_ULMAP_IE_DECODER_H_
extern guint wimax_compact_ulmap_ie_decoder(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, guint offset, guint nibble_offset);
#endif /* _WIMAX_COMPACT_ULMAP_IE_DECODER_H_ */ |
C | wireshark/plugins/epan/wimax/wimax_fch_decoder.c | /* wimax_fch_decoder.c
* WiMax FCH Burst decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <string.h>
#include <epan/packet.h>
#include "wimax-int.h"
extern gint proto_wimax;
extern address bs_address; /* declared in packet-wmx.c */
static int proto_wimax_fch_decoder = -1;
static gint ett_wimax_fch_decoder = -1;
#define FCH_BURST_LENGTH 3
/* FCH Burst bits */
#define USED_SUB_CHANNEL_GROUP_0 0x800000
#define USED_SUB_CHANNEL_GROUP_1 0x400000
#define USED_SUB_CHANNEL_GROUP_2 0x200000
#define USED_SUB_CHANNEL_GROUP_3 0x100000
#define USED_SUB_CHANNEL_GROUP_4 0x080000
#define USED_SUB_CHANNEL_GROUP_5 0x040000
#define FCH_RESERVED_1 0x020000
#define REPETITION_CODING_INDICATION 0x018000
#define CODING_INDICATION 0x007000
#define DL_MAP_LENGTH 0x000FF0
#define FCH_RESERVED_2 0x00000F
static int hf_fch_used_subchannel_group0 = -1;
static int hf_fch_used_subchannel_group1 = -1;
static int hf_fch_used_subchannel_group2 = -1;
static int hf_fch_used_subchannel_group3 = -1;
static int hf_fch_used_subchannel_group4 = -1;
static int hf_fch_used_subchannel_group5 = -1;
static int hf_fch_reserved_1 = -1;
static int hf_fch_repetition_coding_indication = -1;
static int hf_fch_coding_indication = -1;
static int hf_fch_dlmap_length = -1;
static int hf_fch_reserved_2 = -1;
static const value_string used_or_not_used[] =
{
{ 0, "Is Not Used" },
{ 1, "Is Used" },
{ 0, NULL }
};
/* DL Frame Prefix Repetition Coding Indications */
static const value_string repetition_coding_indications[] =
{
{ 0, "No Repetition Coding" },
{ 1, "Repetition Coding of 2 Used" },
{ 2, "Repetition Coding of 4 Used" },
{ 3, "Repetition Coding of 6 Used" },
{ 0, NULL }
};
/* DL Frame Prefix Coding Indications */
static const value_string coding_indications[] =
{
{ 0, "CC Encoding Used" },
{ 1, "BTC Encoding Used" },
{ 2, "CTC Encoding Used" },
{ 3, "ZT CC Encoding Used" },
{ 4, "CC Encoding with optional interleaver" },
{ 5, "LDPC Encoding Used" },
{ 6, "Reserved" },
{ 7, "Reserved" },
{ 0, NULL }
};
static int dissect_wimax_fch_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
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 */
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, ENC_BIG_ENDIAN);
proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group1, tvb, offset, FCH_BURST_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group2, tvb, offset, FCH_BURST_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group3, tvb, offset, FCH_BURST_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group4, tvb, offset, FCH_BURST_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(fch_tree, hf_fch_used_subchannel_group5, tvb, offset, FCH_BURST_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(fch_tree, hf_fch_reserved_1, tvb, offset, FCH_BURST_LENGTH, ENC_BIG_ENDIAN);
/* Decode and display the repetition coding indication */
proto_tree_add_item(fch_tree, hf_fch_repetition_coding_indication, tvb, offset, FCH_BURST_LENGTH, ENC_BIG_ENDIAN);
/* Decode and display the coding indication */
proto_tree_add_item(fch_tree, hf_fch_coding_indication, tvb, offset, FCH_BURST_LENGTH, ENC_BIG_ENDIAN);
/* Decode and display the DL MAP length */
proto_tree_add_item(fch_tree, hf_fch_dlmap_length, tvb, offset, FCH_BURST_LENGTH, ENC_BIG_ENDIAN);
proto_tree_add_item(fch_tree, hf_fch_reserved_2, tvb, offset, FCH_BURST_LENGTH, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
/* Register Wimax FCH Protocol */
void wimax_proto_register_wimax_fch(void)
{
/* TLV display */
static hf_register_info hf[] =
{
{
&hf_fch_used_subchannel_group0,
{
"Sub-Channel Group 0", "wmx.fch.subchannel_group0",
FT_UINT24, BASE_DEC, VALS(used_or_not_used), USED_SUB_CHANNEL_GROUP_0,
NULL, HFILL
}
},
{
&hf_fch_used_subchannel_group1,
{
"Sub-Channel Group 1", "wmx.fch.subchannel_group1",
FT_UINT24, BASE_DEC, VALS(used_or_not_used), USED_SUB_CHANNEL_GROUP_1,
NULL, HFILL
}
},
{
&hf_fch_used_subchannel_group2,
{
"Sub-Channel Group 2", "wmx.fch.subchannel_group2",
FT_UINT24, BASE_DEC, VALS(used_or_not_used), USED_SUB_CHANNEL_GROUP_2,
NULL, HFILL
}
},
{
&hf_fch_used_subchannel_group3,
{
"Sub-Channel Group 3", "wmx.fch.subchannel_group3",
FT_UINT24, BASE_DEC, VALS(used_or_not_used), USED_SUB_CHANNEL_GROUP_3,
NULL, HFILL
}
},
{
&hf_fch_used_subchannel_group4,
{
"Sub-Channel Group 4", "wmx.fch.subchannel_group4",
FT_UINT24, BASE_DEC, VALS(used_or_not_used), USED_SUB_CHANNEL_GROUP_4,
NULL, HFILL
}
},
{
&hf_fch_used_subchannel_group5,
{
"Sub-Channel Group 5", "wmx.fch.subchannel_group5",
FT_UINT24, BASE_DEC, VALS(used_or_not_used), USED_SUB_CHANNEL_GROUP_5,
NULL, HFILL
}
},
{
&hf_fch_reserved_1,
{
"Reserved", "wmx.fch.reserved1",
FT_UINT24, BASE_DEC, NULL, FCH_RESERVED_1,
NULL, HFILL
}
},
{
&hf_fch_repetition_coding_indication,
{
"Repetition Coding Indication", "wmx.fch.repetition_coding_indication",
FT_UINT24, BASE_DEC, VALS(repetition_coding_indications), REPETITION_CODING_INDICATION,
NULL, HFILL
}
},
{
&hf_fch_coding_indication,
{
"Coding Indication", "wmx.fch.coding_indication",
FT_UINT24, BASE_DEC, VALS(coding_indications), CODING_INDICATION,
NULL, HFILL
}
},
{
&hf_fch_dlmap_length,
{
"DL Map Length", "wmx.fch.dl_map_length",
FT_UINT24, BASE_DEC, NULL, DL_MAP_LENGTH,
NULL, HFILL
}
},
{
&hf_fch_reserved_2,
{
"Reserved", "wmx.fch.reserved2",
FT_UINT24, BASE_DEC, NULL, FCH_RESERVED_2,
NULL, HFILL
}
}
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_wimax_fch_decoder,
};
proto_wimax_fch_decoder = proto_wimax;
/* 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, proto_wimax_fch_decoder);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/wimax_ffb_decoder.c | /* wimax_ffb_decoder.c
* WiMax Fast Feedback packet decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax-int.h"
extern gint proto_wimax;
static gint proto_wimax_ffb_decoder = -1;
static gint ett_wimax_ffb_decoder = -1;
/* static gint hf_ffb_burst = -1; */
static gint hf_ffb_num_of_ffbs = -1;
static gint hf_ffb_type = -1;
static gint hf_ffb_subchannel = -1;
static gint hf_ffb_symboloffset = -1;
static gint hf_ffb_value = -1;
static int dissect_wimax_ffb_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
gint offset = 0;
guint length, num_of_ffbs, i;
proto_item *ffb_item = NULL;
proto_tree *ffb_tree = NULL;
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Fast Feedback Burst:");
if (tree)
{ /* we are being asked for details */
/* get the tvb reported length */
length = tvb_reported_length(tvb);
/* display Fast Feedback Burst dissector info */
ffb_item = proto_tree_add_protocol_format(tree, proto_wimax_ffb_decoder, tvb, offset, length, "Fast Feedback Burst (%u bytes)", length);
/* add Fast Feedback Burst subtree */
ffb_tree = proto_item_add_subtree(ffb_item, ett_wimax_ffb_decoder);
/* get the number of FFBs */
num_of_ffbs = tvb_get_guint8(tvb, offset);
/* display the number of FFBs */
proto_tree_add_item(ffb_tree, hf_ffb_num_of_ffbs, tvb, offset++, 1, ENC_BIG_ENDIAN);
/* display the FFB type */
proto_tree_add_item(ffb_tree, hf_ffb_type, tvb, offset++, 1, ENC_BIG_ENDIAN);
/* display the FFBs */
for(i = 0; i < num_of_ffbs; i++)
{
proto_tree_add_item(ffb_tree, hf_ffb_subchannel, tvb, offset++, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ffb_tree, hf_ffb_symboloffset, tvb, offset++, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ffb_tree, hf_ffb_value, tvb, offset++, 1, ENC_BIG_ENDIAN);
}
}
return tvb_captured_length(tvb);
}
/* Register Wimax FFB Protocol */
void wimax_proto_register_wimax_ffb(void)
{
/* FFB display */
static hf_register_info hf[] =
{
#if 0
{
&hf_ffb_burst,
{"Fast Feedback Burst", "wmx.ffb.burst", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#endif
{
&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, proto_wimax_ffb_decoder);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/wimax_hack_decoder.c | /* wimax_hack_decoder.c
* WiMax HARQ ACK Burst decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax-int.h"
extern gint proto_wimax;
static gint proto_wimax_hack_decoder = -1;
static gint ett_wimax_hack_decoder = -1;
static const value_string vals_flags[] =
{
{0, "Even Half-Slot (tiles 0,2,4)"},
{1, "Odd Half-Slot (tiles 1,3,5)"},
{0, NULL}
};
static const value_string vals_values[] =
{
{0, "ACK"},
{1, "NACK"},
{0, NULL}
};
/* static gint hf_hack_burst = -1; */
static gint hf_hack_num_of_hacks = -1;
static gint hf_hack_half_slot_flag = -1;
static gint hf_hack_subchannel = -1;
static gint hf_hack_symboloffset = -1;
static gint hf_hack_value = -1;
static int dissect_wimax_hack_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
gint offset = 0;
guint length, num_of_hacks, i;
proto_item *hack_item = NULL;
proto_tree *hack_tree = NULL;
/* update the info column */
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, ENC_BIG_ENDIAN);
/* display the HARQ ACKs */
for(i = 0; i < num_of_hacks; i++)
{
proto_tree_add_item(hack_tree, hf_hack_subchannel, tvb, offset++, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(hack_tree, hf_hack_symboloffset, tvb, offset++, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(hack_tree, hf_hack_half_slot_flag, tvb, offset++, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(hack_tree, hf_hack_value, tvb, offset++, 1, ENC_BIG_ENDIAN);
}
}
return tvb_captured_length(tvb);
}
/* Register Wimax HARQ ACK Protocol */
void wimax_proto_register_wimax_hack(void)
{
/* HARQ ACK display */
static hf_register_info hf[] =
{
#if 0
{
&hf_hack_burst,
{"HARQ ACK Burst", "wmx.hack.burst", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#endif
{
&hf_hack_num_of_hacks,
{"Number Of HARQ ACKs/NACKs", "wmx.hack.num_of_hacks", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{
&hf_hack_subchannel,
{"Physical Subchannel", "wmx.hack.subchannel", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{
&hf_hack_symboloffset,
{"Symbol Offset", "wmx.hack.symbol_offset", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{
&hf_hack_half_slot_flag,
{"Half-Slot Flag", "wmx.hack.half_slot_flag", FT_UINT8, BASE_DEC, VALS(vals_flags), 0x0, NULL, HFILL}
},
{
&hf_hack_value,
{"ACK Value", "wmx.hack.hack_value", FT_UINT8, BASE_DEC, VALS(vals_values), 0x0, NULL, HFILL}
}
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_wimax_hack_decoder,
};
proto_wimax_hack_decoder = proto_wimax;
register_dissector("wimax_hack_burst_handler", dissect_wimax_hack_decoder, proto_wimax_hack_decoder);
proto_register_field_array(proto_wimax_hack_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/wimax_harq_map_decoder.c | /* wimax_harq_map_decoder.c
* WiMax HARQ Map Message decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#include "crc.h"
#include "wimax-int.h"
#include "wimax_compact_dlmap_ie_decoder.h"
#include "wimax_compact_ulmap_ie_decoder.h"
extern gint proto_wimax;
static gint proto_wimax_harq_map_decoder = -1;
static gint ett_wimax_harq_map_decoder = -1;
/* MASKs */
#define LSB_NIBBLE_MASK 0x0F
/* HARQ MAP masks */
#define WIMAX_HARQ_MAP_INDICATOR_MASK 0xE00000
#define WIMAX_HARQ_UL_MAP_APPENDED_MASK 0x100000
#define WIMAX_HARQ_MAP_RESERVED_MASK 0x080000
#define WIMAX_HARQ_MAP_MSG_LENGTH_MASK 0x07FC00
#define WIMAX_HARQ_MAP_DL_IE_COUNT_MASK 0x0003F0
#define WIMAX_HARQ_MAP_MSG_LENGTH_SHIFT 10
#define WIMAX_HARQ_MAP_DL_IE_COUNT_SHIFT 4
/* HARQ MAP display indexies */
static gint hf_harq_map_indicator = -1;
static gint hf_harq_ul_map_appended = -1;
static gint hf_harq_map_reserved = -1;
static gint hf_harq_map_msg_length = -1;
static gint hf_harq_dl_ie_count = -1;
static gint hf_harq_map_msg_crc = -1;
static gint hf_harq_map_msg_crc_status = -1;
static expert_field ei_harq_map_msg_crc = EI_INIT;
/* Copied and renamed from proto.c because global value_strings don't work for plugins */
static const value_string plugin_proto_checksum_vals[] = {
{ PROTO_CHECKSUM_E_BAD, "Bad" },
{ PROTO_CHECKSUM_E_GOOD, "Good" },
{ PROTO_CHECKSUM_E_UNVERIFIED, "Unverified" },
{ PROTO_CHECKSUM_E_NOT_PRESENT, "Not present" },
{ 0, NULL }
};
/* HARQ MAP message decoder */
static int dissector_wimax_harq_map_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint i, offset = 0;
guint tvb_len, length, dl_ie_count;
guint ie_length;
proto_item *harq_map_item = NULL;
proto_tree *harq_map_tree = NULL;
guint nibble_offset;
proto_item *parent_item = NULL;
guint ulmap_appended;
guint32 harq_map_msg_crc, calculated_crc;
guint32 first_24bits;
/* check the tvb reported length */
tvb_len = tvb_reported_length(tvb);
if(!tvb_len)
{ /* do nothing if tvb is empty */
return 0;
}
/* Ensure the right payload type */
first_24bits = tvb_get_ntoh24(tvb, offset);
if((first_24bits & WIMAX_HARQ_MAP_INDICATOR_MASK) != WIMAX_HARQ_MAP_INDICATOR_MASK)
{ /* do nothing if tvb is not a HARQ MAP message */
return 0;
}
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "HARQ-MAP Message: ");
if (tree)
{ /* we are being asked for details */
/* get the parent */
parent_item = proto_tree_get_parent(tree);
/* display HARQ-MAP Message and create subtree */
harq_map_item = proto_tree_add_protocol_format(tree, proto_wimax_harq_map_decoder, tvb, offset, tvb_len, "HARQ-MAP Message (%u bytes)", tvb_len);
harq_map_tree = proto_item_add_subtree(harq_map_item, ett_wimax_harq_map_decoder);
/* display the HARQ MAP Indicator */
proto_tree_add_item(harq_map_tree, hf_harq_map_indicator, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the HARQ MAp UL-MAP Appended */
proto_tree_add_item(harq_map_tree, hf_harq_ul_map_appended, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the reserved bit */
proto_tree_add_item(harq_map_tree, hf_harq_map_reserved, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the HARQ MAP message length */
proto_tree_add_item(harq_map_tree, hf_harq_map_msg_length, tvb, offset, 3, ENC_BIG_ENDIAN);
/* display the DL IE count */
proto_tree_add_item(harq_map_tree, hf_harq_dl_ie_count, tvb, offset, 3, ENC_BIG_ENDIAN);
/* get the message length */
/* XXX - make sure the length isn't smaller than the minimum */
length = ((first_24bits & WIMAX_HARQ_MAP_MSG_LENGTH_MASK) >> WIMAX_HARQ_MAP_MSG_LENGTH_SHIFT);
/* get the DL IE count */
dl_ie_count = ((first_24bits & WIMAX_HARQ_MAP_DL_IE_COUNT_MASK) >> WIMAX_HARQ_MAP_DL_IE_COUNT_SHIFT);
/* get the UL MAP appended */
ulmap_appended = (first_24bits & WIMAX_HARQ_UL_MAP_APPENDED_MASK);
/* set the offsets to Compact DL-MAP IEs */
offset += 2;
nibble_offset = 1;
/* process the compact dl_map ies */
for(i=0; i<dl_ie_count; i++)
{ /* add the DL-MAp IEs info */
proto_item_append_text(parent_item, " - DL-MAP IEs");
/* decode Compact DL-MAP IEs */
ie_length = wimax_compact_dlmap_ie_decoder(harq_map_tree, pinfo, tvb, offset, nibble_offset);
offset += ((nibble_offset + ie_length) >> 1);
nibble_offset = ((nibble_offset + ie_length) & 1);
}
/* check if there exist the compact ul_map IEs */
if (ulmap_appended)
{ /* add the UL-MAp IEs info */
proto_item_append_text(parent_item, ",UL-MAP IEs");
/* process the compact ul_map ies */
while(offset < (length - (int)sizeof(harq_map_msg_crc)))
{ /* decode Compact UL-MAP IEs */
ie_length = wimax_compact_ulmap_ie_decoder(harq_map_tree, pinfo, tvb, offset, nibble_offset);
/* Prevent endless loop with erroneous data. */
if (ie_length < 2)
ie_length = 2;
offset += ((nibble_offset + ie_length) >> 1);
nibble_offset = ((nibble_offset + ie_length) & 1);
}
}
/* handle the padding */
if(nibble_offset)
{
/* add the Padding info */
proto_item_append_text(parent_item, ",Padding");
proto_tree_add_protocol_format(harq_map_tree, proto_wimax_harq_map_decoder, tvb, offset, 1, "Padding Nibble: 0x%x", (tvb_get_guint8(tvb, offset) & LSB_NIBBLE_MASK));
}
/* add the CRC info */
proto_item_append_text(parent_item, ",CRC");
/* calculate the HARQ MAM Message CRC */
if (length >= (int)sizeof(harq_map_msg_crc)) {
calculated_crc = wimax_mac_calc_crc32(tvb_get_ptr(tvb, 0, length - (int)sizeof(harq_map_msg_crc)), length - (int)sizeof(harq_map_msg_crc));
proto_tree_add_checksum(tree, tvb, length - (int)sizeof(harq_map_msg_crc), hf_harq_map_msg_crc, hf_harq_map_msg_crc_status, &ei_harq_map_msg_crc,
pinfo, calculated_crc, ENC_BIG_ENDIAN, PROTO_CHECKSUM_VERIFY);
}
}
return tvb_captured_length(tvb);
}
/* Register Wimax HARQ MAP Protocol */
void wimax_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}
},
{
&hf_harq_map_msg_crc_status,
{"HARQ MAP Message CRC Status", "wmx.harq_map.msg_crc.status", FT_UINT8, BASE_NONE, VALS(plugin_proto_checksum_vals), 0x0, NULL, HFILL}
},
};
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_wimax_harq_map_decoder,
};
static ei_register_info ei[] = {
{ &ei_harq_map_msg_crc, { "wmx.harq_map.bad_checksum", PI_CHECKSUM, PI_ERROR, "Bad checksum", EXPFILL }},
};
expert_module_t* expert_harq_map;
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));
expert_harq_map = expert_register_protocol(proto_wimax_harq_map_decoder);
expert_register_field_array(expert_harq_map, ei, array_length(ei));
register_dissector("wimax_harq_map_handler", dissector_wimax_harq_map_decoder, proto_wimax_harq_map_decoder);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C/C++ | wireshark/plugins/epan/wimax/wimax_mac.h | /* wimax_mac.h
* WiMax MAC Definitions
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef WIMAX_MAC_H
#define WIMAX_MAC_H
#define IP_HEADER_BYTE 0x45
/* WiMax MAC Header/Subheader Sizes */
#define WIMAX_MAC_HEADER_SIZE 6
#define WIMAX_MAC_SUBHEADER_MESH_SIZE 2
#define WIMAX_MAC_SUBHEADER_FAST_FEEDBACK_SIZE 1
#define WIMAX_MAC_SUBHEADER_GRANT_MGMT_SIZE 2
#define WIMAX_MAC_SUBHEADER_FRAG_SIZE(x) (((x) & (WIMAX_MAC_TYPE_EXTENDED | WIMAX_MAC_TYPE_ARQ)) ? 3 : 2)
#define WIMAX_MAC_SUBHEADER_PACK_SIZE(x) (((x) & (WIMAX_MAC_TYPE_EXTENDED | WIMAX_MAC_TYPE_ARQ)) ? 3 : 2)
#define WIMAX_MAC_HEADER_GENERIC 0
#define WIMAX_MAC_CID_PADDING 0xFFFE
/* wimax mac arq */
#define ARQ_CUMULATIVE_ACK_ENTRY 1
#define ARQ_CUMULATIVE_ACK_BLOCK_SEQ 3
#define ARQ_ACK_MAP_SIZE 2
/* WiMax MAC Header Sub-types (Table 6) */
#define WIMAX_MAC_TYPE_MESH (1 << 5)
#define WIMAX_MAC_TYPE_ARQ (1 << 4)
#define WIMAX_MAC_TYPE_EXTENDED (1 << 3)
#define WIMAX_MAC_TYPE_FRAGMENTATION (1 << 2)
#define WIMAX_MAC_TYPE_PACKING (1 << 1)
#define WIMAX_MAC_TYPE_FAST_FEEDBACK (1 << 0)
#define WIMAX_MAC_TYPE_GRANT_MGMT (1 << 0)
/* wimax mac management messages (Table 14) */
#define MAC_MGMT_MSG_UCD 0
#define MAC_MGMT_MSG_DCD 1
#define MAC_MGMT_MSG_DL_MAP 2
#define MAC_MGMT_MSG_UL_MAP 3
#define MAC_MGMT_MSG_RNG_REQ 4
#define MAC_MGMT_MSG_RNG_RSP 5
#define MAC_MGMT_MSG_REG_REQ 6
#define MAC_MGMT_MSG_REG_RSP 7
#define MAC_MGMT_MSG_PKM_REQ 9
#define MAC_MGMT_MSG_PKM_RSP 10
#define MAC_MGMT_MSG_DSA_REQ 11
#define MAC_MGMT_MSG_DSA_RSP 12
#define MAC_MGMT_MSG_DSA_ACK 13
#define MAC_MGMT_MSG_DSC_REQ 14
#define MAC_MGMT_MSG_DSC_RSP 15
#define MAC_MGMT_MSG_DSC_ACK 16
#define MAC_MGMT_MSG_DSD_REQ 17
#define MAC_MGMT_MSG_DSD_RSP 18
#define MAC_MGMT_MSG_MCA_REQ 21
#define MAC_MGMT_MSG_MCA_RSP 22
#define MAC_MGMT_MSG_DBPC_REQ 23
#define MAC_MGMT_MSG_DBPC_RSP 24
#define MAC_MGMT_MSG_RES_CMD 25
#define MAC_MGMT_MSG_SBC_REQ 26
#define MAC_MGMT_MSG_SBC_RSP 27
#define MAC_MGMT_MSG_CLK_CMP 28
#define MAC_MGMT_MSG_DREG_CMD 29
#define MAC_MGMT_MSG_DSX_RVD 30
#define MAC_MGMT_MSG_TFTP_CPLT 31
#define MAC_MGMT_MSG_TFTP_RSP 32
#define MAC_MGMT_MSG_ARQ_FEEDBACK 33
#define MAC_MGMT_MSG_ARQ_DISCARD 34
#define MAC_MGMT_MSG_ARQ_RESET 35
#define MAC_MGMT_MSG_REP_REQ 36
#define MAC_MGMT_MSG_REP_RSP 37
#define MAC_MGMT_MSG_FPC 38
#define MAC_MGMT_MSG_MSH_NCFG 39
#define MAC_MGMT_MSG_MSH_NENT 40
#define MAC_MGMT_MSG_MSH_DSCH 41
#define MAC_MGMT_MSG_MSH_CSCH 42
#define MAC_MGMT_MSG_MSH_CSCF 43
#define MAC_MGMT_MSG_AAS_FBCK_REQ 44
#define MAC_MGMT_MSG_AAS_FBCK_RSP 45
#define MAC_MGMT_MSG_AAS_BEAM_SELECT 46
#define MAC_MGMT_MSG_AAS_BEAM_REQ 47
#define MAC_MGMT_MSG_AAS_BEAM_RSP 48
#define MAC_MGMT_MSG_DREG_REQ 49
#define MAC_MGMT_MSG_MOB_SLP_REQ 50
#define MAC_MGMT_MSG_MOB_SLP_RSP 51
#define MAC_MGMT_MSG_MOB_TRF_IND 52
#define MAC_MGMT_MSG_MOB_NBR_ADV 53
#define MAC_MGMT_MSG_MOB_SCN_REQ 54
#define MAC_MGMT_MSG_MOB_SCN_RSP 55
#define MAC_MGMT_MSG_MOB_BSHO_REQ 56
#define MAC_MGMT_MSG_MOB_MSHO_REQ 57
#define MAC_MGMT_MSG_MOB_BSHO_RSP 58
#define MAC_MGMT_MSG_MOB_HO_IND 59
#define MAC_MGMT_MSG_MOB_SCN_REP 60
#define MAC_MGMT_MSG_MOB_PAG_ADV 61
#define MAC_MGMT_MSG_MBS_MAP 62
#define MAC_MGMT_MSG_PMC_REQ 63
#define MAC_MGMT_MSG_PMC_RSP 64
#define MAC_MGMT_MSG_PRC_LT_CTRL 65
#define MAC_MGMT_MSG_MOB_ASC_REP 66
#define MAC_MGMT_MSG_TYPE_MAX 67
/* DL-MAP types (Table 276) */
#define DL_MAP_EXTENDED_2_DIUC 14
#define DL_MAP_EXTENDED_IE 15
/* DL-MAP Extended UIUC Code (table 277a) */
#define DL_MAP_AAS_IE 2
#define DL_MAP_EXTENDED_CID_SWITCH_IE 4
#define DL_MAP_HARQ_IE 7
/* DL-MAP Extended-2 UIUC Code (table 277c) */
#define DL_MAP_EXTENDED_2_HARQ 7
/* UL-MAP types (Table 288) */
#define UL_MAP_FAST_FEEDBACK_CHANNEL 0
#define UL_MAP_CDMA_BR_RANGING_IE 12
#define UL_MAP_PAPR_RECUCTION_ALLOC_SAFETY_ZONE 13
#define UL_MAP_CDMA_ALLOCATION_IE 14
#define UL_MAP_EXTENDED_IE 15
/* UL-MAP Extended UIUC Code (table 290a) */
#define UL_MAP_CQICH_ALLOCATION_IE 3
/* DCD types (Table 358)*/
#define DCD_DOWNLINK_BURST_PROFILE 1
#define DCD_BS_EIRP 2
#define DCD_FRAME_DURATION 3
#define DCD_PHY_TYPE 4
#define DCD_POWER_ADJUSTMENT 5
#define DCD_CHANNEL_NR 6
#define DCD_TTG 7
#define DCD_RTG 8
#define DCD_RSS 9
#define DCD_EIRXP 9
#define DCD_CHANNEL_SWITCH_FRAME_NR 10
#define DCD_FREQUENCY 12
#define DCD_BS_ID 13
#define DCD_FRAME_DURATION_CODE 14
#define DCD_FRAME_NR 15
#define DCD_SIZE_CQICH_ID 16
#define DCD_H_ARQ_ACK_DELAY 17
#define DCD_MAC_VERSION 148
#define DCD_RESTART_COUNT 154
#define DCD_BURST_FREQUENCY 1
#define DCD_BURST_FEC_CODE_TYPE 150
#define DCD_BURST_DIUC_EXIT_THRESHOLD 151
#define DCD_BURST_DIUC_ENTRY_THRESHOLD 152
#define DCD_BURST_TCS_ENABLE 153
/*#define DCD_MAXIMUM_RETRANSMISSION 20*/
/* TLV types */
#define DCD_TLV_T_19_PERMUTATION_TYPE_FOR_BROADCAST_REGION_IN_HARQ_ZONE 19
#define DCD_TLV_T_20_MAXIMUM_RETRANSMISSION 20
#define DCD_TLV_T_21_DEFAULT_RSSI_AND_CINR_AVERAGING_PARAMETER 21
#define DCD_TLV_T_22_DL_AMC_ALLOCATED_PHYSICAL_BANDS_BITMAP 22
#define DCD_TLV_T_34_DL_REGION_DEFINITION 34
#define DCD_TLV_T_50_HO_TYPE_SUPPORT 50
#define DCD_TLV_T_31_H_ADD_THRESHOLD 31
#define DCD_TLV_T_32_H_DELETE_THRESHOLD 32
#define DCD_TLV_T_33_ASR 33
#define DCD_TLV_T_34_DL_REGION_DEFINITION 34
#define DCD_TLV_T_35_PAGING_GROUP_ID 35
#define DCD_TLV_T_36_TUSC1_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP 36
#define DCD_TLV_T_37_TUSC2_PERMUTATION_ACTIVE_SUBCHANNELS_BITMAP 37
#define DCD_TLV_T_51_HYSTERSIS_MARGIN 51
#define DCD_TLV_T_52_TIME_TO_TRIGGER_DURATION 52
#define DCD_TLV_T_54_TRIGGER 54
#define DCD_TLV_T_60_NOISE_AND_INTERFERENCE 60
#define DCD_TLV_T_153_DOWNLINK_BURST_PROFILE_FOR_MULTIPLE_FEC_TYPES 153
#define DCD_TLV_T_22_DL_AMC_ALLOCATED_PHYSICAL_BANDS_BITMAP 22
#define DCD_TLV_T_541_TYPE_FUNCTION_ACTION 1
#define DCD_TLV_T542_TRIGGER_VALUE 2
#define DCD_TLV_T_543_TRIGGER_AVERAGING_DURATION 3
#define DCD_TLV_T_45_PAGING_INTERVAL_LENGTH 45
/* UCD types (Table 353) */
#define UCD_UPLINK_BURST_PROFILE 1
#define UCD_RESERVATION_TIMEOUT 2
#define UCD_BW_REQ_SIZE 3
#define UCD_RANGING_REQ_SIZE 4
#define UCD_FREQUENCY 5
#define UCD_TLV_T_7_HO_RANGING_START 7
#define UCD_TLV_T_8_RANGING_HO_END 8
#define UCD_INITIAL_RANGING_CODES 150
#define UCD_PERIODIC_RANGING_CODES 151
#define UCD_BANDWIDTH_REQUEST_CODES 152
#define UCD_PERIODIC_RANGING_BACKOFF_START 153
#define UCD_PERIODIC_RANGING_BACKOFF_END 154
#define UCD_START_OF_RANGING_CODES_GROUP 155
#define UCD_PERMUTATION_BASE 156
#define UCD_UL_ALLOCATED_SUBCHANNELS_BITMAP 157
#define UCD_TLV_T_158_OPTIONAL_PERMUTATION_UL_ALLOCATED_SUBCHANNELS_BITMAP 158
#define UCD_TLV_T_159_BAND_AMC_ALLOCATION_THRESHHOLD 159
#define UCD_TLV_T_160_BAND_AMC_RELEASE_THRESHOLD 160
#define UCD_TLV_T_161_BAND_AMC_ALLOCATION_TIMER 161
#define UCD_TLV_T_162_BAND_AMC_RELEASE_TIMER 162
#define UCD_TLV_T_163_BAND_STATUS_REPORT_MAX_PERIOD 163
#define UCD_TLV_T_164_BAND_AMC_RETRY_TIMER 164
#define UCD_TLV_T_170_SAFETY_CHANNEL_RETRY_TIMER 170
#define UCD_TLV_T_171_HARQ_ACK_DELAY_FOR_DL_BURST 171
#define UCD_TLV_T_172_CQICH_BAND_AMC_TRANSITION_DELAY 172
#define UCD_TLV_T_174_MAXIMUM_RETRANSMISSION 174
#define UCD_TLV_T_176_SIZE_OF_CQICH_ID_FIELD 176
#define UCD_TLV_T_177_NORMALIZED_CN_OVERRIDE_2 177
#define UCD_TLV_T_186_UPPER_BOUND__AAS_PREAMBLE 186
#define UCD_TLV_T_187_LOWER_BOUND_AAS_PREAMBLE 187
#define UCD_TLV_T_188_ALLOW_AAS_BEAM_SELECT_MESSAGE 188
#define UCD_TLV_T_189_USE_CQICH_INDICATION_FLAG 189
#define UCD_TLV_T_190_MS_SPECIFIC_UP_POWER_OFFSET_ADJUSTMENT_STEP 190
#define UCD_TLV_T_191_MS_SPECIFIC_DOWN_POWER_OFSET_ADJUSTMENT_STEP 191
#define UCD_TLV_T_192_MIN_LEVEL_POWER_OFFSET_ADJUSTMENT 192
#define UCD_TLV_T_193_MAX_LEVEL_POWER_OFFSETR_ADJUSTMENT 193
#define UCD_TLV_T_194_HANDOVER_RANGING_CODES 194
#define UCD_TLV_T_195_INITIAL_RANGING_INTERVAL 195
#define UCD_TLV_T_196_TX_POWER_REPORT 196
#define UCD_TLV_T_197_NORMALIZED_CN_FOR_CHANNEL_SOUNDING 197
#define UCD_TLV_T_198_INTIAL_RANGING_BACKOFF_START 198
#define UCD_TLV_T_199_INITIAL_RANGING_BACKOFF_END 199
#define UCD_TLV_T_200_BANDWIDTH_REQUESET_BACKOFF_START 200
#define UCD_TLV_T_201_BANDWIDTH_REQUEST_BACKOFF_END 201
#define UCD_TLV_T_202_UPLINK_BURST_PROFILE_FOR_MULTIPLE_FEC_TYPES 202
#define UCD_TLV_T_203_UL_PUSC_SUBCHANNEL_ROTATION 203
#define UCD_TLV_T_205_RELATIVE_POWER_OFFSET_UL_HARQ_BURST 205
#define UCD_TLV_T_206_RELATIVE_POWER_OFFSET_UL_BURST_CONTAINING_MAC_MGMT_MSG 206
#define UCD_TLV_T_207_UL_INITIAL_TRANSMIT_TIMING 207
#define UCD_TLV_T_210_FAST_FEEDBACK_REGION 210
#define UCD_TLV_T_211_HARQ_ACK_REGION 211
#define UCD_TLV_T_212_RANGING_REGION 212
#define UCD_TLV_T_213_SOUNDING_REGION 213
/* Table 357 */
#define UCD_BURST_FEC 150
#define UCD_BURST_RANGING_DATA_RATIO 151
/*#define UCD_BURST_POWER_BOOST 151*/
/*#define UCD_BURST_TCS_ENABLE 152*/
/* RNG-REQ types (Table 364) */
/* Sorted these values */
#define RNG_REQ_DL_BURST_PROFILE 1
#define RNG_REQ_SS_MAC_ADDRESS 2
#define RNG_REQ_RANGING_ANOMALIES 3
#define RNG_REQ_AAS_BROADCAST 4
#define RNG_REQ_SERVING_BS_ID 5
#define RNG_REQ_RANGING_PURPOSE_INDICATION 6
#define RNG_REQ_HO_ID 7
#define RNG_REQ_POWER_DOWN_INDICATOR 8
#define RNG_REQ_PAGING_CONTROLLER_ID 9
#define RNG_REQ_MAC_HASH_SKIP_THRESHOLD 10
#define RNG_REQ_ENABLED_ACTION_TRIGGERED 11
#define RNG_REQ_REQUESTED_DNLK_REP_CODING_LEVEL 12
#define RNG_REQ_CMAC_KEY_COUNT 13
#define RNG_REQ_POWER_SAVING_CLASS_PARAMETERS 21
/* RNG-REQ/RSP Power Saving Class Parameter TLV's (Table 364a) */
#define RNG_POWER_SAVING_CLASS_FLAGS 1
#define RNG_POWER_SAVING_CLASS_ID 2
#define RNG_POWER_SAVING_CLASS_TYPE 3
#define RNG_START_FRAME_NUMBER 4
#define RNG_INITIAL_SLEEP_WINDOW 5
#define RNG_LISTENING_WINDOW 6
#define RNG_FINAL_SLEEP_WINDOW_BASE 7
#define RNG_FINAL_SLEEP_WINDOW_EXPONENT 8
#define RNG_SLPID 9
#define RNG_CID 10
#define RNG_DIRECTION 11
/* RNG-RSP types (Table 367) */
#define RNG_RSP_TIMING_ADJUST 1
#define RNG_RSP_POWER_LEVEL_ADJUST 2
#define RNG_RSP_OFFSET_FREQ_ADJUST 3
#define RNG_RSP_RANGING_STATUS 4
#define RNG_RSP_DL_FREQ_OVERRIDE 5
#define RNG_RSP_UL_CHANNEL_ID_OVERRIDE 6
#define RNG_RSP_DL_OPERATIONAL_BURST_PROFILE 7
#define RNG_RSP_SS_MAC_ADDRESS 8
#define RNG_RSP_BASIC_CID 9
#define RNG_RSP_PRIMARY_MGMT_CID 10
#define RNG_RSP_AAS_BROADCAST_PERMISSION 11
#define RNG_RSP_FRAME_NUMBER 12
#define RNG_RSP_OPPORTUNITY_NUMBER 13
#define RNG_RSP_SERVICE_LEVEL_PREDICTION 17
#define RNG_RSP_GLOBAL_SERVICE_CLASS_NAME 18
#define RNG_RSP_RESOURCE_RETAIN_FLAG 20
#define RNG_RSP_HO_PROCESS_OPTIMIZATION 21
/* Sorted the following values (for readability) */
#define RNG_RSP_HO_ID 22
#define RNG_RSP_LOCATION_UPDATE_RESPONSE 23
#define RNG_RSP_PAGING_INFORMATION 24
#define RNG_RSP_PAGING_CONTROLLER_ID 25
#define RNG_RSP_NEXT_PERIODIC_RANGING 26
#define RNG_RSP_POWER_SAVING_CLASS_PARAMETERS 27
#define RNG_RSP_MAC_HASH_SKIP_THRESHOLD 28
#define RNG_RSP_SBC_RSP_ENCODINGS 29
#define RNG_RSP_REG_RSP_ENCODINGS 30
#define RNG_RSP_SA_CHALLENGE_TUPLE 31
#define RNG_RSP_ENABLED_ACTION_TRIGGERED 32
#define RNG_RSP_DL_OP_BURST_PROFILE_OFDMA 33
#define RNG_RSP_RANGING_CODE_ATTRIBUTES 150
#define RNG_RSP_SA_CHALLENGE_BS_RANDOM 1
#define RNG_RSP_SA_CHALLENGE_AKID 2
/* SBC types (section 11.8) */
#define SBC_BW_ALLOC_SUPPORT 1
#define SBC_TRANSITION_GAPS 2
#define SBC_REQ_MAX_TRANSMIT_POWER 3
#define SBC_MAC_PDU 4
#define SBC_PKM_FLOW_CONTROL 15
#define SBC_AUTH_POLICY_SUPPORT 16
#define SBC_MAX_SECURITY_ASSOCIATIONS 17
#define SBC_REQ_CURR_TRANSMITTED_POWER 147
#define SBC_SS_FFT_SIZES 150
#define SBC_SS_DEMODULATOR 151
#define SBC_SS_MODULATOR 152
#define SBC_SS_NUM_UL_ARQ_ACK_CHANNEL 153
#define SBC_SS_PERMUTATION_SUPPORT 154
#define SBC_SS_DEMODULATOR_MIMO_SUPPORT 156
#define SBC_SS_MIMO_UPLINK_SUPPORT 157
#define SBC_SS_OFDMA_AAS_PRIVATE_MAP_SUPPORT 158
#define SBC_SS_OFDMA_AAS_CAPABILITIES 159
#define SBC_SS_CINR_MEASUREMENT_CAPABILITY 160
#define SBC_SS_NUM_DL_ARQ_ACK_CHANNEL 161
#define SBC_TLV_T_26_POWER_SAVE_CLASS_TYPES_CAPABILITY 26
#define SBC_TLV_T_28_HO_TRIGGER_METRIC_SUPPORT 28
#define SBC_TLV_T_27_EXTENSION_CAPABILITY 27
#define SBC_TLV_T_162_HARQ_INCREMENTAL_REDUNDANCY_BUFFER_CAPABILITY 162
#define SBC_TLV_T_163_HARQ_CHASE_COMBINING_AND_CC_IR_BUFFER_CAPABILITY 163
#define SBC_TLV_T_167_ASSOCIATION_SUPPORT 167
#define SBC_TLV_T_170_UPLINK_POWER_CONTROL_SUPPORT 170
#define SBC_TLV_T_171_MINIMUM_NUM_OF_FRAMES 171
#define SBC_TLV_T_172 172
#define SBC_TLV_T_173_UL_CONTROL_CHANNEL_SUPPORT 173
#define SBC_TLV_T_174_OFDMA_MS_CSIT_CAPABILITY 174
#define SBC_TLV_T_175_MAX_NUM_BST_PER_FRM_CAPABILITY_HARQ 175
#define SBC_TLV_T_176 176
#define SBC_TLV_T_177_OFDMA_SS_MODULATOR_FOR_MIMO_SUPPORT 177
#define SBC_TLV_T_178_SDMA_PILOT_CAPABILITY 178
#define SBC_TLV_T_179_OFDMA_MULTIPLE_DL_BURST_PROFILE_CAPABILITY 179
#define SBC_TLV_T_204_OFDMA_PARAMETERS_SETS 204
/* DREG-REQ DREG-CMD types (Sections 6.3.2.3.42 and 6.3.2.3.26) */
#define DREG_PAGING_INFO 1
#define DREG_REQ_DURATION 2
#define DREG_PAGING_CONTROLLER_ID 3
#define DREG_IDLE_MODE_RETAIN_INFO 4
#define DREG_MAC_HASH_SKIP_THRESHOLD 5
#define DREG_PAGING_CYCLE_REQUEST 52
/* REP-REQ types (Sections 11.11) */
#define REP_REQ_REPORT_REQUEST 1
/* REP-REQ report request subtypes */
#define REP_REQ_REPORT_TYPE 1
#define REP_REQ_CHANNEL_NUMBER 2
#define REP_REQ_CHANNEL_TYPE 3
#define REP_REQ_ZONE_SPEC_PHY_CINR_REQ 4
#define REP_REQ_PREAMBLE_PHY_CINR_REQ 5
#define REP_REQ_ZONE_SPEC_EFF_CINR_REQ 6
#define REP_REQ_PREAMBLE_EFF_CINR_REQ 7
#define REP_REQ_CHANNEL_SELECTIVITY_REPORT 8
/* REP-RSP types (Sections 11.12) */
#define REP_RSP_REPORT_TYPE 1
#define REP_RSP_CHANNEL_TYPE 2
#define REP_RSP_ZONE_SPECIFIC_PHY_CINR 3
#define REP_RSP_PREAMBLE_PHY_CINR 4
#define REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR 5
#define REP_RSP_PREAMBLE_EFFECTIVE_CINR 6
/* REP-RSP report subtypes */
#define REP_RSP_REPORT_CHANNEL_NUMBER 1
#define REP_RSP_REPORT_START_FRAME 2
#define REP_RSP_REPORT_DURATION 3
#define REP_RSP_REPORT_BASIC_REPORT 4
#define REP_RSP_REPORT_CINR_REPORT 5
#define REP_RSP_REPORT_RSSI_REPORT 6
/* REP-RSP channel type report subtypes */
#define REP_RSP_CHANNEL_TYPE_SUBCHANNEL 1
#define REP_RSP_CHANNEL_TYPE_BAND_AMC 2
#define REP_RSP_CHANNEL_TYPE_SAFETY_CHANNEL 3
#define REP_RSP_CHANNEL_TYPE_ENHANCED_BAND_AMC 4
#define REP_RSP_CHANNEL_TYPE_SOUNDING 5
/* REP-RSP zone-specific physical CINR report subtypes */
#define REP_RSP_ZONE_SPECIFIC_PHY_CINR_PUSC_SC0 1
#define REP_RSP_ZONE_SPECIFIC_PHY_CINR_PUSC_SC1 2
#define REP_RSP_ZONE_SPECIFIC_PHY_CINR_FUSC 3
#define REP_RSP_ZONE_SPECIFIC_PHY_CINR_OPTIONAL_FUSC 4
#define REP_RSP_ZONE_SPECIFIC_PHY_CINR_SAFETY_CHANNEL 5
#define REP_RSP_ZONE_SPECIFIC_PHY_CINR_AMC 6
/* REP-RSP preamble physical CINR report subtypes */
#define REP_RSP_PREAMBLE_PHY_CINR_CONFIGURATION1 1
#define REP_RSP_PREAMBLE_PHY_CINR_CONFIGURATION3 2
#define REP_RSP_PREAMBLE_PHY_CINR_BAND_AMC 3
/* REP-RSP zone-specific effective CINR report subtypes */
#define REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_PUSC_SC0 1
#define REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_PUSC_SC1 2
#define REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_FUSC 3
#define REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_OPTIONAL_FUSC 4
#define REP_RSP_ZONE_SPECIFIC_EFFECTIVE_CINR_AMC_AAS 5
/* REP-RSP preamble effective CINR report subtypes */
#define REP_RSP_PREAMBLE_EFFECTIVE_CINR_CONFIGURATION1 1
#define REP_RSP_PREAMBLE_EFFECTIVE_CINR_CONFIGURATION3 2
#define REP_RSP_CHANNEL_SELECTIVITY 3
/* REP-RSP channel selectivity report subtypes */
#define FREQUENCY_SELECTIVITY_REPORT 1
/* REG types (Section 11.7) */
#define REG_ARQ_PARAMETERS 1
#define REG_SS_MGMT_SUPPORT 2
#define REG_IP_MGMT_MODE 3
#define REG_IP_VERSION 4
#define REG_REQ_SECONDARY_MGMT_CID 5
#define REG_RSP_SECONDARY_MGMT_CID 5
#define REG_UL_TRANSPORT_CIDS_SUPPORTED 6
#define REG_IP_PHS_SDU_ENCAP 7
#define REG_MAX_CLASSIFIERS_SUPPORTED 8
#define REG_PHS_SUPPORT 9
#define REG_ARQ_SUPPORT 10
#define REG_DSX_FLOW_CONTROL 11
#define REG_MAC_CRC_SUPPORT 12
#define REG_MCA_FLOW_CONTROL 13
#define REG_MCAST_POLLING_CIDS 14
#define REG_NUM_DL_TRANS_CID 15
#if 0 /* WIMAX_16E_2005 changes this to SBC scope */
#define REG_PKM_FLOW_CONTROL 15
#define REG_AUTH_POLICY_SUPPORT 16
#define REG_MAX_SECURITY_ASSOCIATIONS 17
#endif
#if 0 /* TODO: scope has been changed to SBC scope */
#define REG_DL_TRANSPORT_CIDS_SUPPORTED 15
#endif
#define REG_MAC_ADDRESS 18
#define REG_TLV_T_20_MAX_MAC_DATA_PER_FRAME_SUPPORT 20
#define REG_TLV_T_20_1_MAX_MAC_LEVEL_DATA_PER_DL_FRAME 1
#define REG_TLV_T_20_2_MAX_MAC_LEVEL_DATA_PER_UL_FRAME 2
#define REG_TLV_T_21_PACKING_SUPPORT 21
#define REG_TLV_T_22_MAC_EXTENDED_RTPS_SUPPORT 22
#define REG_TLV_T_23_MAX_NUM_BURSTS_TRANSMITTED_CONCURRENTLY_TO_THE_MS 23
#define REG_RSP_TLV_T_24_CID_UPDATE_ENCODINGS 24
#define REG_RSP_TLV_T_24_1_CID_UPDATE_ENCODINGS_NEW_CID 1
#define REG_RSP_TLV_T_24_2_CID_UPDATE_ENCODINGS_SFID 2
#define REG_RSP_TLV_T_24_3_CID_UPDATE_ENCODINGS_CONNECTION_INFO 3
#define REG_RSP_TLV_T_25_COMPRESSED_CID_UPDATE_ENCODINGS 25
#define REG_TLV_T_26_METHOD_FOR_ALLOCATING_IP_ADDR_SECONDARY_MGMNT_CONNECTION 26
#define REG_TLV_T_27_HANDOVER_SUPPORTED 27
#define REG_RSP_TLV_T_28_HO_SYSTEM_RESOURCE_RETAIN_TIME 28
#define REG_TLV_T_29_HO_PROCESS_OPTIMIZATION_MS_TIMER 29
#define REG_RSP_TLV_T_30_MS_HANDOVER_RETRANSMISSION_TIMER 30
#define REG_TLV_T_31_MOBILITY_FEATURES_SUPPORTED 31
#define REG_REQ_TLV_T_32_SLEEP_MODE_RECOVERY_TIME 32
#define REG_REQ_TLV_T_33_MS_PREV_IP_ADDR 33
#define REG_RSP_TLV_T_34_SKIP_ADDR_ACQUISITION 34
#define REG_RSP_TLV_T_35_SAID_UPDATE_ENCODINGS 35
#define REG_RSP_TLV_T_35_1_NEW_SAID 1
#define REG_RSP_TLV_T_35_2_OLD_SAID 2
#define REG_RSP_TLV_T_36_TOTAL_PROVISIONED_SERVICE_FLOW_DSAs 36
#define REG_TLV_T_37_IDLE_MODE_TIMEOUT 37
#define REG_RSP_TLV_T_38_SA_TEK_UPDATE 38
#define REG_RSP_TLV_T_38_1_SA_TEK_UPDATE_TYPE 1
#define REG_RSP_TLV_T_38_2_NEW_SAID 2
#define REG_RSP_TLV_T_38_3_OLD_SAID 3
#define REG_RSP_TLV_T_38_4_OLD_TEK_PARAMETERS 4
#define REG_RSP_TLV_T_38_5_NEW_TEK_GTEK_PARAMETERS 5
#define REG_RSP_TLV_T_38_6_GKEK_PARAMETERS 6
#define REG_RSP_TLV_T_39_GKEK_PARAMETERS 39
#define REG_TLV_T_40_ARQ_ACK_TYPE 40
#define REG_TLV_T_41_MS_HO_CONNECTIONS_PARAM_PROCESSING_TIME 41
#define REG_TLV_T_42_MS_HO_TEK_PROCESSING_TIME 42
#define REG_TLV_T_43_MAC_HEADER_AND_EXTENDED_SUBHEADER_SUPPORT 43
#define REG_RSP_TLV_T_44_SN_REPORTING_BASE 44
#define REG_REQ_TLV_T_45_MS_PERIODIC_RANGING_TIMER_INFO 45
#define REG_HANDOVER_INDICATION_READINESS_TIMER 46
#define REG_REQ_BS_SWITCHING_TIMER 47
#define REG_POWER_SAVING_CLASS_CAPABILITY 48
/* PKM types (Table 370) */
#define PKM_ATTR_DISPLAY_STRING 6
#define PKM_ATTR_AUTH_KEY 7
#define PKM_ATTR_TEK 8
#define PKM_ATTR_KEY_LIFE_TIME 9
#define PKM_ATTR_KEY_SEQ_NUM 10
#define PKM_ATTR_HMAC_DIGEST 11
#define PKM_ATTR_SAID 12
#define PKM_ATTR_TEK_PARAM 13
#define PKM_ATTR_CBC_IV 15
#define PKM_ATTR_ERROR_CODE 16
#define PKM_ATTR_CA_CERTIFICATE 17
#define PKM_ATTR_SS_CERTIFICATE 18
#define PKM_ATTR_SECURITY_CAPABILITIES 19
#define PKM_ATTR_CRYPTO_SUITE 20
#define PKM_ATTR_CRYPTO_LIST 21
#define PKM_ATTR_VERSION 22
#define PKM_ATTR_SA_DESCRIPTOR 23
#define PKM_ATTR_SA_TYPE 24
#define PKM_ATTR_SECURITY_NEGOTIATION_PARAMETERS 25
#define PKM_ATTR_PKM_CONFIG_SETTINGS 27
#define PKM_ATTR_PKM_EAP_PAYLOAD 28
#define PKM_ATTR_PKM_NONCE 29
#define PKM_ATTR_AUTH_RESULT_CODE 30
#define PKM_ATTR_SA_SERVICE_TYPE 31
#define PKM_ATTR_FRAME_NUMBER 32
#define PKM_ATTR_SS_RANDOM 33
#define PKM_ATTR_BS_RANDOM 34
#define PKM_ATTR_PRE_PAK 35
#define PKM_ATTR_PAK_AK_SEQ_NUMBER 36
#define PKM_ATTR_BS_CERTIFICATE 37
#define PKM_ATTR_SIG_BS 38
#define PKM_ATTR_MS_MAC_ADDRESS 39
#define PKM_ATTR_CMAC_DIGEST 40
#define PKM_ATTR_KEY_PUSH_MODES 41
#define PKM_ATTR_KEY_PUSH_COUNTER 42
#define PKM_ATTR_GKEK 43
#define PKM_ATTR_SIG_SS 44
#define PKM_ATTR_AKID 45
#define PKM_ATTR_ASSOCIATED_GKEK_SEQ_NUM 46
#define PKM_ATTR_GKEK_PARAMETERS 47
#define PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZE_WAIT_TIMEOUT 1
#define PKM_ATTR_PKM_CONFIG_SETTINGS_REAUTHORIZE_WAIT_TIMEOUT 2
#define PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZATION_GRACE_TIME 3
#define PKM_ATTR_PKM_CONFIG_SETTINGS_OPERATIONAL_WAIT_TIMEOUT 4
#define PKM_ATTR_PKM_CONFIG_SETTINGS_REKEY_WAIT_TIMEOUT 5
#define PKM_ATTR_PKM_CONFIG_SETTINGS_TEK_GRACE_TIME 6
#define PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZE_REJECT_WAIT_TIMEOUT 7
#define PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PKM_VERSION_SUPPORT 1
#define PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_AUTHORIZATION_POLICY_SUPPORT 2
#define PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_MESSAGE_AUTHENTICATION_CODE 3
#define PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PN_WINDOW_SIZE 4
#define PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PKM_FLOW_CONTROL 5
#define PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_MAX_SUPPT_SECURITY_ASSNS 6
/* Common TLV Encoding types (Table 346) */
#define SHORT_HMAC_TUPLE_COR2 140
#define CMAC_TUPLE 141
#define VENDOR_SPECIFIC_INFO 143
#define VENDOR_ID_ENCODING 144
#define DSx_UPLINK_FLOW 145
#define DSx_DOWNLINK_FLOW 146
#define CURRENT_TX_POWER 147
#define MAC_VERSION_ENCODING 148
#define HMAC_TUPLE 149
#define SHORT_HMAC_TUPLE 150
/* Section 11.13.18 */
#define ARQ_ENABLE 18
#define ARQ_WINDOW_SIZE 19
#define ARQ_TRANSMITTER_DELAY 20
#define ARQ_RECEIVER_DELAY 21
#define ARQ_BLOCK_LIFETIME 22
#define ARQ_SYNC_LOSS_TIMEOUT 23
#define ARQ_DELIVER_IN_ORDER 24
#define ARQ_RX_PURGE_TIMEOUT 25
#define ARQ_BLOCK_SIZE 26
/* Section 6.2.3.2.26 */
/* Service Flow Encodings (SFE) (Table 383) */
#define SFE_SF_ID 1
#define SFE_CID 2
#define SFE_SERVICE_CLASS_NAME 3
#define SFE_MBS_SERVICE 4
#define SFE_QOS_PARAMS_SET 5
#define SFE_TRAFFIC_PRIORITY 6
#define SFE_MAX_STR 7
#define SFE_MAX_TRAFFIC_BURST 8
#define SFE_MIN_RTR 9
#define SFE_RESERVED_10 10
#define SFE_UL_SCHEDULING 11
#define SFE_TX_POLICY 12
#define SFE_TOLERATED_JITTER 13
#define SFE_MAX_LATENCY 14
#define SFE_FIXED_LEN_SDU 15
#define SFE_SDU_SIZE 16
#define SFE_TARGET_SAID 17
#define SFE_ARQ_ENABLE 18
#define SFE_ARQ_WINDOW_SIZE 19
#define SFE_ARQ_TRANSMITTER_DELAY 20
#define SFE_ARQ_RECEIVER_DELAY 21
#define SFE_ARQ_BLOCK_LIFETIME 22
#define SFE_ARQ_SYNC_LOSS_TIMEOUT 23
#define SFE_ARQ_DELIVER_IN_ORDER 24
#define SFE_ARQ_RX_PURGE_TIMEOUT 25
#define SFE_ARQ_BLOCK_SIZE 26
#define SFE_RESERVED_27 27
#define SFE_CS_SPECIFICATION 28
#define SFE_TYPE_OF_DATA_DELIVERY_SERVICES 29
#define SFE_SDU_INTER_ARRIVAL_INTERVAL 30
#define SFE_TIME_BASE 31
#define SFE_PAGING_PREFERENCE 32
#define SFE_MBS_ZONE_IDENTIFIER_ASSIGNMENT 33
#define SFE_RESERVED_34 34
#define SFE_GLOBAL_SERVICE_CLASS_NAME 35
#define SFE_RESERVED_36 36
#define SFE_SN_FEEDBACK_ENABLED 37
#define SFE_FSN_SIZE 38
#define SFE_CID_ALLOCATION_FOR_ACTIVE_BS 39
#define SFE_UNSOLICITED_GRANT_INTERVAL 40
#define SFE_UNSOLOCITED_POLLING_INTERVAL 41
#define SFE_PDU_SN_EXT_SUBHEADER_HARQ_REORDER 42
#define SFE_MBS_CONTENTS_ID 43
#define SFE_HARQ_SERVICE_FLOWS 44
#define SFE_AUTHORIZATION_TOKEN 45
#define SFE_HARQ_CHANNEL_MAPPING 46
/* Convergence Servicerameter Encoding Rules (Section 11.13.19.2) */
#define SFE_CSPER_ATM 99
#define SFE_CSPER_PACKET_IPV4 100
#define SFE_CSPER_PACKET_IPV6 101
#define SFE_CSPER_PACKET_802_3 102
#define SFE_CSPER_PACKET_802_1Q 103
#define SFE_CSPER_PACKET_IPV4_802_3 104
#define SFE_CSPER_PACKET_IPV6_802_3 105
#define SFE_CSPER_PACKET_IPV4_802_1Q 106
#define SFE_CSPER_PACKET_IPV6_802_1Q 107
#define SFE_CSPER_PACKET_IP_ROCH_COMPRESSION 108
#define SFE_CSPER_PACKET_IP_ECRTP_COMPRESSION 109
#define SFE_CSPER_PACKET_IP_802_3_ROCH_COMPRESSION 110
#define SFE_CSPER_PACKET_IP_802_3_ECRTP_COMPRESSION 111
/* Section 11.13.19.3 */
#define CST_CLASSIFIER_ACTION 1
#define CST_CLASSIFIER_ERROR_PARAM_SET 2
#define CST_PACKET_CLASSIFICATION_RULE 3
#define CST_PHS_DSC_ACTION 4
#define CST_PHS_ERROR_PARAM_SET 5
#define CST_PHS_RULE 6
/* Section 11.13.19.3.3 */
#define CST_ERROR_SET_ERRORED_PARAM 1
#define CST_ERROR_SET_ERROR_CODE 2
#define CST_ERROR_SET_ERROR_MSG 3
/* Section 11.13.19.4 */
#define CST_ATM_SWITCHING 1
#define CST_ATM_CLASSIFIER 2
#define CST_ATM_CLASSIFIER_DSC_ACTION 3
#define CST_ATM_CLASSIFIER_ERROR_PARAMETER_SET 4
#define ATM_VPI_CLASSIFIER 1
#define ATM_VCI_CLASSIFIER 2
#define ATM_CLASSIFIER_ID 3
/* Section 11.13.19.3.4 */
#define CST_PKT_CLASS_RULE_PRIORITY 1
#define CST_PKT_CLASS_RULE_RANGE_MASK 2
#define CST_PKT_CLASS_RULE_PROTOCOL 3
#define CST_PKT_CLASS_RULE_SRC_IP 4
#define CST_PKT_CLASS_RULE_DST_IP 5
#define CST_PKT_CLASS_RULE_SRCPORT_RANGE 6
#define CST_PKT_CLASS_RULE_DSTPORT_RANGE 7
#define CST_PKT_CLASS_RULE_DST_MAC 8
#define CST_PKT_CLASS_RULE_SRC_MAC 9
#define CST_PKT_CLASS_RULE_ETHERTYPE 10
#define CST_PKT_CLASS_RULE_USER_PRIORITY 11
#define CST_PKT_CLASS_RULE_VLAN_ID 12
#define CST_PKT_CLASS_RULE_PHSI 13
#define CST_PKT_CLASS_RULE_INDEX 14
#define CST_PKT_CLASS_RULE_IPv6_FLOW_LABEL 15
#define CST_PKT_CLASS_RULE_LARGE_CONTEXT_ID 16
#define CST_PKT_CLASS_RULE_SHORT_FORMAT_CONTEXT_ID 18
#define CST_CLASSIFIER_ACTION_RULE 19
#define CST_PKT_CLASS_RULE_VENDOR_SPEC 143
/* Section 11.13.19.3.7 */
#define CST_PHS_PHSI 1
#define CST_PHS_PHSF 2
#define CST_PHS_PHSM 3
#define CST_PHS_PHSS 4
#define CST_PHS_PHSV 5
#define CST_PHS_VENDOR_SPEC 143
#endif /* WIMAX_MAC_H */ |
C | wireshark/plugins/epan/wimax/wimax_pdu_decoder.c | /* wimax_pdu_decoder.c
* WiMax PDU Burst decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "crc.h"
#include "wimax-int.h"
#include "wimax_utils.h"
extern gint proto_wimax;
void proto_reg_handoff_wimax_pdu(void);
static dissector_handle_t mac_generic_decoder_handle = NULL;
static dissector_handle_t mac_header_type1_handle = NULL;
static dissector_handle_t mac_header_type2_handle = NULL;
static dissector_handle_t wimax_harq_map_handle = NULL;
#define WIMAX_PDU_PADDING_MASK 0xFF
#define WIMAX_INVALID_PDU_MASK 0xF0
#define WIMAX_MAP_TYPE_MASK 0xE0 /* 0b111 */
#define WIMAX_HARQ_MAP_MSG_IND 0xE0 /* 0b111 */
#define WIMAX_COMPRESSED_DL_MAP_IND 0xC0 /* 0b110 */
#define REDUCED_PRIVATE_MAP_MASK 0x0C /* 0b11 */
#define WIMAX_MAC_HEADER_SIZE 6
#define WIMAX_MAC_HEADER_INFO_FIELDS 5
#define WIMAX_MAC_HEADER_HT_FIELD 0x80
#define WIMAX_MAC_HEADER_EC_FIELD 0x40
#define WIMAX_MAC_HEADER_LENGTH_MSB_MASK 0x07
#define WIMAX_HARQ_MAP_MSG_LENGTH_MASK1 0x07FC
/* Global Variables. */
gboolean first_gmh;
static gint proto_wimax_pdu_decoder = -1;
static gint ett_wimax_pdu_decoder = -1;
static int hf_wimax_value_bytes = -1;
static int dissect_wimax_pdu_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset;
guint mac_ht, mac_ec;
guint first_byte, length;
guint mac_hcs, mac_hcs_calculated;
proto_item *pdu_item = NULL;
proto_tree *pdu_tree = NULL;
#ifndef STATIC_DATA
/* generate the table of CRC32 remainders for all possible bytes */
wimax_mac_gen_crc32_table();
/* generate the table of CRC8 remainders for all possible bytes */
wimax_mac_gen_crc8_table();
#endif
/* parsing the PDU burst */
for(offset = 0; offset < tvb_reported_length(tvb); )
{
if (offset == 0)
{
first_gmh = TRUE;
}
else
{
first_gmh = FALSE;
}
/* get the length of the remainder */
length = tvb_reported_length_remaining(tvb, offset);
/* get the first byte at offset */
first_byte = tvb_get_guint8(tvb, offset);
/* check for padding */
if(first_byte == WIMAX_PDU_PADDING_MASK)
{ /* Padding */
/* display message */
pdu_item = proto_tree_add_protocol_format(tree, proto_wimax_pdu_decoder, tvb, offset, length, "Padding (%u bytes)", length);
/* add subtree */
pdu_tree = proto_item_add_subtree(pdu_item, ett_wimax_pdu_decoder);
/* display the padding in Hex */
proto_tree_add_item(pdu_tree, hf_wimax_value_bytes, tvb, offset, length, ENC_NA);
break;
}
else if((first_byte & WIMAX_MAP_TYPE_MASK) == WIMAX_HARQ_MAP_MSG_IND)
{ /* HARQ MAP message (no mac header) */
/* get the HARQ MAp Message Length */
length = ((tvb_get_ntohs(tvb, offset) & WIMAX_HARQ_MAP_MSG_LENGTH_MASK1) >> 2);
if (length == 0)
{
length = 3; /* At least 3 bytes. This prevents endless loop */
}
call_dissector(wimax_harq_map_handle, tvb_new_subset_length(tvb,offset,length), pinfo, tree);
offset += length;
continue;
}
else if((first_byte & WIMAX_MAP_TYPE_MASK) == WIMAX_COMPRESSED_DL_MAP_IND)
{
if(is_down_link(pinfo))
{ /* decode compressed dl-map without mac header */
if ((first_byte & REDUCED_PRIVATE_MAP_MASK) == REDUCED_PRIVATE_MAP_MASK)
{
length = wimax_decode_dlmap_reduced_aas(tvb, pinfo, tree);
}
else
{
length = wimax_decode_dlmapc(tvb, pinfo, tree);
}
offset += length;
continue;
}
}
else if((first_byte & WIMAX_INVALID_PDU_MASK) == WIMAX_INVALID_PDU_MASK)
{ /* Invalid PDU */
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid PDU");
/* display message */
pdu_item = proto_tree_add_protocol_format(tree, proto_wimax_pdu_decoder, tvb, offset, length, "Invalid PDU (%u bytes)", length);
/* add subtree */
pdu_tree = proto_item_add_subtree(pdu_item, ett_wimax_pdu_decoder);
/* display the invalid MAC Header in Hex */
proto_tree_add_item(pdu_tree, hf_wimax_value_bytes, tvb, offset, length, ENC_NA);
break;
}
/* calculate the MAC header HCS */
mac_hcs_calculated = wimax_mac_calc_crc8(tvb_get_ptr(tvb, offset, WIMAX_MAC_HEADER_INFO_FIELDS), WIMAX_MAC_HEADER_INFO_FIELDS);
/* get the Header Check Sequence (HCS) in the header */
mac_hcs = tvb_get_guint8(tvb, offset + WIMAX_MAC_HEADER_SIZE - 1);
/* verify the HCS */
if(mac_hcs != mac_hcs_calculated)
{
/* update the info column */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "MAC Header CRC error");
/* display message */
pdu_item = proto_tree_add_protocol_format(tree, proto_wimax_pdu_decoder, tvb, offset, WIMAX_MAC_HEADER_SIZE, "MAC Header CRC error %X (in header) and %X (calculated)", mac_hcs, mac_hcs_calculated);
/* add subtree */
pdu_tree = proto_item_add_subtree(pdu_item, ett_wimax_pdu_decoder);
/* display the bad MAC Header in Hex */
proto_tree_add_item(pdu_tree, hf_wimax_value_bytes, tvb, offset, length, ENC_NA);
break;
}
/* get the Header Type (HT) */
mac_ht = ((first_byte & WIMAX_MAC_HEADER_HT_FIELD)?1:0);
/* get the Encryption Control (EC) */
mac_ec = ((first_byte & WIMAX_MAC_HEADER_EC_FIELD)?1:0);
/* update the MAC length for Generic MAC frame */
if(!mac_ht)
{ /* Generic MAC Header with payload */
/* get the MAC length */
length = (tvb_get_guint8(tvb, offset+1) & WIMAX_MAC_HEADER_LENGTH_MSB_MASK);
length = ((length<<8) | tvb_get_guint8(tvb, offset+2));
}
else /* MAC signaling Headers or Bandwidth Request Headers */
{ /* set the mac length */
length = WIMAX_MAC_HEADER_SIZE;
}
/* display PDU frame info */
/*
pdu_item = proto_tree_add_protocol_format(tree, proto_wimax_pdu_decoder, tvb, offset, length, "PDU Frame (%u bytes)", length);
*/
pdu_item = proto_tree_add_protocol_format(tree, proto_wimax_pdu_decoder, tvb, offset, length, "PDU (%u bytes)", length);
/* add PDU subtree */
pdu_tree = proto_item_add_subtree(pdu_item, ett_wimax_pdu_decoder);
if (length == 0) {
offset += 6; /* Add header size. */
/* Must skip the code below or tvb_new_subset_length()
* keeps allocating memory until it runs out. */
continue;
}
/* process the valid MAC header */
if(mac_ht)
{ /* MAC signaling Headers or Bandwidth Request Headers */
/* check the header type */
if(mac_ec)
{ /* MAC Signaling Header Type II Header */
proto_item_append_text(pdu_item, " - Mac Type II Header: ");
call_dissector(mac_header_type2_handle, tvb_new_subset_length(tvb,offset,length), pinfo, pdu_tree);
}
else
{ /* MAC Signaling Header Type I Header */
proto_item_append_text(pdu_item, " - Mac Type I Header: ");
call_dissector(mac_header_type1_handle, tvb_new_subset_length(tvb,offset,length), pinfo, pdu_tree);
}
}
else /* Generic MAC Header with payload */
{
call_dissector(mac_generic_decoder_handle, tvb_new_subset_length(tvb,offset,length), pinfo, pdu_tree);
}
offset += length;
}
return tvb_captured_length(tvb);
}
/* Register Wimax PDU Burst Protocol */
void wimax_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, proto_wimax_pdu_decoder);
proto_register_field_array(proto_wimax_pdu_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
void
wimax_proto_reg_handoff_wimax_pdu(void)
{
mac_generic_decoder_handle = find_dissector("mac_header_generic_handler");
mac_header_type1_handle = find_dissector("mac_header_type_1_handler");
mac_header_type2_handle = find_dissector("mac_header_type_2_handler");
wimax_harq_map_handle = find_dissector("wimax_harq_map_handler");
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/wimax_phy_attributes_decoder.c | /* wimax_phy_attributes_decoder.c
* WiMax PDU Burst Physical Attributes decoder
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/* Include files */
#include "config.h"
#include <epan/packet.h>
#include "wimax-int.h"
extern gint proto_wimax;
static gint proto_wimax_phy_attributes_decoder = -1;
static gint ett_wimax_phy_attributes_decoder = -1;
static const value_string vals_subchannel_types[] =
{
{ 0, "DL PUSC"},
{ 1, "DL FUSC"},
{16, "UL PUSC"},
{0, NULL}
};
static const value_string vals_modulation_rates[] =
{
{0, "BPSK R=1/2"},
{1, "QPSK R=1/2"},
{2, "QPSK R=3/4"},
{3, "16-QAM R=1/2"},
{4, "16-QAM R=3/4"},
{5, "64-QAM R=1/2"},
{6, "64-QAM R=2/3"},
{7, "64-QAM R=3/4"},
{8, "64-QAM R=5/6"},
{0, NULL}
};
static const value_string vals_encoding_types[] =
{
{0, "Tail biting convolutional coding (CCTB)"},
{1, "Convolutional turbo coding (CTC)"},
{0, NULL}
};
static gint hf_phy_attributes_subchannelization_type = -1;
static gint hf_phy_attributes_permbase = -1;
static gint hf_phy_attributes_modulation_rate = -1;
static gint hf_phy_attributes_encoding_type = -1;
static gint hf_phy_attributes_num_repeat = -1;
static gint hf_phy_attributes_symbol_offset = -1;
static gint hf_phy_attributes_num_of_slots = -1;
static gint hf_phy_attributes_subchannel = -1;
static int dissect_wimax_phy_attributes_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint offset = 0;
guint tvb_len;
/* guint num_of_slots;*/
proto_item *phy_item = NULL;
proto_tree *phy_tree = NULL;
/* update the info column */
/*col_append_str(pinfo->cinfo, COL_INFO, "PDU Burst Physical Attributes:");*/
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PHY-attr");
if (tree)
{ /* we are being asked for details */
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* display PDU Burst Physical Attributes dissector info */
phy_item = proto_tree_add_protocol_format(tree, proto_wimax_phy_attributes_decoder, tvb, offset, tvb_len, "PDU Burst Physical Attributes (%u bytes)", tvb_len);
/* add PDU Burst Physical Attributes subtree */
phy_tree = proto_item_add_subtree(phy_item, ett_wimax_phy_attributes_decoder);
/* display the subchannelization type */
proto_tree_add_item(phy_tree, hf_phy_attributes_subchannelization_type, tvb, offset++, 1, ENC_BIG_ENDIAN);
/* display the permbase */
proto_tree_add_item(phy_tree, hf_phy_attributes_permbase, tvb, offset++, 1, ENC_BIG_ENDIAN);
/* display the modulation rate */
proto_tree_add_item(phy_tree, hf_phy_attributes_modulation_rate, tvb, offset++, 1, ENC_BIG_ENDIAN);
/* display the encoding type */
proto_tree_add_item(phy_tree, hf_phy_attributes_encoding_type, tvb, offset++, 1, ENC_BIG_ENDIAN);
/* display the numRepeat */
proto_tree_add_item(phy_tree, hf_phy_attributes_num_repeat, tvb, offset++, 1, ENC_BIG_ENDIAN);
/* display the symbol offset */
proto_tree_add_item(phy_tree, hf_phy_attributes_symbol_offset, tvb, offset++, 1, ENC_BIG_ENDIAN);
/* display the number of slots */
proto_tree_add_item(phy_tree, hf_phy_attributes_num_of_slots, tvb, offset, 2, ENC_BIG_ENDIAN);
/* get the number of slots */
/* num_of_slots = tvb_get_guint16(tvb, offset);*/
/* move to next field */
offset += 2;
/* display the physical subchannel list */
while(offset < tvb_len)
{
proto_tree_add_item(phy_tree, hf_phy_attributes_subchannel, tvb, offset++, 1, ENC_BIG_ENDIAN);
}
}
return tvb_captured_length(tvb);
}
/* Register Wimax PDU Burst Physical Attributes Protocol */
void wimax_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, proto_wimax_phy_attributes_decoder);
proto_register_field_array(proto_wimax_phy_attributes_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C | wireshark/plugins/epan/wimax/wimax_tlv.c | /* wimax_tlv.c
* WiMax TLV handling functions
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include "wimax_tlv.h"
/*************************************************************/
/* init_tlv_info() */
/* retrive the tlv information from specified tvb and offset */
/* parameter: */
/* info - pointer of a tlv information data structure */
/* return: */
/* 0-success */
/* !=0-the invalid size of the TLV length (failed) */
/*************************************************************/
gint init_tlv_info(tlv_info_t *info, tvbuff_t *tvb, gint offset)
{
guint tlv_len;
/* get TLV type */
info->type = (guint8)tvb_get_guint8( tvb, offset );
/* get TLV length */
tlv_len = (guint)tvb_get_guint8( tvb, (offset + 1) );
/* set the TLV value offset */
info->value_offset = 2;
/* adjust for multiple-byte TLV length */
if((tlv_len & WIMAX_TLV_EXTENDED_LENGTH_MASK) != 0)
{ /* multiple bytes TLV length */
info->length_type = 1;
/* get the size of the TLV length */
tlv_len = (tlv_len & WIMAX_TLV_LENGTH_MASK);
info->size_of_length = tlv_len;
/* update the TLV value offset */
info->value_offset += tlv_len;
switch (tlv_len)
{
case 0:
info->length = 0; /* no length */
break;
case 1:
info->length = (gint32)tvb_get_guint8( tvb, (offset + 2) ); /* 8 bit */
break;
case 2:
info->length = (gint32)tvb_get_ntohs( tvb, (offset + 2) ); /* 16 bit */
break;
case 3:
info->length = (gint32)tvb_get_ntoh24( tvb, (offset + 2) ); /* 24 bit */
break;
case 4:
info->length = (gint32)tvb_get_ntohl( tvb, (offset + 2) ); /* 32 bit */
break;
default:
/* mark invalid tlv */
info->valid = 0;
/* failed, return the invalid size of the tlv length */
return (gint)tlv_len;
break;
}
}
else /* single byte length */
{
info->length_type = 0;
info->size_of_length = 0;
info->length = (gint32)tlv_len;
}
/* mark valid tlv */
info->valid = 1;
/* success */
return 0;
}
/*************************************************************/
/* get_tlv_type() */
/* get the tlv type of the specified tlv information */
/* parameter: */
/* info - pointer of a tlv information data structure */
/* return: */
/* >=0 - TLV type */
/* =-1 - invalid tlv info */
/*************************************************************/
gint get_tlv_type(tlv_info_t *info)
{
if(info->valid)
return (gint)info->type;
return -1;
}
/**************************************************************/
/* get_tlv_size_of_length() */
/* get the size of tlv length of the specified tlv information*/
/* parameter: */
/* info - pointer of a tlv information data structure */
/* return: */
/* >=0 - the size of TLV length */
/* =-1 - invalid tlv info */
/**************************************************************/
gint get_tlv_size_of_length(tlv_info_t *info)
{
if(info->valid)
return (gint)info->size_of_length;
return -1;
}
/*************************************************************/
/* get_tlv_length() */
/* get the tlv length of the specified tlv information */
/* parameter: */
/* info - pointer of a tlv information data structure */
/* return: */
/* >=0 - TLV length */
/* =-1 - invalid tlv info */
/*************************************************************/
gint32 get_tlv_length(tlv_info_t *info)
{
if(info->valid)
return (gint32)info->length;
return -1;
}
/*************************************************************/
/* get_tlv_value_offset() */
/* get the tlv value offset of the specified tlv information */
/* parameter: */
/* info - pointer of a tlv information data structure */
/* return: */
/* >0 - TLV value offset in byte */
/* =-1 - invalid tlv info */
/*************************************************************/
gint get_tlv_value_offset(tlv_info_t *info)
{
if(info->valid)
return (gint)info->value_offset;
return -1;
}
/*************************************************************/
/* get_tlv_length_type() */
/* get the tlv length type of the specified tlv information */
/* parameter: */
/* info - pointer of a tlv information data structure */
/* return: */
/* 0 - single byte TLV length */
/* 1 - multiple bytes TLV length */
/*************************************************************/
gint get_tlv_length_type(tlv_info_t *info)
{
if(info->valid)
return (gint)info->length_type;
return -1;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C/C++ | wireshark/plugins/epan/wimax/wimax_tlv.h | /* wimax_tlv.h
* WiMax TLV handling function header file
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _WIMAX_TLV_H_
#define _WIMAX_TLV_H_
#include <epan/packet.h>
#define WIMAX_TLV_EXTENDED_LENGTH_MASK 0x80
#define WIMAX_TLV_LENGTH_MASK 0x7F
#define MAX_TLV_LEN 64000
typedef struct
{
guint8 valid; /* TLV info status: 0=invalid; 1=valid */
guint8 type; /* TLV type */
guint8 length_type; /* length type: 0=single byte; 1=multiple bytes */
guint8 size_of_length; /* size of the TLV length */
guint value_offset; /* the offset of TLV value field */
gint32 length; /* length of TLV value field */
} tlv_info_t;
gint init_tlv_info(tlv_info_t *info, tvbuff_t *tvb, gint offset);
gint valid_tlv_info(tlv_info_t *info);
gint get_tlv_type(tlv_info_t *info);
gint get_tlv_length_type(tlv_info_t *info);
gint get_tlv_size_of_length(tlv_info_t *info);
gint get_tlv_value_offset(tlv_info_t *info);
gint32 get_tlv_length(tlv_info_t *info);
proto_item *add_tlv_subtree(tlv_info_t *info, proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, const guint encoding);
proto_tree *add_tlv_subtree_no_item(tlv_info_t *info, proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start);
proto_tree *add_protocol_subtree(tlv_info_t *info, gint idx, proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *label);
#endif /* WIMAX_TLV_H */ |
C | wireshark/plugins/epan/wimax/wimax_utils.c | /* wimax_utils.c
* WiMax Utility Decoders
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/*
#define DEBUG
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#include "wimax-int.h"
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
extern gint proto_mac_mgmt_msg_rng_req_decoder;
extern gint proto_mac_mgmt_msg_reg_req_decoder;
extern gint mac_sdu_length; /* declared in packet-wmx.c */
extern gboolean include_cor2_changes;
static gint proto_wimax_utility_decoders = -1;
static gint ett_wimax_service_flow_encodings = -1;
static gint ett_wimax_cst_encoding_rules = -1;
static gint ett_wimax_error_parameter_set = -1;
static gint ett_wimax_hmac_tuple = -1;
static gint ett_wimax_cmac_tuple = -1;
static gint ett_wimax_short_hmac_tuple = -1;
static gint ett_security_negotiation_parameters = -1;
static gint ett_pkm_tlv_encoded_attributes_decoder = -1;
static gint ett_sa_descriptor_decoder = -1;
static gint ett_cryptographic_suite_list_decoder = -1;
static gint ett_security_capabilities_decoder = -1;
static gint ett_vendor_specific_info_decoder = -1;
static gint ett_vendor_id_encoding_decoder = -1;
static gint ett_ul_service_flow_decoder = -1;
static gint ett_dl_service_flow_decoder = -1;
static dissector_handle_t eap_handle = NULL;
const unit_name_string wimax_units_byte_bytes = { " byte", " bytes" };
const unit_name_string wimax_units_bit_sec = { "bits/s", NULL };
const unit_name_string wimax_units_db = { "dB", NULL };
const unit_name_string wimax_units_dbm = { "dBm", NULL };
const unit_name_string wimax_units_frame_frames = { " frame", " frames" };
const unit_name_string wimax_units_frame_offset = { " frame offset", NULL };
const unit_name_string wimax_units_hz = { "Hz", NULL };
const unit_name_string wimax_units_khz = { "kHz", NULL };
const unit_name_string wimax_units_ms = { "ms", NULL };
const unit_name_string wimax_units_ps = { "PS", NULL };
/* The following two variables save the Scheduling Service type for
the Grant Management subheader dissector and track whether or not
one has been seen.
*/
static guint scheduling_service_type = -1;
gint seen_a_service_type = 0;
/* The following two functions set and access the variables above */
guint get_service_type( void )
{
return scheduling_service_type;
}
static void set_service_type( guint set_to )
{
if( seen_a_service_type == 0 ){
scheduling_service_type = set_to;
seen_a_service_type = 1;
}
}
/* Setup protocol subtree array */
static gint *ett[] =
{
&ett_wimax_service_flow_encodings,
&ett_wimax_cst_encoding_rules,
&ett_wimax_error_parameter_set,
&ett_wimax_hmac_tuple,
&ett_wimax_cmac_tuple,
&ett_wimax_short_hmac_tuple,
&ett_security_negotiation_parameters,
&ett_pkm_tlv_encoded_attributes_decoder,
&ett_sa_descriptor_decoder,
&ett_cryptographic_suite_list_decoder,
&ett_security_capabilities_decoder,
&ett_vendor_specific_info_decoder,
&ett_vendor_id_encoding_decoder,
&ett_ul_service_flow_decoder,
&ett_dl_service_flow_decoder,
};
static const value_string vals_mbs_service[] =
{
{0, "No available MBS"},
{1, "Single-BS-MBS"},
{2, "Multi-BS-MBS"},
{0, NULL}
};
static const value_string vals_ul_grant_scheduling[] =
{
{0, "Reserved"},
{1, "Undefined (BS implementation-dependent)"},
{2, "BE (default)"},
{3, "nrtPS"},
{4, "rtPS"},
{5, "Extended rtPS"},
{6, "UGS"},
{0, NULL}
};
static const value_string vals_fixed_len_sdu[] =
{
{0, "Variable-length SDUs (default)"},
{1, "Fixed-length SDUs"},
{0, NULL}
};
static const value_string vals_arq_enable[] =
{
{0, "ARQ not requested/accepted"},
{1, "ARQ requested/accepted"},
{0, NULL}
};
#if 0
static const value_string vals_arq_block_lifetime[] =
{
{0, "Infinite"},
{0, NULL}
};
#endif
static const value_string vals_arq_sync_loss_timeout[] =
{
{0, "Infinite"},
{0, NULL}
};
static const value_string vals_arq_deliver_in_order[] =
{
{0, "Order of delivery is not preserved"},
{1, "Order of delivery is preserved"},
{0, NULL}
};
static const value_string vals_arq_rx_purge_timeout[] =
{
{0, "Infinite"},
{0, NULL}
};
static const value_string vals_fsn_size[] =
{
{0, "3-bit FSN"},
{1, "11-bit FSN (default)"},
{0, NULL}
};
static const value_string vals_sn_fb_enable[] =
{
{0, "Is disabled (default)"},
{1, "Is enabled"},
{0, NULL}
};
static const value_string vals_harq[] =
{
{0, "Non HARQ (default)"},
{1, "HARQ connection" },
{0, NULL}
};
static const value_string vals_cs_specification[] =
{
{ 0, "Reserved"},
{ 1, "Packet, IPv4"},
{ 2, "Packet, IPv6"},
{ 3, "Packet, IEEE 802.3/Ethernet"},
{ 4, "Packet, IEEE 802.1Q VLAN"},
{ 5, "Packet, IPv4 over IEEE 802.3/Ethernet"},
{ 6, "Packet, IPv6 over IEEE 802.3/Ethernet"},
{ 7, "Packet, IPv4 over IEEE 802.1Q VLAN"},
{ 8, "Packet, IPv6 over IEEE 802.1Q VLAN"},
{ 9, "ATM"},
{10, "Packet, IEEE 802.3/Ethernet with ROCH header compression"},
{11, "Packet, IEEE 802.3/Ethernet with ECRTP header compression"},
{12, "Packet, IP2 with ROCH header compression"},
{13, "Packet, IP2 with ECRTP header compression"},
{0, NULL}
};
static const value_string vals_type_of_data_delivery_services[] =
{
{0, "Continuing grant service"},
{1, "Real time variable rate service"},
{2, "Non-real time variable rate service"},
{3, "Best-efforts service"},
{4, "Extended real-time variable rate service"},
{0, NULL}
};
static const value_string vals_paging_preference[] =
{
{0, "No paging generation"},
{1, "Paging generation"},
{0, NULL}
};
static const value_string vals_pdu_sn_ext_subheader[] =
{
{0, "No support for PDU SN in this connection (default)"},
{1, "PDU SN (short) extended Subheader"},
{2, "PDU SN (long) extended Subheader"},
{0, NULL}
};
static const value_string vals_cst_classifier_action[] =
{
{0, "DSC Add Classifier"},
{1, "DSC Replace Classifier"},
{2, "DSC Delete Classifier"},
{0, NULL}
};
static const value_string vals_cst_phs_dsc_action[] =
{
{0, "Add PHS rule"},
{1, "Set PHS rule"},
{2, "Delete PHS rule"},
{3, "Delete all PHS rules"},
{0, NULL}
};
static const value_string vals_verify[] =
{
{0, "Verify"},
{1, "Don't verify"},
{0, NULL}
};
static const value_string vals_atm_switching_encodings[] =
{
{0, "No switching methodology applied"},
{1, "VP switching"},
{2, "VC switching"},
{0, NULL}
};
static const value_string vals_cc[] =
{
{ 0, "OK/success"},
{ 1, "Reject-other"},
{ 2, "Reject-unrecognized-configuration-setting"},
{ 3, "Reject-temporary / reject-resource"},
{ 4, "Reject-permanent / reject-admin"},
{ 5, "Reject-not-owner"},
{ 6, "Reject-service-flow-not-found"},
{ 7, "Reject-service-flow-exists"},
{ 8, "Reject-required-parameter-not-present"},
{ 9, "Reject-header-suppression"},
{10, "Reject-unknown-transaction-id"},
{11, "Reject-authentication-failure"},
{12, "Reject-add-aborted"},
{13, "Reject-exceeded-dynamic-service-limit"},
{14, "Reject-not-authorized-for-the-request-SAID"},
{15, "Reject-fail-to-establish-the-requested-SA"},
{16, "Reject-not-supported-parameter"},
{17, "Reject-not-supported-parameter-value"},
{0, NULL}
};
static const value_string vals_classification_action_rule[] =
{
{0, "None"},
{1, "Discarded packet"},
{0, NULL}
};
static const true_false_string tfs_supported =
{
"supported",
"not supported"
};
#if 0
static const true_false_string disabled_enabled =
{
"enabled",
"disabled"
};
#endif
#if 0
static const true_false_string default_enabled =
{
"enabled",
"use default action"
};
#endif
static const value_string vals_pkm_attr_error_codes[] =
{ /* table 373 */
{0, "All (no information)"},
{1, "Auth Reject Auth Invalid (unauthorized SS)"},
{2, "Auth Reject, Key Reject (unauthorized SAID)"},
{3, "Auth Invalid (unsolicited)"},
{4, "Auth Invalid, TEK Invalid (invalid key sequence number)"},
{5, "Auth Invalid (message (key request) authorization failure)"},
{6, "Auth Reject (permanent authorization failure)"},
{0, NULL}
};
static const value_string vs_sa_type[] =
{
{0, "Primary"},
{1, "Static"},
{2, "Dynamic"},
{0, NULL}
};
static const value_string va_key_push_modes[] =
{
{0, "GKEK update mode"},
{1, "GTEK update mode"},
{0, NULL}
};
#if 0
static const value_string vals_pkm_version[] =
{
{0, "Reserved"},
{1, "PKM (Initial standard release"},
{0, NULL}
};
#endif
static const value_string vs_success_reject[] =
{
{0, "Success"},
{1, "Reject"},
{0, NULL}
};
static const value_string vs_sa_service_type[] =
{
{0, "Unicast service"},
{1, "Group multicast service"},
{2, "MBS service"},
{0, NULL}
};
static const value_string vals_data_encryption_ids[] =
{ /* table 375 */
{0, "No data encryption"},
{1, "CBC-Mode, 56-bit DES"},
{2, "CCM-Mode, 128-bit AES"},
{3, "CBC-Mode, 128-bit AES"},
{128, "CTR-Mode, 128-bit AES for MBS with 8 bit ROC"},
{0, NULL}
};
static const value_string vals_data_authentication_ids[] =
{ /* table 376 */
{0, "No data authentication"},
{1, "CCM-Mode, 128-bit AES"},
{0, NULL}
};
static const value_string vals_tek_encryption_ids[] =
{ /* table 377 */
{0, "No TEK encryption"},
{1, "3-DES EDE with 128-bit key"},
{2, "RSA with 1024-bit key"},
{3, "ECB mode AES with 128-bit key"},
{4, "AES key wrap with 128-bit key"},
{0, NULL}
};
static const value_string vals_dcd_mac_version[] =
{
{1, "Conformance with IEEE Std 802.16-2001"},
{2, "Conformance with IEEE Std 802.16c-2002 and its predecessors"},
{3, "Conformance with IEEE Std 802.16a-2003 and its predecessors"},
{4, "Conformance with IEEE Std 802.16-2004"},
{5, "Conformance with IEEE Std 802.16-2004 and IEEE Std 802.16e-2005"},
{6, "reserved"},
{0, NULL}
};
/* fix fields */
static gint hf_sfe_unknown_type = -1;
static gint hf_sfe_sf_id = -1;
static gint hf_sfe_cid = -1;
static gint hf_sfe_service_class_name = -1;
static gint hf_sfe_mbs_service = -1;
static gint hf_sfe_qos_params_set = -1;
static gint hf_sfe_set_provisioned = -1;
static gint hf_sfe_set_admitted = -1;
static gint hf_sfe_set_active = -1;
static gint hf_sfe_set_rsvd = -1;
static gint hf_sfe_traffic_priority = -1;
static gint hf_sfe_max_str = -1;
static gint hf_sfe_max_traffic_burst = -1;
static gint hf_sfe_min_rtr = -1;
static gint hf_sfe_reserved_10 = -1;
static gint hf_sfe_ul_grant_scheduling = -1;
static gint hf_sfe_req_tx_policy = -1;
static gint hf_sfe_policy_broadcast_bwr = -1;
static gint hf_sfe_policy_multicast_bwr = -1;
static gint hf_sfe_policy_piggyback = -1;
static gint hf_sfe_policy_fragment = -1;
static gint hf_sfe_policy_headers = -1;
static gint hf_sfe_policy_packing = -1;
static gint hf_sfe_policy_crc = -1;
static gint hf_sfe_policy_rsvd1 = -1;
static gint hf_sfe_jitter = -1;
static gint hf_sfe_max_latency = -1;
static gint hf_sfe_fixed_len_sdu = -1;
static gint hf_sfe_sdu_size = -1;
static gint hf_sfe_target_said = -1;
static gint hf_sfe_cs_specification = -1;
static gint hf_sfe_type_of_data_delivery_services = -1;
static gint hf_sfe_sdu_inter_arrival_interval = -1;
static gint hf_sfe_time_base = -1;
static gint hf_sfe_paging_preference = -1;
static gint hf_sfe_mbs_zone_identifier_assignment = -1;
static gint hf_sfe_sn_feedback_enabled = -1;
static gint hf_sfe_harq_service_flows = -1;
static gint hf_sfe_harq_channel_mapping_index = -1;
static gint hf_sfe_fsn_size = -1;
static gint hf_sfe_unsolicited_grant_interval = -1;
static gint hf_sfe_unsolicited_polling_interval = -1;
/* static gint hf_sfe_harq_channel_mapping = -1; */
static gint hf_sfe_global_service_class_name = -1;
static gint hf_sfe_reserved_36 = -1;
static gint hf_sfe_reserved_34 = -1;
static gint hf_sfe_arq_enable = -1;
static gint hf_sfe_arq_transmitter_delay = -1;
static gint hf_sfe_arq_receiver_delay = -1;
static gint hf_sfe_arq_block_lifetime = -1;
static gint hf_sfe_arq_sync_loss_timeout = -1;
static gint hf_sfe_arq_transmitter_delay_cor2 = -1;
static gint hf_sfe_arq_receiver_delay_cor2 = -1;
static gint hf_sfe_arq_block_lifetime_cor2 = -1;
static gint hf_sfe_arq_sync_loss_timeout_cor2 = -1;
static gint hf_sfe_arq_deliver_in_order = -1;
static gint hf_sfe_arq_rx_purge_timeout = -1;
static gint hf_sfe_arq_window_size = -1;
static gint hf_sfe_arq_block_size = -1;
static gint hf_sfe_arq_block_size_cor2 = -1;
static gint hf_sfe_arq_min_block_size = -1;
static gint hf_sfe_arq_max_block_size = -1;
/* static gint hf_sfe_cid_alloc_for_active_bs = -1; */
static gint hf_sfe_cid_alloc_for_active_bs_cid = -1;
static gint hf_sfe_pdu_sn_ext_subheader_reorder = -1;
static gint hf_sfe_mbs_contents_ids = -1;
static gint hf_sfe_mbs_contents_ids_id = -1;
static gint hf_sfe_authorization_token = -1;
static gint hf_cst_classifier_dsc_action = -1;
static gint hf_cst_error_set_errored_param = -1;
static gint hf_cst_error_set_error_code = -1;
static gint hf_cst_error_set_error_msg = -1;
static gint hf_cst_pkt_class_rule = -1;
static gint hf_cst_pkt_class_rule_priority = -1;
static gint hf_cst_pkt_class_rule_range_mask = -1;
static gint hf_cst_pkt_class_rule_tos_low = -1;
static gint hf_cst_pkt_class_rule_tos_high = -1;
static gint hf_cst_pkt_class_rule_tos_mask = -1;
static gint hf_cst_pkt_class_rule_protocol = -1;
/*static gint hf_cst_pkt_class_rule_protocol_number = -1;*/
static gint hf_cst_pkt_class_rule_ip_masked_src_address = -1;
static gint hf_cst_pkt_class_rule_ip_masked_dest_address = -1;
static gint hf_cst_pkt_class_rule_src_ipv4 = -1;
static gint hf_cst_pkt_class_rule_dest_ipv4 = -1;
static gint hf_cst_pkt_class_rule_mask_ipv4 = -1;
static gint hf_cst_pkt_class_rule_src_ipv6 = -1;
static gint hf_cst_pkt_class_rule_dest_ipv6 = -1;
static gint hf_cst_pkt_class_rule_mask_ipv6 = -1;
static gint hf_cst_pkt_class_rule_prot_src_port_range = -1;
static gint hf_cst_pkt_class_rule_src_port_low = -1;
static gint hf_cst_pkt_class_rule_src_port_high = -1;
static gint hf_cst_pkt_class_rule_prot_dest_port_range = -1;
static gint hf_cst_pkt_class_rule_dest_port_low = -1;
static gint hf_cst_pkt_class_rule_dest_port_high = -1;
static gint hf_cst_pkt_class_rule_dest_mac_address = -1;
static gint hf_cst_pkt_class_rule_dest_mac = -1;
static gint hf_cst_pkt_class_rule_src_mac_address = -1;
static gint hf_cst_pkt_class_rule_src_mac = -1;
static gint hf_cst_pkt_class_rule_mask_mac = -1;
static gint hf_cst_pkt_class_rule_ethertype = -1;
static gint hf_cst_pkt_class_rule_etype = -1;
static gint hf_cst_pkt_class_rule_eprot1 = -1;
static gint hf_cst_pkt_class_rule_eprot2 = -1;
static gint hf_cst_pkt_class_rule_user_priority = -1;
static gint hf_cst_pkt_class_rule_pri_low = -1;
static gint hf_cst_pkt_class_rule_pri_high = -1;
static gint hf_cst_pkt_class_rule_vlan_id = -1;
static gint hf_cst_pkt_class_rule_vlan_id1 = -1;
static gint hf_cst_pkt_class_rule_vlan_id2 = -1;
static gint hf_cst_pkt_class_rule_phsi = -1;
static gint hf_cst_pkt_class_rule_index = -1;
static gint hf_cst_pkt_class_rule_ipv6_flow_label = -1;
static gint hf_cst_pkt_class_rule_vendor_spec = -1;
static gint hf_cst_pkt_class_rule_classifier_action_rule = -1;
static gint hf_cst_pkt_class_rule_classifier_action_rule_bit0 = -1;
static gint hf_cst_pkt_class_rule_classifier_action_rule_bit1 = -1;
static gint hf_cst_large_context_id = -1;
static gint hf_cst_short_format_context_id = -1;
static gint hf_cst_phs_dsc_action = -1;
static gint hf_cst_phs_rule = -1;
static gint hf_cst_phs_phsi = -1;
static gint hf_cst_phs_phsf = -1;
static gint hf_cst_phs_phsm = -1;
static gint hf_cst_phs_phss = -1;
static gint hf_cst_phs_phsv = -1;
static gint hf_cst_phs_vendor_spec = -1;
static gint hf_cst_invalid_tlv = -1;
static gint hf_csper_atm_switching_encoding = -1;
static gint hf_csper_atm_classifier = -1;
static gint hf_csper_atm_classifier_vpi = -1;
static gint hf_csper_atm_classifier_vci = -1;
static gint hf_csper_atm_classifier_id = -1;
/*static gint hf_csper_atm_classifier_dsc_action = -1;*/
static gint hf_csper_unknown_type = -1;
static gint hf_xmac_tuple_rsvd = -1;
static gint hf_xmac_tuple_key_seq_num = -1;
static gint hf_hmac_tuple_hmac_digest = -1;
static gint hf_packet_number_counter = -1;
static gint hf_cmac_tuple_cmac_value = -1;
static gint hf_cmac_tuple_bsid = -1;
/* bit masks */
/* 11.13.4 */
#define SFE_QOS_PARAMS_SET_PROVISIONED_SET 0x01
#define SFE_QOS_PARAMS_SET_ADMITTED_SET 0x02
#define SFE_QOS_PARAMS_SET_ACTIVE_SET 0x04
#define SFE_QOS_PARAMS_SET_RESERVED 0xF8
/* 11.13.12 */
#define SFE_REQ_TX_POLICY_BROADCAST_BWR 0x01
#define SFE_REQ_TX_POLICY_MULTICAST_BWR 0x02
#define SFE_REQ_TX_POLICY_PIGGYBACK 0x04
#define SFE_REQ_TX_POLICY_FRAGMENT_DATA 0x08
#define SFE_REQ_TX_POLICY_PAYLOAD_HEADER 0x10
#define SFE_REQ_TX_POLICY_PACKINGS 0x20
#define SFE_REQ_TX_POLICY_CRC 0x40
#define SFE_REQ_TX_POLICY_RESERVED 0x80
/* bit masks */
/* 11.13.19.3.4.17 */
#define CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_BIT0 0x80
#define CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_RSV 0x7F
/* bit masks */
/* 11.1.2 (table 348) */
#define XMAC_TUPLE_RESERVED 0xF0
#define XMAC_TUPLE_KEY_SEQ_NUM 0x0F
/* WiMax Security Negotiation Parameters display */
static gint hf_snp_pkm_version_support = -1;
static gint hf_snp_pkm_version_support_bit0 = -1;
static gint hf_snp_pkm_version_support_bit1 = -1;
static gint hf_snp_pkm_version_support_reserved = -1;
static gint hf_snp_auth_policy_support = -1;
static gint hf_snp_auth_policy_support_bit0 = -1;
static gint hf_snp_auth_policy_support_bit1 = -1;
static gint hf_snp_auth_policy_support_bit2 = -1;
static gint hf_snp_auth_policy_support_bit3 = -1;
static gint hf_snp_auth_policy_support_bit4 = -1;
static gint hf_snp_auth_policy_support_bit5 = -1;
static gint hf_snp_auth_policy_support_bit6 = -1;
static gint hf_snp_auth_policy_support_bit7 = -1;
static gint hf_snp_mac_mode = -1;
static gint hf_snp_mac_mode_bit0 = -1;
static gint hf_snp_mac_mode_bit1 = -1;
static gint hf_snp_mac_mode_bit1_rsvd = -1;
static gint hf_snp_mac_mode_bit2 = -1;
static gint hf_snp_mac_mode_bit3 = -1;
static gint hf_snp_mac_mode_bit4 = -1;
static gint hf_snp_mac_mode_bit5 = -1;
static gint hf_snp_mac_mode_reserved = -1;
static gint hf_snp_mac_mode_reserved1 = -1;
static gint hf_snp_pn_window_size = -1;
static gint hf_snp_max_conc_transactions = -1;
static gint hf_snp_max_suppt_sec_assns = -1;
static gint hf_snp_unknown_type = -1;
/* bit masks */
/* 11.8.4.1 */
#define SNP_PKM_VERSION_SUPPORT_BIT0 0x01
#define SNP_PKM_VERSION_SUPPORT_BIT1 0x02
#define SNP_PKM_VERSION_SUPPORT_RSV 0xFC
/* 11.8.4.2 */
#define SNP_AUTH_POLICY_SUPPORT_BIT0 0x01
#define SNP_AUTH_POLICY_SUPPORT_BIT1 0x02
#define SNP_AUTH_POLICY_SUPPORT_BIT2 0x04
#define SNP_AUTH_POLICY_SUPPORT_BIT3 0x08
#define SNP_AUTH_POLICY_SUPPORT_BIT4 0x10
#define SNP_AUTH_POLICY_SUPPORT_BIT5 0x20
#define SNP_AUTH_POLICY_SUPPORT_BIT6 0x40
#define SNP_AUTH_POLICY_SUPPORT_BIT7 0x80
/* 11.8.4.3 */
#define SNP_MAC_MODE_BIT0 0x01
#define SNP_MAC_MODE_BIT1 0x02
#define SNP_MAC_MODE_BIT2 0x04
#define SNP_MAC_MODE_BIT3 0x08
#define SNP_MAC_MODE_BIT4 0x10
#define SNP_MAC_MODE_BIT5 0x20
#define SNP_MAC_MODE_RSV 0xE0
#define SNP_MAC_MODE_RSV1 0xC0
/* PKM display */
static gint hf_pkm_msg_unknown_type = -1;
static gint hf_pkm_msg_attr_display = -1;
static gint hf_pkm_config_settings_authorize_waitout = -1;
static gint hf_pkm_config_settings_reauthorize_waitout = -1;
static gint hf_pkm_config_settings_grace_time = -1;
static gint hf_pkm_config_settings_operational_waittime = -1;
static gint hf_pkm_msg_attr_auth_key = -1;
static gint hf_pkm_msg_attr_tek = -1;
static gint hf_pkm_msg_attr_key_life_time = -1;
static gint hf_pkm_msg_attr_key_seq_num = -1;
static gint hf_pkm_msg_attr_hmac_digest = -1;
static gint hf_pkm_msg_attr_said = -1;
static gint hf_pkm_msg_attr_cbc_iv = -1;
static gint hf_pkm_msg_attr_error_code = -1;
static gint hf_pkm_msg_attr_ca_certificate = -1;
static gint hf_pkm_msg_attr_ss_certificate = -1;
static gint hf_pkm_attr_auth_result_code = -1;
static gint hf_pkm_attr_sa_service_type = -1;
static gint hf_pkm_attr_frame_number = -1;
static gint hf_pkm_attr_ss_random = -1;
static gint hf_pkm_attr_bs_random = -1;
static gint hf_pkm_attr_pre_pak = -1;
static gint hf_pkm_attr_bs_certificate = -1;
static gint hf_pkm_attr_sig_bs = -1;
static gint hf_pkm_attr_ms_mac_address = -1;
static gint hf_pkm_attr_cmac_digest = -1;
static gint hf_pkm_attr_cmac_digest_pn = -1;
static gint hf_pkm_attr_cmac_digest_value = -1;
static gint hf_pkm_attr_eap_payload = -1;
static gint hf_pkm_attr_nonce = -1;
static gint hf_pkm_sa_type = -1;
static gint hf_pkm_msg_crypto_suite = -1;
static gint hf_pkm_msg_crypto_suite_msb = -1;
static gint hf_pkm_msg_crypto_suite_middle = -1;
static gint hf_pkm_msg_crypto_suite_lsb = -1;
/*static gint hf_pkm_msg_version = -1;*/
static gint hf_pkm_attr_push_modes = -1;
static gint hf_pkm_attr_key_push_counter = -1;
static gint hf_pkm_attr_gkek = -1;
static gint hf_pkm_attr_sig_ss = -1;
static gint hf_pkm_attr_akid = -1;
static gint hf_pkm_config_settings_rekey_wait_timeout = -1;
static gint hf_pkm_config_settings_tek_grace_time = -1;
static gint hf_pkm_config_settings_authorize_reject_wait_timeout = -1;
/* static gint hf_pkm_attr_pak_ak_seq_number = -1; */
static gint hf_pkm_attr_associated_gkek_seq_number = -1;
/* static gint hf_pkm_attr_gkek_params = -1; */
/* static gint hf_common_tlv_unknown_type = -1; */
static gint hf_common_tlv_mac_version = -1;
static gint hf_common_tlv_vendor_id = -1;
static gint hf_common_tlv_vendor_specific_type = -1;
static gint hf_common_tlv_vendor_specific_length = -1;
static gint hf_common_tlv_vendor_specific_length_size = -1;
static gint hf_common_tlv_vendor_specific_value = -1;
static gint hf_common_current_transmitted_power = -1;
static expert_field ei_common_tlv_info = EI_INIT;
/* Register WiMax Utility Routines */
void wimax_proto_register_wimax_utility_decoders(void)
{
/* WiMax Service Flow Encodings display */
static hf_register_info hf_sfe[] =
{
{ /* 1 Service Flow ID */
&hf_sfe_sf_id,
{"Service Flow ID", "wmx.sfe.sf_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* 2 CID */
&hf_sfe_cid,
{"CID", "wmx.sfe.cid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 3 Service Class Name */
&hf_sfe_service_class_name,
{"Service Class Name", "wmx.sfe.service_class_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 4 MBS Service */
&hf_sfe_mbs_service,
{"MBS Service", "wmx.sfe.mbs_service", FT_UINT8, BASE_DEC, VALS(vals_mbs_service), 0x0, NULL, HFILL}
},
{ /* 5 QoS Parameter Set Type */
&hf_sfe_qos_params_set,
{"QoS Parameter Set Type", "wmx.sfe.qos_params_set", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* 5.1 */
&hf_sfe_set_provisioned,
{"Provisioned Set", "wmx.sfe.qos_params_set.provisioned", FT_BOOLEAN, 8, NULL, SFE_QOS_PARAMS_SET_PROVISIONED_SET, NULL, HFILL}
},
{ /* 5.2 */
&hf_sfe_set_admitted,
{"Admitted Set", "wmx.sfe.qos_params_set.admitted", FT_BOOLEAN, 8, NULL, SFE_QOS_PARAMS_SET_ADMITTED_SET, NULL, HFILL}
},
{ /* 5.3 */
&hf_sfe_set_active,
{"Active Set", "wmx.sfe.qos_params_set.active", FT_BOOLEAN, 8, NULL, SFE_QOS_PARAMS_SET_ACTIVE_SET, NULL, HFILL}
},
{ /* 5.4 */
&hf_sfe_set_rsvd,
{"Reserved", "wmx.sfe.qos_params_set.rsvd", FT_UINT8, BASE_HEX, NULL, SFE_QOS_PARAMS_SET_RESERVED, NULL, HFILL}
},
{ /* 6 Traffic Priority */
&hf_sfe_traffic_priority,
{"Traffic Priority", "wmx.sfe.traffic_priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 7 Maximum Sustained Traffic Rate */
&hf_sfe_max_str,
{"Maximum Sustained Traffic Rate", "wmx.sfe.msr", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &wimax_units_bit_sec, 0x0, NULL, HFILL}
},
{ /* 8 Maximum Traffic Burst */
&hf_sfe_max_traffic_burst,
{"Maximum Traffic Burst", "wmx.sfe.max_traffic_burst", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &wimax_units_byte_bytes, 0x0, NULL, HFILL}
},
{ /* 9 Minimum Reserved Traffic Rate */
&hf_sfe_min_rtr,
{"Minimum Reserved Traffic Rate", "wmx.sfe.mrr", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &wimax_units_bit_sec, 0x0, NULL, HFILL}
},
{
/* 10 Reserved */
&hf_sfe_reserved_10,
{"Reserved", "wmx.sfe.reserved_10", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
#if 0
{ /* 10 reserved by 16E */
&hf_sfe_mtr,
{"Minimum tolerable traffic rate", "wmx.sfe.mtr", FT_UINT32, BASE_HEX, NULL, 0x0, "", HFILL}
},
#endif
{ /* 11 Service Flow Scheduling Type */
&hf_sfe_ul_grant_scheduling,
{"Uplink Grant Scheduling Type", "wmx.sfe.uplink_grant_scheduling", FT_UINT8, BASE_DEC, VALS(vals_ul_grant_scheduling), 0x0, NULL, HFILL}
},
{ /* 12 Request/Transmission Policy */
&hf_sfe_req_tx_policy,
{"Request/Transmission Policy", "wmx.sfe.req_tx_policy", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* 12.1 */
&hf_sfe_policy_broadcast_bwr,
{"The Service Flow Shall Not Use Broadcast Bandwidth Request Opportunities", "wmx.sfe.policy.broadcast_bwr", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_BROADCAST_BWR, NULL, HFILL}
},
{ /* 12.2 */
&hf_sfe_policy_multicast_bwr,
{"The Service Flow Shall Not Use Multicast Bandwidth Request Opportunities", "wmx.sfe.policy.bit1", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_MULTICAST_BWR, NULL, HFILL}
},
{ /* 12.3 */
&hf_sfe_policy_piggyback,
{"The Service Flow Shall Not Piggyback Requests With Data", "wmx.sfe.policy.piggyback", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_PIGGYBACK, NULL, HFILL}
},
{ /* 12.4 */
&hf_sfe_policy_fragment,
{"The Service Flow Shall Not Fragment Data", "wmx.sfe.policy.fragment", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_FRAGMENT_DATA, NULL, HFILL}
},
{ /* 12.5 */
&hf_sfe_policy_headers,
{"The Service Flow Shall Not Suppress Payload Headers", "wmx.sfe.policy.headers", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_PAYLOAD_HEADER, NULL, HFILL}
},
{ /* 12.6 */
&hf_sfe_policy_packing,
{"The Service Flow Shall Not Pack Multiple SDUs (Or Fragments) Into Single MAC PDUs", "wmx.sfe.policy.packing", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_PACKINGS, NULL, HFILL}
},
{ /* 12.7 */
&hf_sfe_policy_crc,
{"The Service Flow Shall Not Include CRC In The MAC PDU", "wmx.sfe.policy.crc", FT_BOOLEAN, 8, NULL, SFE_REQ_TX_POLICY_CRC, NULL, HFILL}
},
{ /* 12.8 */
&hf_sfe_policy_rsvd1,
{"Reserved", "wmx.sfe.policy.rsvd1", FT_UINT8, BASE_HEX, NULL, SFE_REQ_TX_POLICY_RESERVED, NULL, HFILL}
},
{ /* 13 Tolerated Jitter */
&hf_sfe_jitter,
{"Tolerated Jitter", "wmx.sfe.jitter", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &wimax_units_ms, 0x0, NULL, HFILL}
},
{ /* 14 Maximum Latency */
&hf_sfe_max_latency,
{"Maximum Latency", "wmx.sfe.max_latency", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &wimax_units_ms, 0x0, NULL, HFILL}
},
{ /* 15 Fixed/Variable Length SDU */
&hf_sfe_fixed_len_sdu,
{"Fixed/Variable Length SDU", "wmx.sfe.fixed_len_sdu", FT_UINT8, BASE_DEC, VALS(vals_fixed_len_sdu), 0x0, NULL, HFILL}
},
{ /* 16 SDU Size */
&hf_sfe_sdu_size,
{"SDU Size", "wmx.sfe.sdu_size", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_byte_bytes, 0x0, NULL, HFILL}
},
{ /* 17 SAID Onto Which SF Is Mapped */
&hf_sfe_target_said,
{"SAID Onto Which SF Is Mapped", "wmx.sfe.target_said", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* 18 ARQ Enable */
&hf_sfe_arq_enable,
{"ARQ Enable", "wmx.arq.enable", FT_UINT8, BASE_DEC, VALS(vals_arq_enable), 0x0, NULL, HFILL}
},
{ /* 19 ARQ Window Size */
&hf_sfe_arq_window_size,
{"ARQ Window Size", "wmx.arq.window_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 20 ARQ Transmitter Delay */
&hf_sfe_arq_transmitter_delay,
{"ARQ Transmitter Delay (10us granularity)", "wmx.arq.transmitter_delay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 21 ARQ Receiver Delay */
&hf_sfe_arq_receiver_delay,
{"ARQ Receiver Delay (10us granularity)", "wmx.arq.receiver_delay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 22 ARQ Block Lifetime */
&hf_sfe_arq_block_lifetime,
{"ARQ Block Lifetime (10us granularity)", "wmx.arq.block_lifetime", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 23 ARQ Sync Loss Timeout */
&hf_sfe_arq_sync_loss_timeout,
{"ARQ Sync Loss Timeout (10us granularity)", "wmx.arq.sync_loss_timeout", FT_UINT16, BASE_DEC, VALS(vals_arq_sync_loss_timeout), 0x0, NULL, HFILL}
},
{ /* 20 ARQ Transmitter Delay */
&hf_sfe_arq_transmitter_delay_cor2,
{"ARQ Transmitter Delay (100us granularity)", "wmx.arq.transmitter_delay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 21 ARQ Receiver Delay */
&hf_sfe_arq_receiver_delay_cor2,
{"ARQ Receiver Delay (100us granularity)", "wmx.arq.receiver_delay", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 22 ARQ Block Lifetime */
&hf_sfe_arq_block_lifetime_cor2,
{"ARQ Block Lifetime (100us granularity)", "wmx.arq.block_lifetime", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 23 ARQ Sync Loss Timeout */
&hf_sfe_arq_sync_loss_timeout_cor2,
{"ARQ Sync Loss Timeout (100us granularity)", "wmx.arq.sync_loss_timeout", FT_UINT16, BASE_DEC, VALS(vals_arq_sync_loss_timeout), 0x0, NULL, HFILL}
},
{ /* 24 ARQ Deliver In Order */
&hf_sfe_arq_deliver_in_order,
{"ARQ Deliver In Order", "wmx.arq.deliver_in_order", FT_UINT8, BASE_DEC, VALS(vals_arq_deliver_in_order), 0x0, NULL, HFILL}
},
{ /* 25 ARQ Purge Timeout */
&hf_sfe_arq_rx_purge_timeout,
{"ARQ RX Purge Timeout (100us granularity)", "wmx.arq.rx_purge_timeout", FT_UINT16, BASE_DEC, VALS(vals_arq_rx_purge_timeout), 0x0, NULL, HFILL}
},
{ /* 26 ARQ Block Size */
&hf_sfe_arq_block_size,
{"ARQ Block Size", "wmx.arq.block_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 26 ARQ Block Size */
&hf_sfe_arq_block_size_cor2,
{"ARQ Block Size", "wmx.arq.block_size", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* 26 ARQ Block Size for Corrigendum 2 */
&hf_sfe_arq_min_block_size,
{"ARQ Minimum Block Size", "wmx.arq.min_block_size", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL}
},
{ /* 26 ARQ Block Size for Corrigendum 2 */
&hf_sfe_arq_max_block_size,
{"ARQ Maximum Block Size", "wmx.arq.max_block_size", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}
},
/* 27 reserved */
{ /* 28 CS Specification */
&hf_sfe_cs_specification,
{"CS Specification", "wmx.sfe.cs_specification", FT_UINT8, BASE_DEC, VALS(vals_cs_specification), 0x0, NULL, HFILL}
},
{ /* 29 Type of Data Delivery Services */
&hf_sfe_type_of_data_delivery_services,
{"Type of Data Delivery Services", "wmx.sfe.type_of_data_delivery_services", FT_UINT8, BASE_DEC, VALS(vals_type_of_data_delivery_services), 0x0, NULL, HFILL}
},
{ /* 30 SDU Inter-Arrival Interval */
&hf_sfe_sdu_inter_arrival_interval,
{"SDU Inter-Arrival Interval (in the resolution of 0.5 ms)", "wmx.sfe.sdu_inter_arrival_interval", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 31 Time Base */
&hf_sfe_time_base,
{"Time Base", "wmx.sfe.time_base", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &wimax_units_ms, 0x0, NULL, HFILL}
},
{ /* 32 Paging Preference */
&hf_sfe_paging_preference,
{"Paging Preference", "wmx.sfe.paging_preference", FT_UINT8, BASE_DEC, VALS(vals_paging_preference), 0x0, NULL, HFILL}
},
{ /* 33 MBS Zone Identifier */
&hf_sfe_mbs_zone_identifier_assignment,
{"MBS Zone Identifier", "wmx.sfe.mbs_zone_identifier", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 34 Traffic Indication Preference */
&hf_sfe_reserved_34,
{"Reserved", "wmx.sfe.reserved_34", FT_UINT8, BASE_DEC, NULL /*VALS(vals_traffic_indication_preference)*/, 0x0, NULL, HFILL}
},
{ /* 35 Global Service Class Name */
&hf_sfe_global_service_class_name,
{"Global Service Class Name", "wmx.sfe.global_service_class_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
/* 36 reserved by 16E */
/* 36 Reserved */
{
&hf_sfe_reserved_36,
{"Reserved", "wmx.sfe.reserved_36", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 37 SN Feedback Enable */
&hf_sfe_sn_feedback_enabled,
{"SN Feedback", "wmx.sfe.sn_feedback_enabled", FT_UINT8, BASE_DEC, VALS(vals_sn_fb_enable), 0x0, NULL, HFILL}
},
{ /* 38 FSN Size */
&hf_sfe_fsn_size,
{"FSN Size", "wmx.sfe.fsn_size", FT_UINT8, BASE_DEC, VALS(vals_fsn_size), 0x0, NULL, HFILL}
},
#if 0
{ /* 39 CID allocation for Active BSs */
&hf_sfe_cid_alloc_for_active_bs,
{"CID Allocation For Active BSs", "wmx.sfe.cid_alloc_for_active_bs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#endif
{ /* 39.1 */
&hf_sfe_cid_alloc_for_active_bs_cid,
{"CID", "wmx.sfe.cid_alloc_for_active_bs_cid", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 40 Unsolicited Grant Interval */
&hf_sfe_unsolicited_grant_interval,
{"Unsolicited Grant Interval", "wmx.sfe.unsolicited_grant_interval", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &wimax_units_ms, 0x0, NULL, HFILL}
},
{ /* 41 Unsolicited Polling Interval */
&hf_sfe_unsolicited_polling_interval,
{"Unsolicited Polling Interval", "wmx.sfe.unsolicited_polling_interval", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &wimax_units_ms, 0x0, NULL, HFILL}
},
{ /* 42 PDU SN extended subheader for HARQ reordering */
&hf_sfe_pdu_sn_ext_subheader_reorder,
{"PDU SN Extended Subheader For HARQ Reordering", "wmx.sfe.pdu_sn_ext_subheader_reorder", FT_UINT8, BASE_DEC, VALS(vals_pdu_sn_ext_subheader), 0x0, NULL, HFILL}
},
{ /* 43 MBS contents ID */
&hf_sfe_mbs_contents_ids,
{"MBS contents IDs", "wmx.sfe.mbs_contents_ids", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 43.1 */
&hf_sfe_mbs_contents_ids_id,
{"MBS Contents ID", "wmx.sfe.mbs_contents_ids_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 44 HARQ Service Flows */
&hf_sfe_harq_service_flows,
{"HARQ Service Flows", "wmx.sfe.harq_service_flows", FT_UINT8, BASE_DEC, VALS(vals_harq), 0x0, NULL, HFILL}
},
{ /* 45 Authorization Token */
&hf_sfe_authorization_token,
{"Authorization Token", "wmx.sfe.authorization_token", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#if 0
{ /* 46 HARQ Channel Mapping */
&hf_sfe_harq_channel_mapping,
{"HARQ Channel Mapping", "wmx.sfe.harq_channel_mapping", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#endif
{ /* 46.1 HARQ Channel Index*/
&hf_sfe_harq_channel_mapping_index,
{"HARQ Channel Index", "wmx.sfe.harq_channel_mapping.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
/* unknown types */
{ /* unknown SFE types */
&hf_sfe_unknown_type,
{"Unknown SFE TLV type", "wmx.sfe.unknown_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
}
};
/* WiMax Convergence Service Parameter Encoding Rules display */
static hf_register_info hf_csper[] =
{ /* 99 - 111 CS parameter encoding rules */
{ /* Classifier DSC Action */
&hf_cst_classifier_dsc_action,
{"Classifier DSC Action", "wmx.cst.classifier_action", FT_UINT8, BASE_DEC, VALS(vals_cst_classifier_action), 0x0, NULL, HFILL}
},
{ /* Errored Parameter */
&hf_cst_error_set_errored_param,
{"Errored Parameter", "wmx.cst.error_set.errored_param", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* Error Code */
&hf_cst_error_set_error_code,
{"Error Code", "wmx.cst.error_set.error_code", FT_UINT8, BASE_HEX, VALS(vals_cc), 0x0, NULL, HFILL}
},
{ /* Error Message */
&hf_cst_error_set_error_msg,
{"Error Message", "wmx.cst.error_set.error_msg", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* Packet Classification Rule */
&hf_cst_pkt_class_rule,
{"Packet Classification Rule", "wmx.cst.pkt_class_rule", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* Classification Rule Priority */
&hf_cst_pkt_class_rule_priority,
{"Classification Rule Priority", "wmx.cst.pkt_class_rule.priority", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* ToS/Differentiated Services Codepoint (DSCP) Range And Mask */
&hf_cst_pkt_class_rule_range_mask,
{"ToS/Differentiated Services Codepoint (DSCP) Range And Mask", "wmx.cst.pkt_class_rule.range_mask", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* ToS-Low */
&hf_cst_pkt_class_rule_tos_low,
{"ToS-Low", "wmx.cst.pkt_class_rule.tos-low", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* ToS-High */
&hf_cst_pkt_class_rule_tos_high,
{"ToS-High", "wmx.cst.pkt_class_rule.tos-high", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* ToS-Mask */
&hf_cst_pkt_class_rule_tos_mask,
{"ToS-Mask", "wmx.cst.pkt_class_rule.tos-mask", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* Protocol */
&hf_cst_pkt_class_rule_protocol,
{"Protocol", "wmx.cst.pkt_class_rule.protocol", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
#if 0 /* Removed by the changes of 802.16E 2005 */
{ /* Protocol Number */
&hf_cst_pkt_class_rule_protocol_number,
{"Protocol Number", "wmx.cst.pkt_class_rule.protocol.number", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL}
},
#endif
{ /* IP Masked Source Address */
&hf_cst_pkt_class_rule_ip_masked_src_address,
{"IP Masked Source Address", "wmx.cst.pkt_class_rule.ip_masked_src_address", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* IP Masked Destination Address */
&hf_cst_pkt_class_rule_ip_masked_dest_address,
{"IP Masked Destination Address", "wmx.cst.pkt_class_rule.ip_masked_dest_address", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* IPv4 Source Address */
&hf_cst_pkt_class_rule_src_ipv4,
{"IPv4 Source Address", "wmx.cst.pkt_class_rule.src_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* IPv4 Destination Address */
&hf_cst_pkt_class_rule_dest_ipv4,
{"IPv4 Destination Address", "wmx.cst.pkt_class_rule.dst_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* IPv4 Mask */
&hf_cst_pkt_class_rule_mask_ipv4,
{"IPv4 Mask", "wmx.cst.pkt_class_rule.mask_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* IPv6 Source Address */
&hf_cst_pkt_class_rule_src_ipv6,
{"IPv6 Source Address", "wmx.cst.pkt_class_rule.src_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* IPv6 Destination Address */
&hf_cst_pkt_class_rule_dest_ipv6,
{"IPv6 Destination Address", "wmx.cst.pkt_class_rule.dst_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* IPv6 Mask */
&hf_cst_pkt_class_rule_mask_ipv6,
{"IPv6 Mask", "wmx.cst.pkt_class_rule.mask_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* Protocol Source Port Range */
&hf_cst_pkt_class_rule_prot_src_port_range,
{"Protocol Source Port Range", "wmx.cst.pkt_class_rule.prot_src_port_range", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* Src-Port Low */
&hf_cst_pkt_class_rule_src_port_low,
{"Src-Port Low", "wmx.cst.pkt_class_rule.src_port_low", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* Src-Port High */
&hf_cst_pkt_class_rule_src_port_high,
{"Src-Port High", "wmx.cst.pkt_class_rule.src_port_high", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* Protocol Destination Port Range */
&hf_cst_pkt_class_rule_prot_dest_port_range,
{"Protocol Destination Port Range", "wmx.cst.pkt_class_rule.prot_dest_port_range", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* Dst-Port Low */
&hf_cst_pkt_class_rule_dest_port_low,
{"Dst-Port Low", "wmx.cst.pkt_class_rule.dst_port_low", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* Dst-Port High */
&hf_cst_pkt_class_rule_dest_port_high,
{"Dst-Port High", "wmx.cst.pkt_class_rule.dst_port_high", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 802.3/Ethernet Destination MAC Address */
&hf_cst_pkt_class_rule_dest_mac_address,
{"802.3/Ethernet Destination MAC Address", "wmx.cst.pkt_class_rule.dest_mac_address", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* Destination MAC Address */
&hf_cst_pkt_class_rule_dest_mac,
{"Destination MAC Address", "wmx.cst.pkt_class_rule.dst_mac", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 802.3/Ethernet Source MAC Address */
&hf_cst_pkt_class_rule_src_mac_address,
{"802.3/Ethernet Source MAC Address", "wmx.cst.pkt_class_rule.src_mac_address", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* Source MAC Address */
&hf_cst_pkt_class_rule_src_mac,
{"Source MAC Address", "wmx.cst.pkt_class_rule.src_mac", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* MAC Address Mask */
&hf_cst_pkt_class_rule_mask_mac,
{"MAC Address Mask", "wmx.cst.pkt_class_rule.mask_mac", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* Ethertype/IEEE Std 802.2-1998 SAP */
&hf_cst_pkt_class_rule_ethertype,
{"Ethertype/IEEE Std 802.2-1998 SAP", "wmx.cst.pkt_class_rule.ethertype", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* Ethertype */
&hf_cst_pkt_class_rule_etype,
{"Ethertype", "wmx.cst.pkt_class_rule.etype", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* Eprot1 */
&hf_cst_pkt_class_rule_eprot1,
{"Eprot1", "wmx.cst.pkt_class_rule.eprot1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* Eprot2 */
&hf_cst_pkt_class_rule_eprot2,
{"Eprot2", "wmx.cst.pkt_class_rule.eprot2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* IEEE Std 802.1D-1998 User_Priority */
&hf_cst_pkt_class_rule_user_priority,
{"IEEE Std 802.1D-1998 User_Priority", "wmx.cst.pkt_class_rule.user_priority", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{
&hf_cst_pkt_class_rule_pri_low,
{"Pri-Low", "wmx.cst.pkt_class_rule.pri-low", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{
&hf_cst_pkt_class_rule_pri_high,
{"Pri-High", "wmx.cst.pkt_class_rule.pri-high", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* IEEE Std 802.1Q-1998 VLAN_ID */
&hf_cst_pkt_class_rule_vlan_id,
{"IEEE Std 802.1Q-1998 VLAN_ID", "wmx.cst.pkt_class_rule.vlan_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* Vlan_Id1 */
&hf_cst_pkt_class_rule_vlan_id1,
{"Vlan_Id1", "wmx.cst.pkt_class_rule.vlan_id1", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* Vlan_Id2 */
&hf_cst_pkt_class_rule_vlan_id2,
{"Vlan_Id2", "wmx.cst.pkt_class_rule.vlan_id2", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* Associated PHSI */
&hf_cst_pkt_class_rule_phsi,
{"Associated PHSI", "wmx.cst.pkt_class_rule.phsi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* Packet Classifier Rule Index */
&hf_cst_pkt_class_rule_index,
{"Packet Classifier Rule Index (PCRI)", "wmx.cst.pkt_class_rule.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* Large Context ID for ROHC/ECRTP Compressed Packet or ROHC Feedback Packet */
&hf_cst_large_context_id,
{"Large Context ID", "wmx.cst.large_context_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* Short-Format Context ID for ROHC/ECRTP Compressed Packet or ROHC Feedback Packet */
&hf_cst_short_format_context_id,
{"Short-Format Context ID", "wmx.cst.short_format_context_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* Vendor-Specific Classifier Parameters */
&hf_cst_pkt_class_rule_vendor_spec,
{"Vendor-Specific Classifier Parameters", "wmx.cst.pkt_class_rule.vendor_spec", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* Classifier Action Rule */
&hf_cst_pkt_class_rule_classifier_action_rule,
{"Classifier Action Rule", "wmx.cst.pkt_class_rule.classifier.action.rule", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{
&hf_cst_pkt_class_rule_classifier_action_rule_bit0,
{"Bit #0", "wmx.cst.pkt_class_rule.classifier.action.rule.bit0", FT_UINT8, BASE_HEX, VALS(vals_classification_action_rule), CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_BIT0, NULL, HFILL}
},
{
&hf_cst_pkt_class_rule_classifier_action_rule_bit1,
{"Reserved", "wmx.cst.pkt_class_rule.classifier.action.rule.reserved", FT_UINT8, BASE_HEX, NULL, CST_PKT_CLASS_RULE_CLASSIFIER_ACTION_RULE_RSV, NULL, HFILL}
},
{ /* PHS DSC action */
&hf_cst_phs_dsc_action,
{"PHS DSC action", "wmx.cst.phs_dsc_action", FT_UINT8, BASE_DEC, VALS(vals_cst_phs_dsc_action), 0x0, NULL, HFILL}
},
{ /* PHS Rule */
&hf_cst_phs_rule,
{"PHS Rule", "wmx.cst.phs_rule", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* PHS Rule 1 */
&hf_cst_phs_phsi,
{"PHSI", "wmx.cst.phs_rule.phsi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* PHS Rule 2 */
&hf_cst_phs_phsf,
{"PHSF", "wmx.cst.phs_rule.phsf", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* PHS Rule 3 */
&hf_cst_phs_phsm,
{"PHSM (bit x: 0-don't suppress the (x+1) byte; 1-suppress the (x+1) byte)", "wmx.cst.phs_rule.phsm", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* PHS Rule 4 */
&hf_cst_phs_phss,
{"PHSS", "wmx.cst.phs_rule.phss", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* PHS Rule 5 */
&hf_cst_phs_phsv,
{"PHSV", "wmx.cst.phs_rule.phsv", FT_UINT8, BASE_DEC, VALS(vals_verify), 0x0, NULL, HFILL}
},
{ /* PHS Rule 143 */
&hf_cst_phs_vendor_spec,
{"Vendor-Specific PHS Parameters", "wmx.cst.phs.vendor_spec", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* IPv6 Flow Label */
&hf_cst_pkt_class_rule_ipv6_flow_label,
{"IPv6 Flow Label", "wmx.cst.pkt_class_rule.ipv6_flow_label", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* ATM Switching Encoding */
&hf_csper_atm_switching_encoding,
{"ATM Switching Encoding", "wmx.csper.atm_switching_encoding", FT_UINT8, BASE_DEC, VALS(vals_atm_switching_encodings), 0x0, NULL, HFILL}
},
{ /* ATM Classifier TLV */
&hf_csper_atm_classifier,
{"ATM Classifier TLV", "wmx.csper.atm_classifier", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* ATM VPI Classifier */
&hf_csper_atm_classifier_vpi,
{"VPI Classifier", "wmx.csper.atm_classifier_vpi", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* ATM VCI Classifier */
&hf_csper_atm_classifier_vci,
{"VCI Classifier", "wmx.csper.atm_classifier_vci", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* ATM Classifier ID */
&hf_csper_atm_classifier_id,
{"Classifier ID", "wmx.csper.atm_classifier_tlv", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
/* unknown types */
{ /* unknown CSPER types */
&hf_csper_unknown_type,
{"Unknown CSPER TLV type", "wmx.csper.unknown_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{
&hf_cst_invalid_tlv,
{"Invalid TLV", "wmx.cst.invalid_tlv", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
}
};
/* WiMax HMAC/CMAC/Short-HMAC Tuples display */
static hf_register_info hf_xmac[] =
{
{
&hf_xmac_tuple_rsvd,
{"Reserved", "wmx.xmac_tuple.reserved", FT_UINT8, BASE_HEX, NULL, XMAC_TUPLE_RESERVED, NULL, HFILL}
},
{
&hf_xmac_tuple_key_seq_num,
{"Key Sequence Number", "wmx.xmac_tuple.key_sn", FT_UINT8, BASE_DEC, NULL, XMAC_TUPLE_KEY_SEQ_NUM, NULL, HFILL}
},
{
&hf_hmac_tuple_hmac_digest,
{"HMAC Digest", "wmx.xmac_tuple.hmac_digest", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{
&hf_cmac_tuple_bsid,
{"BSID", "wmx.cmac_tuple.bsid", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{
&hf_cmac_tuple_cmac_value,
{"CMAC Value", "wmx.cmac_tuple.cmac.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{
&hf_packet_number_counter,
{"Packet Number Counter", "wmx.xmac_tuple.packet_number_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
}
};
static hf_register_info hf_snp[] =
{
{ /* 11.8.4.1 */
&hf_snp_pkm_version_support,
{"PKM Version Support", "wmx.security_negotiation_parameters.pkm_version_support",FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{
&hf_snp_pkm_version_support_bit0,
{"PKM version 1", "wmx.security_negotiation_parameters.pkm_version_support.bit0",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_PKM_VERSION_SUPPORT_BIT0, NULL, HFILL}
},
{
&hf_snp_pkm_version_support_bit1,
{"PKM version 2", "wmx.security_negotiation_parameters.pkm_version_support.bit1",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_PKM_VERSION_SUPPORT_BIT1, NULL, HFILL}
},
{
&hf_snp_pkm_version_support_reserved,
{"Reserved", "wmx.security_negotiation_parameters.pkm_version_support.reserved",FT_UINT8, BASE_HEX, NULL, SNP_PKM_VERSION_SUPPORT_RSV, NULL, HFILL}
},
{ /* 11.8.4.2 */
&hf_snp_auth_policy_support,
{"Authorization Policy Support", "wmx.security_negotiation_parameters.auth_policy_support",FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{
&hf_snp_auth_policy_support_bit0,
{"RSA-based Authorization At The Initial Network Entry", "wmx.security_negotiation_parameters.auth_policy_support.bit0",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT0, NULL, HFILL}
},
{
&hf_snp_auth_policy_support_bit1,
{"EAP-based Authorization At The Initial Network Entry", "wmx.security_negotiation_parameters.auth_policy_support.bit1",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT1, NULL, HFILL}
},
{
&hf_snp_auth_policy_support_bit2,
{"Authenticated EAP-based Authorization At The Initial Network Entry", "wmx.security_negotiation_parameters.auth_policy_support.bit2",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT2, NULL, HFILL}
},
{
&hf_snp_auth_policy_support_bit3,
{"Reserved", "wmx.security_negotiation_parameters.auth_policy_support.bit3",FT_UINT8, BASE_HEX, NULL, SNP_AUTH_POLICY_SUPPORT_BIT3, NULL, HFILL}
},
{
&hf_snp_auth_policy_support_bit4,
{"RSA-based Authorization At Re-entry", "wmx.security_negotiation_parameters.auth_policy_support.bit4",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT4, NULL, HFILL}
},
{
&hf_snp_auth_policy_support_bit5,
{"EAP-based Authorization At Re-entry", "wmx.security_negotiation_parameters.auth_policy_support.bit5",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT5, NULL, HFILL}
},
{
&hf_snp_auth_policy_support_bit6,
{"Authenticated EAP-based Authorization At Re-entry", "wmx.security_negotiation_parameters.auth_policy_support.bit6",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_AUTH_POLICY_SUPPORT_BIT6, NULL, HFILL}
},
{
&hf_snp_auth_policy_support_bit7,
{"Reserved", "wmx.security_negotiation_parameters.auth_policy_support.bit7",FT_UINT8, BASE_HEX, NULL, SNP_AUTH_POLICY_SUPPORT_BIT7, NULL, HFILL}
},
{ /* 11.8.4.3 */
&hf_snp_mac_mode,
{"MAC (Message Authentication Code) Mode", "wmx.security_negotiation_parameters.mac_mode",FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{
&hf_snp_mac_mode_bit0,
{"HMAC", "wmx.security_negotiation_parameters.mac_mode.bit0",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT0, NULL, HFILL}
},
{
&hf_snp_mac_mode_bit1,
{"CMAC", "wmx.security_negotiation_parameters.mac_mode.bit1",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT1, NULL, HFILL}
},
{
&hf_snp_mac_mode_bit1_rsvd,
{"Reserved", "wmx.security_negotiation_parameters.mac_mode.bit1_rsvd",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT1, NULL, HFILL}
},
{
&hf_snp_mac_mode_bit2,
{"64-bit Short-HMAC", "wmx.security_negotiation_parameters.mac_mode.bit2",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT2, NULL, HFILL}
},
{
&hf_snp_mac_mode_bit3,
{"80-bit Short-HMAC", "wmx.security_negotiation_parameters.mac_mode.bit3",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT3, NULL, HFILL}
},
{
&hf_snp_mac_mode_bit4,
{"96-bit Short-HMAC", "wmx.security_negotiation_parameters.mac_mode.bit4",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT4, NULL, HFILL}
},
{
&hf_snp_mac_mode_bit5,
{"CMAC", "wmx.security_negotiation_parameters.mac_mode.bit5",FT_BOOLEAN, 8, TFS(&tfs_supported), SNP_MAC_MODE_BIT5, NULL, HFILL}
},
{
&hf_snp_mac_mode_reserved,
{"Reserved", "wmx.security_negotiation_parameters.mac_mode.reserved",FT_UINT8, BASE_HEX, NULL, SNP_MAC_MODE_RSV, NULL, HFILL}
},
{
&hf_snp_mac_mode_reserved1,
{"Reserved", "wmx.security_negotiation_parameters.mac_mode.reserved",FT_UINT8, BASE_HEX, NULL, SNP_MAC_MODE_RSV1, NULL, HFILL}
},
{ /* 11.8.4.4 */
&hf_snp_pn_window_size,
{"PN Window Size", "wmx.security_negotiation_parameters.pn_window_size",FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 11.8.4.5 */
&hf_snp_max_conc_transactions,
{"Maximum concurrent transactions (0 indicates no limit)", "wmx.security_negotiation_parameters.max_conc_transactions",FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 11.8.4.6 */
&hf_snp_max_suppt_sec_assns,
{"Maximum number of security associations supported by the SS", "wmx.security_negotiation_parameters.max_suppt_sec_assns",FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{
&hf_snp_unknown_type,
{"Unknown Security Negotiation Parameter type", "wmx.security_negotiation_parameters.unknown.type",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
}
};
static hf_register_info hf_pkm[] =
{
{ /* 11.9.1 - type 6 */
&hf_pkm_msg_attr_display,
{"Display String", "wmx.pkm_msg.pkm_attr.display_string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.2 - type 7 */
&hf_pkm_msg_attr_auth_key,
{"Auth Key", "wmx.pkm_msg.pkm_attr.auth_key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.3 - type 8 */
&hf_pkm_msg_attr_tek,
{"TEK", "wmx.pkm_msg.pkm_attr.tek", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.4 - type 9 */
&hf_pkm_msg_attr_key_life_time,
{"Key Lifetime", "wmx.pkm_msg.pkm_attr.key_life_time", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.5 - type 10 */
&hf_pkm_msg_attr_key_seq_num,
{"Key Sequence Number", "wmx.pkm_msg.pkm_attr.key_seq_num", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.6 - type 11 */
&hf_pkm_msg_attr_hmac_digest,
{"HMAC-Digest", "wmx.pkm_msg.pkm_attr.hmac_digest", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.7 - type 12 */
&hf_pkm_msg_attr_said,
{"SAID", "wmx.pkm_msg.pkm_attr.said", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
#if 0 /* not been used */
{ /* 11.9.8 - type 13 */
&hf_pkm_msg_attr_tek_param,
{"TEK Parameters", "wmx.pkm_msg.pkm_attr.tek_parameters", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
},
#endif
{ /* 11.9.9 - type 15 */
&hf_pkm_msg_attr_cbc_iv,
{"CBC IV", "wmx.pkm_msg.pkm_attr.cbc_iv", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.10 - type 16 */
&hf_pkm_msg_attr_error_code,
{"Error Code", "wmx.pkm_msg.pkm_attr.error_code", FT_UINT8, BASE_DEC, VALS(vals_pkm_attr_error_codes), 0x0, NULL, HFILL}
},
{ /* 11.9.11 - type 17 */
&hf_pkm_msg_attr_ca_certificate,
{"CA Certificate", "wmx.pkm_msg.pkm_attr.ca_certificate", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.12 - type 18 */
&hf_pkm_msg_attr_ss_certificate,
{"SS Certificate", "wmx.pkm_msg.pkm_attr.ss_certificate", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#if 0 /* not been used */
{ /* 11.9.13 - type 19 */
&hf_pkm_msg_attr_security_capabilities,
{"Security Capabilities", "wmx.pkm_msg.pkm_attr.security_capabilities", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
},
#endif
{ /* 11.9.14 - type 20 */
&hf_pkm_msg_crypto_suite,
{"Cryptography", "wmx.pkm_msg.pkm_attr.crypto_suite", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{
&hf_pkm_msg_crypto_suite_msb,
{"Data Encryption Algorithm Identifiers", "wmx.pkm_msg.pkm_attr.crypto_suite.msb", FT_UINT8, BASE_DEC, VALS(vals_data_encryption_ids), 0x0, NULL, HFILL}
},
{
&hf_pkm_msg_crypto_suite_middle,
{"Data Authentication Algorithm Identifiers", "wmx.pkm_msg.pkm_attr.crypto_suite.middle", FT_UINT8, BASE_DEC, VALS(vals_data_authentication_ids), 0x0, NULL, HFILL}
},
{
&hf_pkm_msg_crypto_suite_lsb,
{"TEK Encryption Algorithm Identifiers", "wmx.pkm_msg.pkm_attr.crypto_suite.lsb", FT_UINT8, BASE_DEC, VALS(vals_tek_encryption_ids), 0x0, NULL, HFILL}
},
#if 0 /* not been used */
{ /* 11.9.15 - type 21 */
&hf_pkm_msg_crypto_list,
{"Cryptographic-Suite List", "wmx.pkm_msg.pkm_attr.crypto_suite_list", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
},
#endif
#if 0 /* deleted by 802.16E */
{ /* 11.9.16 - type 22 */
&hf_pkm_msg_version,
{"Reserved ", "wmx.pkm_msg.pkm_attr.version", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL}
},
#endif
#if 0 /* not been used */
{ /* 11.9.17 - type 23 */
&hf_pkm_msg_sa_descriptor,
{"SA Descriptor", "wmx.pkm_msg.pkm_attr.sa_descriptor", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
},
#endif
{ /* 11.9.18 - type 24 */
&hf_pkm_sa_type,
{"SA Type", "wmx.pkm_msg.pkm_attr.sa_type", FT_UINT8, BASE_DEC, VALS(vs_sa_type), 0x0, NULL, HFILL}
},
#if 0 /* not been used */
{ /* 11.9.?? - type 25 */
&hf_pkm_attr_security_negotiation_parameters,
{"Security Negotiation Parameters", "wmx.pkm_msg.pkm_attr.security_negotiation_parameters", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
},
#endif
#if 0 /* not been used */
{ /* 11.9.19 - type 27 */
&hf_pkm_attr_config_settings,
{"PKM Configuration Settings", "wmx.pkm_msg.pkm_attr.config_settings", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}
},
#endif
{ /* 11.9.19.1 */
&hf_pkm_config_settings_authorize_waitout,
{"Authorize Wait Timeout (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.authorize_waitout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.19.2 */
&hf_pkm_config_settings_reauthorize_waitout,
{"Reauthorize Wait Timeout (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.reauthorize_waitout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.19.3 */
&hf_pkm_config_settings_grace_time,
{"Authorization Grace Time (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.grace_time", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.19.4 */
&hf_pkm_config_settings_operational_waittime,
{"Operational Wait Timeout (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.operational_wait_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.19.5 */
&hf_pkm_config_settings_rekey_wait_timeout,
{"Rekey Wait Timeout (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.rekey_wait_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.19.6 */
&hf_pkm_config_settings_tek_grace_time,
{"TEK Grace Time (in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.tek_grace_time", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.19.7 */
&hf_pkm_config_settings_authorize_reject_wait_timeout,
{"Authorize Reject Wait Timeout(in seconds)", "wmx.pkm_msg.pkm_attr.config_settings.authorize_reject_wait_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.20 - type 29 */
&hf_pkm_attr_nonce,
{"Nonce", "wmx.pkm_msg.pkm_attr.nonce", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.21 - type 33 */
&hf_pkm_attr_ss_random,
{"SS_RANDOM", "wmx.pkm_msg.pkm_attr.ss_random", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.22 - type 34 */
&hf_pkm_attr_bs_random,
{"BS_RANDOM", "wmx.pkm_msg.pkm_attr.bs_random", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.23 - type 35 */
&hf_pkm_attr_pre_pak,
{"Pre-PAK", "wmx.pkm_msg.pkm_attr.pre_pak", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#if 0 /* no definition */
{ /* 11.9.?? - type 36 */
&hf_pkm_attr_pak_ak_seq_number,
{"PAK/AK Sequence Number", "wmx.pkm_msg.pkm_attr.pak_ak_seq_number", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#endif
{ /* 11.9.24 - type 37 */
&hf_pkm_attr_bs_certificate,
{"BS Certificate", "wmx.pkm_msg.pkm_attr.bs_certificate", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.25 - type 38 */
&hf_pkm_attr_sig_bs,
{"SigBS", "wmx.pkm_msg.pkm_attr.sig_bs",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.26 - type 39 */
&hf_pkm_attr_ms_mac_address,
{"MS-MAC Address", "wmx.pkm_msg.pkm_attr.ms_mac_address",FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.27 - type 40 */
&hf_pkm_attr_cmac_digest,
{"CMAC Digest", "wmx.pkm_msg.pkm_attr.cmac_digest",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{
&hf_pkm_attr_cmac_digest_pn,
{"CMAC Packet Number counter, CMAC_PN_*", "wmx.pkm_msg.pkm_attr.cmac_digest.pn",FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{
&hf_pkm_attr_cmac_digest_value,
{"CMAC Value", "wmx.pkm_msg.pkm_attr.cmac_digest.value",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.28 - type 41 */
&hf_pkm_attr_push_modes,
{"Key Push Modes", "wmx.pkm_msg.pkm_attr.key_push_modes",FT_UINT8, BASE_DEC, VALS(va_key_push_modes), 0x0, NULL, HFILL}
},
{ /* 11.9.29 - type 42 */
&hf_pkm_attr_key_push_counter,
{"Key Push Counter", "wmx.pkm_msg.pkm_attr.key_push_counter",FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.30 - type 43 */
&hf_pkm_attr_gkek,
{"GKEK", "wmx.pkm_msg.pkm_attr.gkek",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.31 - type 44 */
&hf_pkm_attr_sig_ss,
{"SigSS", "wmx.pkm_msg.pkm_attr.sig_ss",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.32 - type 45 */
&hf_pkm_attr_akid,
{"AKID", "wmx.pkm_msg.pkm_attr.akid",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.33 - type 28 */
&hf_pkm_attr_eap_payload,
{"EAP Payload", "wmx.pkm_msg.pkm_attr.eap_payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{ /* 11.9.34 - type 30 */
&hf_pkm_attr_auth_result_code,
{"Auth Result Code", "wmx.pkm_msg.pkm_attr.auth_result_code", FT_UINT8, BASE_DEC, VALS(vs_success_reject), 0x0, NULL, HFILL}
},
{ /* 11.9.35 - type 31 */
&hf_pkm_attr_sa_service_type,
{"SA Service Type", "wmx.pkm_msg.pkm_attr.sa_service_type", FT_UINT8, BASE_DEC, VALS(vs_sa_service_type), 0x0, NULL, HFILL}
},
{ /* 11.9.37 - type 32 */
&hf_pkm_attr_frame_number,
{"Frame Number", "wmx.pkm_msg.pkm_attr.frame_number", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
#if 1 /* no definitions [??] */
{ /* 11.9.?? - type 46 */
&hf_pkm_attr_associated_gkek_seq_number,
{"Associated GKEK Sequence Number", "wmx.pkm_msg.pkm_attr.associated_gkek_seq_number",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#endif
#if 0
{ /* 11.9.?? - type 47 */
&hf_pkm_attr_gkek_params,
{"GKEK Parameters", "wmx.pkm_msg.pkm_attr.gkek_params",FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#endif
{
&hf_pkm_msg_unknown_type,
{"Unknown Type", "wmx.pkm.unknown.type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
}
};
/* WiMax Common TLV Encoding display */
static hf_register_info hf_common_tlv[] =
{
{
&hf_common_tlv_mac_version,
{ "MAC Version", "wmx.common_tlv.mac_version", FT_UINT8, BASE_DEC, VALS(vals_dcd_mac_version), 0x0, NULL, HFILL}
},
{
&hf_common_tlv_vendor_id,
{ "Vendor ID Encoding", "wmx.common_tlv.vendor_id_encoding", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{
&hf_common_tlv_vendor_specific_type,
{ "Vendor Specific Type", "wmx.common_tlv.vendor_specific_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
},
{
&hf_common_tlv_vendor_specific_length_size,
{
"Vendor Specific Length Size", "wmx.common_tlv.vendor_specific_length_size",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL
}
},
{
&hf_common_tlv_vendor_specific_length,
{ "Vendor Specific Length", "wmx.common_tlv.vendor_specific_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
},
{
&hf_common_tlv_vendor_specific_value,
{ "Vendor Specific Value", "wmx.common_tlv.vendor_specific_value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
{
&hf_common_current_transmitted_power,
{ "Current Transmitted Power", "wmx.common_tlv.current_transmitted_power", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL}
},
#if 0
{
&hf_common_tlv_unknown_type,
{"Unknown Common TLV Type", "wmx.common_tlv.unknown_type", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
}
#endif
};
static ei_register_info ei[] = {
{ &ei_common_tlv_info, { "wmx.common_tlv.invalid", PI_PROTOCOL, PI_WARN, "Invalid TLV info", EXPFILL }},
};
expert_module_t* expert_wimax_utility;
if(proto_wimax_utility_decoders == -1)
{
proto_wimax_utility_decoders = proto_register_protocol (
"WiMax Sub-TLV Messages",
/* name */
"WiMax Sub-TLV (sub)", /* short name */
"wmx.sub" /* abbrev */
);
proto_register_subtree_array(ett, array_length(ett));
proto_register_field_array(proto_wimax_utility_decoders, hf_sfe, array_length(hf_sfe));
proto_register_field_array(proto_wimax_utility_decoders, hf_csper, array_length(hf_csper));
proto_register_field_array(proto_wimax_utility_decoders, hf_xmac, array_length(hf_xmac));
proto_register_field_array(proto_wimax_utility_decoders, hf_snp, array_length(hf_snp));
proto_register_field_array(proto_wimax_utility_decoders, hf_pkm, array_length(hf_pkm));
proto_register_field_array(proto_wimax_utility_decoders, hf_common_tlv, array_length(hf_common_tlv));
expert_wimax_utility = expert_register_protocol(proto_wimax_utility_decoders);
expert_register_field_array(expert_wimax_utility, ei, array_length(ei));
eap_handle = find_dissector("eap");
}
}
/**************************************************************/
/* wimax_error_parameter_set_decoder() */
/* decode and display the WiMax Error Parameter Set */
/* parameter: */
/* tvb - pointer of the tvb of error_parameter_set */
/* tree - pointer of Wireshark display tree */
/* pinfo - pointer of Wireshark packet information structure*/
/**************************************************************/
void wimax_error_parameter_set_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset;
guint tvb_len, tlv_len;
gint tlv_type;
proto_item *ceps_item = NULL;
proto_tree *ceps_tree = NULL;
tlv_info_t tlv_info;
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
offset = 0;
/* display error parameter information */
ceps_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, tvb_len, "Error Parameter Set (%u bytes)", tvb_len);
/* add CS Parameter Encoding Rules subtree */
ceps_tree = proto_item_add_subtree(ceps_item, ett_wimax_error_parameter_set);
/* do nothing if the TLV fields is not exist */
if(!tvb_len)
return;
/* report error if the packet size is less than 2 bytes (type+length) */
if(tvb_len < 2)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Error Parameter Set");
return;
}
/* process the classifier error parameter set */
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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "EPS TLV error");
proto_tree_add_item(ceps_tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
break;
}
#ifdef DEBUG /* for debug only */
proto_tree_add_protocol_format(ceps_tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len+2+get_tlv_size_of_length(&tlv_info)), "EPS TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len);
#endif
/* parse the Classifier Error Parameter Set */
switch (tlv_type)
{
case CST_ERROR_SET_ERRORED_PARAM:
add_tlv_subtree(&tlv_info, ceps_tree, hf_cst_error_set_errored_param, tvb, offset, ENC_NA);
break;
case CST_ERROR_SET_ERROR_CODE:
add_tlv_subtree(&tlv_info, ceps_tree, hf_cst_error_set_error_code, tvb, offset, ENC_BIG_ENDIAN);
break;
case CST_ERROR_SET_ERROR_MSG:
add_tlv_subtree(&tlv_info, ceps_tree, hf_cst_error_set_error_msg, tvb, offset, ENC_ASCII|ENC_NA);
break;
}
offset += (tlv_len+get_tlv_value_offset(&tlv_info));
}
}
/****************************************************************/
/* wimax_convengence_service_parameter_encoding_rules_decoder() */
/* decode and display the WiMax Convergence Service Parameter */
/* Encoding Rules */
/* parameter: */
/* sfe_type - Service Flow Encodings type */
/* tvb - pointer of the tvb of service flow encodings */
/* tree - pointer of Wireshark display tree */
/* pinfo - pointer of Wireshark packet information structure */
/****************************************************************/
/* CS Parameter Encoding Rules handling function */
void wimax_convengence_service_parameter_encoding_rules_decoder(guint sfe_type, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset, tlv_offset;
guint tvb_len, tlv_len, length;
gint tlv_type;
proto_item *csper_item;
proto_tree *csper_tree;
proto_tree *tlv_tree, *ti_tree;
proto_item *tlv_item, *ti_item;
tlv_info_t tlv_info;
gboolean ipv6 = ((sfe_type == SFE_CSPER_PACKET_IPV6) || (sfe_type == SFE_CSPER_PACKET_IPV6_802_3) || (sfe_type == SFE_CSPER_PACKET_IPV6_802_1Q));
/* sanity check */
if((sfe_type < SFE_CSPER_ATM) || (sfe_type > SFE_CSPER_PACKET_IP_802_3_ECRTP_COMPRESSION))
return; /* invalid CS Parameter Encodings */
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
offset = 0;
/* display SFE information */
csper_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, tvb_len, "Convergence Service Parameter Encoding Rules (%u bytes)", tvb_len);
/* add CS Parameter Encoding Rules subtree */
csper_tree = proto_item_add_subtree(csper_item, ett_wimax_cst_encoding_rules);
/* do nothing if the TLV fields is not exist */
if(!tvb_len)
return;
/* report error if the packet size is less than 2 bytes (type+length) */
if(tvb_len < 2)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Convergence Service Parameter Encoding Rules");
return;
}
/* process WiMax Service Flow Encodings */
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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CSPER TLV error");
proto_tree_add_item(csper_tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
break;
}
#ifdef DEBUG /* for debug only */
proto_tree_add_protocol_format(csper_tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len+2+get_tlv_size_of_length(&tlv_info)), "CSPER TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len);
#endif
/* update the offset */
offset += get_tlv_value_offset(&tlv_info);
/* parse the CS parameter Encoding Rule TLV */
if(sfe_type == SFE_CSPER_ATM)
{ /* ATM CS Encodings */
switch (tlv_type)
{
case CST_ATM_SWITCHING:
add_tlv_subtree(&tlv_info, csper_tree, hf_csper_atm_switching_encoding, tvb, offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case CST_ATM_CLASSIFIER:
/* add TLV subtree */
tlv_item = add_tlv_subtree(&tlv_info, csper_tree, hf_csper_atm_classifier, tvb, offset-get_tlv_value_offset(&tlv_info), ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_wimax_cst_encoding_rules);
tlv_offset = offset;
while(tlv_offset < (tlv_len + offset))
{
/* get the TLV information */
init_tlv_info(&tlv_info, tvb, 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "ATM Classifier TLV error");
proto_tree_add_item(tlv_tree, hf_cst_invalid_tlv, tvb, offset, (tlv_len - tlv_offset), ENC_NA);
break;
}
#ifdef DEBUG /* for debug only */
proto_tree_add_protocol_format(csper_tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len+2+get_tlv_size_of_length(&tlv_info)), "ATM Classifier TLV Type: %u (%u bytes, offset=%u, tlv_len=%u)", tlv_type, length, offset, tlv_len);
#endif
switch (tlv_type)
{
case ATM_VPI_CLASSIFIER:
add_tlv_subtree(&tlv_info, tlv_tree, hf_csper_atm_classifier_vpi, tvb, tlv_offset, ENC_BIG_ENDIAN);
break;
case ATM_VCI_CLASSIFIER:
add_tlv_subtree(&tlv_info, tlv_tree, hf_csper_atm_classifier_vci, tvb, tlv_offset, ENC_BIG_ENDIAN);
break;
case ATM_CLASSIFIER_ID:
add_tlv_subtree(&tlv_info, tlv_tree, hf_csper_atm_classifier_id, tvb, tlv_offset, ENC_BIG_ENDIAN);
break;
default:
break;
}
tlv_offset += (length + get_tlv_value_offset(&tlv_info));
} /* end of while loop */
break;
case CST_ATM_CLASSIFIER_DSC_ACTION:
add_tlv_subtree(&tlv_info, csper_tree, hf_cst_classifier_dsc_action, tvb, offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case CST_ATM_CLASSIFIER_ERROR_PARAMETER_SET:
/* call the error parameter set function */
tlv_tree = add_protocol_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, proto_wimax_utility_decoders, tvb, offset-get_tlv_value_offset(&tlv_info), tlv_len, "Classifier Error Parameter Set");
wimax_error_parameter_set_decoder(tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
default:
/* display the unknown ATM CS encoding in hex */
add_tlv_subtree(&tlv_info, csper_tree, hf_csper_unknown_type, tvb, offset-get_tlv_value_offset(&tlv_info), ENC_NA);
break;
}
}
else
{
switch (tlv_type)
{
case CST_CLASSIFIER_ACTION:
add_tlv_subtree(&tlv_info, csper_tree, hf_cst_classifier_dsc_action, tvb, offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case CST_CLASSIFIER_ERROR_PARAM_SET:
case CST_PHS_ERROR_PARAM_SET:
tlv_tree = add_protocol_subtree(&tlv_info, ett_wimax_cst_encoding_rules, csper_tree, proto_wimax_utility_decoders, tvb, offset-get_tlv_value_offset(&tlv_info), tlv_len, "Classifier Error Parameter Set");
/* call the error parameter set function */
wimax_error_parameter_set_decoder(tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
case CST_PACKET_CLASSIFICATION_RULE:
{
/* add TLV subtree */
tlv_item = add_tlv_subtree(&tlv_info, csper_tree, hf_cst_pkt_class_rule, tvb, offset-get_tlv_value_offset(&tlv_info), ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_wimax_cst_encoding_rules);
tlv_offset = offset;
while(tlv_offset < (tlv_len + offset))
{
/* get the TLV information */
init_tlv_info(&tlv_info, tvb, 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Packet Classification Rule TLV error");
proto_tree_add_item(tlv_tree, hf_cst_invalid_tlv, tvb, offset, (tlv_len - tlv_offset), ENC_NA);
break;
}
#ifdef DEBUG /* for debug only */
proto_tree_add_protocol_format(csper_tree, proto_wimax_utility_decoders, tvb, tlv_offset, (length + get_tlv_value_offset(&tlv_info)), "Packet Classification Rule TLV Type: %u (%u bytes, offset=%u, tlv_len=%u)", tlv_type, length, tlv_offset, tlv_len);
#endif
/* update the offset */
tlv_offset += get_tlv_value_offset(&tlv_info);
switch (tlv_type)
{
case CST_PKT_CLASS_RULE_PRIORITY:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_priority, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_RANGE_MASK:
/* add TLV subtree */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_range_mask, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_wimax_cst_encoding_rules);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_tos_low, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_tos_high, tvb, tlv_offset + 1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_tos_mask, tvb, tlv_offset + 2, 1, ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_PROTOCOL:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_protocol, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_SRC_IP:
/* add TLV subtree */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_ip_masked_src_address, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_wimax_cst_encoding_rules);
if(ipv6)
{
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_ipv6, tvb, tlv_offset, 16, ENC_NA);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv6, tvb, tlv_offset + 16, 16, ENC_NA);
}
else
{
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_ipv4, tvb, tlv_offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv4, tvb, tlv_offset + 4, 4, ENC_BIG_ENDIAN);
}
break;
case CST_PKT_CLASS_RULE_DST_IP:
/* add TLV subtree */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_ip_masked_dest_address, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_wimax_cst_encoding_rules);
if(ipv6)
{
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_ipv6, tvb, tlv_offset, 16, ENC_NA);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv6, tvb, tlv_offset + 16, 16, ENC_NA);
}
else
{
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_ipv4, tvb, tlv_offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_ipv4, tvb, tlv_offset + 4, 4, ENC_BIG_ENDIAN);
}
break;
case CST_PKT_CLASS_RULE_SRCPORT_RANGE:
/* add TLV subtree */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_prot_src_port_range, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_wimax_cst_encoding_rules);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_port_low, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_port_high, tvb, tlv_offset + 2, 2, ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_DSTPORT_RANGE:
/* add TLV subtree */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_prot_dest_port_range, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_wimax_cst_encoding_rules);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_port_low, tvb, tlv_offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_port_high, tvb, tlv_offset + 2, 2, ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_DST_MAC:
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_dest_mac_address, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_wimax_cst_encoding_rules);
/* add TLV subtree */
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_dest_mac, tvb, tlv_offset, 6, ENC_NA);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_mac, tvb, tlv_offset + 6, 6, ENC_NA);
break;
case CST_PKT_CLASS_RULE_SRC_MAC:
/* add TLV subtree */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_src_mac_address, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_wimax_cst_encoding_rules);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_src_mac, tvb, tlv_offset, 6, ENC_NA);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_mask_mac, tvb, tlv_offset + 6, 6, ENC_NA);
break;
case CST_PKT_CLASS_RULE_ETHERTYPE:
/* add TLV subtree */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_ethertype, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_wimax_cst_encoding_rules);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_etype, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_eprot1, tvb, tlv_offset + 1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_eprot2, tvb, tlv_offset + 2, 1, ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_USER_PRIORITY:
/* add TLV subtree */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_user_priority, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_wimax_cst_encoding_rules);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_pri_low, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_pri_high, tvb, tlv_offset + 1, 1, ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_VLAN_ID:
/* add TLV subtree */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_vlan_id, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_NA);
ti_tree = proto_item_add_subtree(ti_item, ett_wimax_cst_encoding_rules);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_vlan_id1, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_vlan_id2, tvb, tlv_offset + 1, 1, ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_PHSI:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_phsi, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_INDEX:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_index, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_IPv6_FLOW_LABEL:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_ipv6_flow_label, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_VENDOR_SPEC:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_vendor_spec, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_NA);
break;
case CST_CLASSIFIER_ACTION_RULE:
/* add TLV subtree */
ti_item = add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_pkt_class_rule_classifier_action_rule, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
ti_tree = proto_item_add_subtree(ti_item, ett_wimax_cst_encoding_rules);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_classifier_action_rule_bit0, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ti_tree, hf_cst_pkt_class_rule_classifier_action_rule_bit1, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_LARGE_CONTEXT_ID:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_large_context_id, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case CST_PKT_CLASS_RULE_SHORT_FORMAT_CONTEXT_ID:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_short_format_context_id, tvb, tlv_offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
default:
break;
} /* end of switch */
tlv_offset += length;
} /* end of while loop */
break;
}
case CST_PHS_DSC_ACTION:
add_tlv_subtree(&tlv_info, csper_tree, hf_cst_phs_dsc_action, tvb, offset-get_tlv_value_offset(&tlv_info), ENC_BIG_ENDIAN);
break;
case CST_PHS_RULE:
{
/* add TLV subtree */
tlv_item = add_tlv_subtree(&tlv_info, csper_tree, hf_cst_phs_rule, tvb, offset-get_tlv_value_offset(&tlv_info), ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_wimax_cst_encoding_rules);
tlv_offset = offset;
while(tlv_offset < (tlv_len + offset))
{
/* get the TLV information */
init_tlv_info(&tlv_info, tvb, 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PHS n Rule TLV error");
proto_tree_add_item(tlv_tree, hf_cst_invalid_tlv, tvb, offset, (tlv_len - tlv_offset), ENC_NA);
break;
}
#ifdef DEBUG /* for debug only */
proto_tree_add_protocol_format(csper_tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len+2+get_tlv_size_of_length(&tlv_info)), "PHS Rule TLV Type: %u (%u bytes, offset=%u, tlv_len=%u)", tlv_type, length, offset, tlv_len);
#endif
switch (tlv_type)
{
case CST_PHS_PHSI:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_phs_phsi, tvb, tlv_offset, ENC_BIG_ENDIAN);
break;
case CST_PHS_PHSF:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_phs_phsf, tvb, tlv_offset, ENC_NA);
break;
case CST_PHS_PHSM:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_phs_phsm, tvb, tlv_offset, ENC_NA);
break;
case CST_PHS_PHSS:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_phs_phss, tvb, tlv_offset, ENC_BIG_ENDIAN);
break;
case CST_PHS_PHSV:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_phs_phsv, tvb, tlv_offset, ENC_BIG_ENDIAN);
break;
case CST_PHS_VENDOR_SPEC:
add_tlv_subtree(&tlv_info, tlv_tree, hf_cst_phs_vendor_spec, tvb, tlv_offset, ENC_NA);
break;
}
tlv_offset += (length+get_tlv_value_offset(&tlv_info));
}
break;
}
default:
/* display the unknown csper type in hex */
add_tlv_subtree(&tlv_info, tree, hf_csper_unknown_type, tvb, offset-get_tlv_value_offset(&tlv_info), ENC_NA);
break;
} /* end of switch */
} /* end of if */
offset += tlv_len;
} /* end of while loop */
}
/**************************************************************/
/* wimax_service_flow_encodings_decoder() */
/* decode and display the WiMax Service Flow Encodings */
/* parameter: */
/* tvb - pointer of the tvb of service flow encodings */
/* tree - pointer of Wireshark display tree */
/* pinfo - pointer of Wireshark packet information structure*/
/**************************************************************/
void wimax_service_flow_encodings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset, i;
guint tvb_len, tlv_len, tlv_value_offset, tlv_value;
gint tlv_type;
guint value;
proto_item *tlv_item = NULL;
proto_tree *tlv_tree = NULL;
tlv_info_t tlv_info;
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
#ifdef DEBUG /* for debug only */
/* display dissector information */
proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, 0, tvb_len, "WiMax Service Flow Encodings (%u bytes)", tvb_len);
#endif
/* process WiMax Service Flow Encodings */
offset = 0;
/* do nothing if the TLV fields is not exist */
if(!tvb_len)
return;
/* report error if the packet size is less than 2 bytes (type+length) */
if(tvb_len < 2)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Service Flow Encodings");
return;
}
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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Service Flow Encodings TLV error");
proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Service Flow Encodings TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, tlv_len, offset, tvb_len);
#endif
/* update the offset */
offset += tlv_value_offset;
/* parse the Service Flow Encodings TLV */
switch (tlv_type)
{
case SFE_SF_ID:
add_tlv_subtree(&tlv_info, tree, hf_sfe_sf_id, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_CID:
add_tlv_subtree(&tlv_info, tree, hf_sfe_cid, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_SERVICE_CLASS_NAME:
add_tlv_subtree(&tlv_info, tree, hf_sfe_service_class_name, tvb, offset-tlv_value_offset, ENC_ASCII|ENC_NA);
break;
case SFE_MBS_SERVICE:
add_tlv_subtree(&tlv_info, tree, hf_sfe_mbs_service, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_QOS_PARAMS_SET:
/* add TLV subtree */
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_sfe_qos_params_set, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_wimax_service_flow_encodings);
proto_tree_add_item(tlv_tree, hf_sfe_set_provisioned, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sfe_set_admitted, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sfe_set_active, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sfe_set_rsvd, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SFE_TRAFFIC_PRIORITY:
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_sfe_traffic_priority, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
proto_item_append_text(tlv_item, " (allowed values are 0-7)");
break;
case SFE_MAX_STR:
add_tlv_subtree(&tlv_info, tree, hf_sfe_max_str, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_MAX_TRAFFIC_BURST:
add_tlv_subtree(&tlv_info, tree, hf_sfe_max_traffic_burst, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_MIN_RTR:
add_tlv_subtree(&tlv_info, tree, hf_sfe_min_rtr, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_RESERVED_10:
add_tlv_subtree(&tlv_info, tree, hf_sfe_reserved_10, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_UL_SCHEDULING:
/* TODO: Find a way to get the correct service type from the TLV */
tlv_value = tvb_get_guint8(tvb, offset);
set_service_type( tlv_value );
add_tlv_subtree(&tlv_info, tree, hf_sfe_ul_grant_scheduling, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_TX_POLICY:
/* add TLV subtree */
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_sfe_req_tx_policy, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_wimax_service_flow_encodings);
proto_tree_add_item(tlv_tree, hf_sfe_policy_broadcast_bwr, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sfe_policy_multicast_bwr, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sfe_policy_piggyback, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sfe_policy_fragment, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sfe_policy_headers, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sfe_policy_packing, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sfe_policy_crc, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_sfe_policy_rsvd1, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SFE_TOLERATED_JITTER:
add_tlv_subtree(&tlv_info, tree, hf_sfe_jitter, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_MAX_LATENCY:
add_tlv_subtree(&tlv_info, tree, hf_sfe_max_latency, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_FIXED_LEN_SDU:
add_tlv_subtree(&tlv_info, tree, hf_sfe_fixed_len_sdu, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_SDU_SIZE:
/* save the SDU size */
mac_sdu_length = tvb_get_guint8(tvb, offset);
add_tlv_subtree(&tlv_info, tree, hf_sfe_sdu_size, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_TARGET_SAID:
add_tlv_subtree(&tlv_info, tree, hf_sfe_target_said, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_ARQ_ENABLE:
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_enable, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_ARQ_WINDOW_SIZE:
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_window_size, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_ARQ_TRANSMITTER_DELAY:
if (include_cor2_changes)
{
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_transmitter_delay_cor2, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
}
else
{
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_transmitter_delay, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
}
break;
case SFE_ARQ_RECEIVER_DELAY:
if (include_cor2_changes)
{
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_receiver_delay_cor2, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
}
else
{
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_receiver_delay, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
}
break;
case SFE_ARQ_BLOCK_LIFETIME:
if (include_cor2_changes)
{
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_block_lifetime_cor2, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
}
else
{
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_block_lifetime, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
}
break;
case SFE_ARQ_SYNC_LOSS_TIMEOUT:
if (include_cor2_changes)
{
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_sync_loss_timeout_cor2, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
}
else
{
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_sync_loss_timeout, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
}
break;
case SFE_ARQ_DELIVER_IN_ORDER:
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_deliver_in_order, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_ARQ_RX_PURGE_TIMEOUT:
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_rx_purge_timeout, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_ARQ_BLOCK_SIZE:
if (include_cor2_changes)
{
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_block_size_cor2, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
/* add TLV subtree */
tlv_tree = proto_item_add_subtree(tlv_item, ett_wimax_service_flow_encodings);
value = tvb_get_guint8(tvb, offset);
tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_arq_min_block_size, tvb, offset, 1, ENC_BIG_ENDIAN);
/* Size is 2^((value & 0x0F) + 4)) */
proto_item_append_text(tlv_item, " ( %d bytes )", 0x10 << (value & 0x0F));
tlv_item = proto_tree_add_item(tlv_tree, hf_sfe_arq_max_block_size, tvb, offset, 1, ENC_BIG_ENDIAN);
if (value & 0xF0)
/* Size is 2^(((value & 0xF0) >> 4) + 4)) */
proto_item_append_text(tlv_item, " ( %d bytes )", 0x10 << ((value & 0xF0) >> 4));
}
else
{
add_tlv_subtree(&tlv_info, tree, hf_sfe_arq_block_size, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
}
break;
case SFE_CS_SPECIFICATION:
add_tlv_subtree(&tlv_info, tree, hf_sfe_cs_specification, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_TYPE_OF_DATA_DELIVERY_SERVICES:
add_tlv_subtree(&tlv_info, tree, hf_sfe_type_of_data_delivery_services, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_SDU_INTER_ARRIVAL_INTERVAL:
add_tlv_subtree(&tlv_info, tree, hf_sfe_sdu_inter_arrival_interval, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_TIME_BASE:
add_tlv_subtree(&tlv_info, tree, hf_sfe_time_base, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_PAGING_PREFERENCE:
add_tlv_subtree(&tlv_info, tree, hf_sfe_paging_preference, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_MBS_ZONE_IDENTIFIER_ASSIGNMENT:
add_tlv_subtree(&tlv_info, tree, hf_sfe_mbs_zone_identifier_assignment, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_RESERVED_34:
add_tlv_subtree(&tlv_info, tree, hf_sfe_reserved_34, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_GLOBAL_SERVICE_CLASS_NAME:
add_tlv_subtree(&tlv_info, tree, hf_sfe_global_service_class_name, tvb, offset-tlv_value_offset, ENC_ASCII|ENC_NA);
break;
/* 36 reserved */
case SFE_RESERVED_36:
add_tlv_subtree(&tlv_info, tree, hf_sfe_reserved_36, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_SN_FEEDBACK_ENABLED:
add_tlv_subtree(&tlv_info, tree, hf_sfe_sn_feedback_enabled, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_FSN_SIZE:
add_tlv_subtree(&tlv_info, tree, hf_sfe_fsn_size, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_CID_ALLOCATION_FOR_ACTIVE_BS:
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_sfe_cid_alloc_for_active_bs_cid, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_wimax_service_flow_encodings);
for(i = 0; i < tlv_len; i+=2)
proto_tree_add_item(tlv_tree, hf_sfe_cid_alloc_for_active_bs_cid, tvb, (offset+i), 2, ENC_BIG_ENDIAN);
break;
case SFE_UNSOLICITED_GRANT_INTERVAL:
add_tlv_subtree(&tlv_info, tree, hf_sfe_unsolicited_grant_interval, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_UNSOLOCITED_POLLING_INTERVAL:
add_tlv_subtree(&tlv_info, tree, hf_sfe_unsolicited_polling_interval, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_PDU_SN_EXT_SUBHEADER_HARQ_REORDER:
add_tlv_subtree(&tlv_info, tree, hf_sfe_pdu_sn_ext_subheader_reorder, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_MBS_CONTENTS_ID:
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_sfe_mbs_contents_ids, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_wimax_service_flow_encodings);
for(i = 0; i < tlv_len; i+=2)
proto_tree_add_item(tlv_tree, hf_sfe_mbs_contents_ids_id, tvb, (offset+i), 2, ENC_BIG_ENDIAN);
break;
case SFE_HARQ_SERVICE_FLOWS:
add_tlv_subtree(&tlv_info, tree, hf_sfe_harq_service_flows, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case SFE_AUTHORIZATION_TOKEN:
add_tlv_subtree(&tlv_info, tree, hf_sfe_authorization_token, tvb, offset-tlv_value_offset, ENC_NA);
break;
case SFE_HARQ_CHANNEL_MAPPING:
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_sfe_harq_channel_mapping_index, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_wimax_service_flow_encodings);
for(i = 0; i < tlv_len; i++)
proto_tree_add_item(tlv_tree, hf_sfe_harq_channel_mapping_index, tvb, (offset+i), 1, ENC_BIG_ENDIAN);
break;
/* 99 - 111 CS parameter encodings */
case SFE_CSPER_ATM:
case SFE_CSPER_PACKET_IPV4:
case SFE_CSPER_PACKET_IPV6:
case SFE_CSPER_PACKET_802_3:
case SFE_CSPER_PACKET_802_1Q:
case SFE_CSPER_PACKET_IPV4_802_3:
case SFE_CSPER_PACKET_IPV6_802_3:
case SFE_CSPER_PACKET_IPV4_802_1Q:
case SFE_CSPER_PACKET_IPV6_802_1Q:
case SFE_CSPER_PACKET_IP_ROCH_COMPRESSION:
case SFE_CSPER_PACKET_IP_ECRTP_COMPRESSION:
case SFE_CSPER_PACKET_IP_802_3_ROCH_COMPRESSION:
case SFE_CSPER_PACKET_IP_802_3_ECRTP_COMPRESSION:
/* call CS Parameter Encoding Rules handling function */
tlv_tree = add_protocol_subtree(&tlv_info, ett_wimax_service_flow_encodings, tree, proto_wimax_utility_decoders, tvb, offset-tlv_value_offset, tlv_len, "CS Parameter Encoding Rules");
wimax_convengence_service_parameter_encoding_rules_decoder(tlv_type, tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
default:
add_tlv_subtree(&tlv_info, tree, hf_sfe_unknown_type, tvb, offset-tlv_value_offset, ENC_NA);
break;
} /* end of switch */
offset += tlv_len;
} /* end of while loop */
}
/**************************************************************/
/* wimax_hmac_tuple_decoder() */
/* decode and display the WiMax HMAC Tuple (Table 348) */
/* parameter: */
/* tree - pointer of Wireshark display tree */
/* tvb - pointer of the tvb which contains the HMAC Tuple */
/* offset - the HMAC Tuple offset in the tvb */
/* length - length of the HMAC Tuple */
/**************************************************************/
void wimax_hmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
{
guint hmac_offset;
proto_item *hmac_item = NULL;
proto_tree *hmac_tree = NULL;
/* display decoder info (length should be 21 bytes) */
hmac_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, length, "HMAC Tuple (%u bytes)", length);
/* add HMAC subtree */
hmac_tree = proto_item_add_subtree(hmac_item, ett_wimax_hmac_tuple);
/* init the local offset */
hmac_offset = offset;
/* decode and display HMAC Tuple */
proto_tree_add_item(hmac_tree, hf_xmac_tuple_rsvd, tvb, hmac_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(hmac_tree, hf_xmac_tuple_key_seq_num, tvb, hmac_offset, 1, ENC_BIG_ENDIAN);
hmac_offset++;
proto_tree_add_item(hmac_tree, hf_hmac_tuple_hmac_digest, tvb, hmac_offset, (length-1), ENC_NA);
}
/**************************************************************/
/* wimax_cmac_tuple_decoder() */
/* decode and display the WiMax CMAC Tuple (Table 348b) */
/* parameter: */
/* tree - pointer of Wireshark display tree */
/* tvb - pointer of the tvb which contains the CMAC Tuple */
/* offset - the CMAC Tuple offset in the tvb */
/* length - length of the CMAC Tuple */
/**************************************************************/
void wimax_cmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
{
guint cmac_offset;
proto_item *cmac_item = NULL;
proto_tree *cmac_tree = NULL;
/* display decoder info (length should be 13 or 19 bytes) */
cmac_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, length, "CMAC Tuple (%u bytes)", length);
/* add CMAC subtree */
cmac_tree = proto_item_add_subtree(cmac_item, ett_wimax_cmac_tuple);
/* init the local offset */
cmac_offset = offset;
/* decode and display CMAC Tuple */
proto_tree_add_item(cmac_tree, hf_xmac_tuple_rsvd, tvb, cmac_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(cmac_tree, hf_xmac_tuple_key_seq_num, tvb, cmac_offset, 1, ENC_BIG_ENDIAN);
cmac_offset++;
if(length > 13)
{
proto_tree_add_item(cmac_tree, hf_cmac_tuple_bsid, tvb, cmac_offset, 6, ENC_NA);
cmac_offset += 6;
}
proto_tree_add_item(cmac_tree, hf_packet_number_counter, tvb, cmac_offset, 4, ENC_BIG_ENDIAN);
cmac_offset += 4;
proto_tree_add_item(cmac_tree, hf_cmac_tuple_cmac_value, tvb, cmac_offset, 8, ENC_NA);
}
/******************************************************************/
/* wimax_short_hmac_tuple_decoder() */
/* decode and display the WiMax Short-HMAC Tuple (Table 348d) */
/* parameter: */
/* tree - pointer of Wireshark display tree */
/* tvb - pointer of the tvb which contains the Short-HMAC Tuple */
/* offset - the Short-HMAC Tuple offset in the tvb */
/* length - length of the Short-HMAC Tuple */
/******************************************************************/
void wimax_short_hmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length)
{
guint hmac_offset;
proto_item *hmac_item = NULL;
proto_tree *hmac_tree = NULL;
/* display decoder info (length should be at least 13 bytes ???) */
hmac_item = proto_tree_add_protocol_format(tree, proto_wimax_utility_decoders, tvb, offset, length, "Short-HMAC Tuple (%u bytes)", length);
/* add Short-HMAC subtree */
hmac_tree = proto_item_add_subtree(hmac_item, ett_wimax_short_hmac_tuple);
/* init the local offset */
hmac_offset = offset;
/* decode and display Short-HMAC Tuple */
proto_tree_add_item(hmac_tree, hf_xmac_tuple_rsvd, tvb, hmac_offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(hmac_tree, hf_xmac_tuple_key_seq_num, tvb, hmac_offset, 1, ENC_BIG_ENDIAN);
hmac_offset++;
proto_tree_add_item(hmac_tree, hf_packet_number_counter, tvb, hmac_offset, 4, ENC_BIG_ENDIAN);
hmac_offset += 4;
proto_tree_add_item(hmac_tree, hf_hmac_tuple_hmac_digest, tvb, hmac_offset, length - offset - 3, ENC_NA);
}
/******************************************************************/
/* wimax_security_negotiation_parameters_decoder() */
/* decode and display the WiMax Security Negotiation Parameters */
/* parameter: */
/* tvb - pointer of the tvb of service flow encodings */
/* tree - pointer of Wireshark display tree */
/* pinfo - pointer of Wireshark packet information structure */
/******************************************************************/
void wimax_security_negotiation_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset;
guint tvb_len, tlv_len, tlv_value_offset;
gint tlv_type;
proto_tree *tlv_tree;
proto_item *tlv_item;
tlv_info_t tlv_info;
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* do nothing if the TLV fields is not exist */
if(!tvb_len)
return;
/* report error if the packet size is less than 2 bytes (type+length) */
if(tvb_len < 2)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Security Negotiation Parameters");
return;
}
/* process Security Negotiation Parameter TLVs */
for(offset = 0; 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Security Negotiation Params TLV error");
proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Security Negotiation Parameters Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
#endif
/* update the offset */
offset += tlv_value_offset;
/* parse Security Negotiation Parameters TLVs */
switch (tlv_type)
{
case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PKM_VERSION_SUPPORT:
/* add TLV subtree */
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_snp_pkm_version_support, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_security_negotiation_parameters);
proto_tree_add_item(tlv_tree, hf_snp_pkm_version_support_bit0, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_snp_pkm_version_support_bit1, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_snp_pkm_version_support_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_AUTHORIZATION_POLICY_SUPPORT:
/* add TLV subtree */
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_snp_auth_policy_support, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_security_negotiation_parameters);
proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit0, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit1, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit3, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit4, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit5, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit6, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_snp_auth_policy_support_bit7, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_MESSAGE_AUTHENTICATION_CODE:
/* add TLV subtree */
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_snp_mac_mode, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_security_negotiation_parameters);
proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit0, tvb, offset, 1, ENC_BIG_ENDIAN);
if (include_cor2_changes)
{
proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit1_rsvd, tvb, offset, 1, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit1, tvb, offset, 1, ENC_BIG_ENDIAN);
}
proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit3, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit4, tvb, offset, 1, ENC_BIG_ENDIAN);
if (include_cor2_changes)
{
proto_tree_add_item(tlv_tree, hf_snp_mac_mode_bit5, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_snp_mac_mode_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
}
else
{
proto_tree_add_item(tlv_tree, hf_snp_mac_mode_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
}
break;
case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PN_WINDOW_SIZE:
add_tlv_subtree(&tlv_info, tree, hf_snp_pn_window_size, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_PKM_FLOW_CONTROL:
add_tlv_subtree(&tlv_info, tree, hf_snp_max_conc_transactions, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETER_SUB_MAX_SUPPT_SECURITY_ASSNS:
add_tlv_subtree(&tlv_info, tree, hf_snp_max_suppt_sec_assns, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
default:
add_tlv_subtree(&tlv_info, tree, hf_snp_unknown_type, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
offset += tlv_len;
}
}
/******************************************************************/
/* wimax_cryptographic_suite_list_decoder() */
/* decode and display the WiMax Cryptographic Suite List */
/* parameter: */
/* tvb - pointer of the tvb of service flow encodings */
/* tree - pointer of Wireshark display tree */
/* pinfo - pointer of Wireshark packet information structure */
/******************************************************************/
void wimax_cryptographic_suite_list_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset;
guint tvb_len, tlv_len, tlv_value_offset;
gint tlv_type;
proto_tree *tlv_tree;
proto_item *tlv_item;
tlv_info_t tlv_info;
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* do nothing if the TLV fields is not exist */
if(!tvb_len)
return;
/* report error if the packet size is less than 2 bytes (type+length) */
if(tvb_len < 2)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Crypto Suite List");
return;
}
/* process Cryptographic Suite List (11.9.15) */
for(offset = 0; 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Crypto Suite List TLV error");
proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Cryptographic Suite List TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
#endif
/* update the offset for the TLV value */
offset += tlv_value_offset;
/* parse Cryptographic Suite List */
switch (tlv_type)
{
case PKM_ATTR_CRYPTO_SUITE:
/* add subtree */
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_crypto_suite, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
tlv_tree = proto_item_add_subtree(tlv_item, ett_cryptographic_suite_list_decoder);
proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_msb, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_middle, tvb, offset+1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_lsb, tvb, offset+2, 1, ENC_BIG_ENDIAN);
break;
default:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_unknown_type, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
offset += tlv_len;
} /* end of TLV process while loop */
}
/******************************************************************/
/* wimax_pkm_tlv_encoded_attributes_decoder() */
/* decode and display the WiMax PKM message TLV Encoded Attributes*/
/* parameter: */
/* tvb - pointer of the tvb of service flow encodings */
/* tree - pointer of Wireshark display tree */
/* pinfo - pointer of Wireshark packet information structure */
/******************************************************************/
void wimax_pkm_tlv_encoded_attributes_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset;
guint tvb_len, tlv_len, tlv_value_offset;
gint tlv_type;
proto_tree *tlv_tree;
proto_item *tlv_item;
tlv_info_t tlv_info;
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* do nothing if the TLV fields is not exist */
if(!tvb_len)
return;
/* report error if the packet size is less than 2 bytes (type+length) */
if(tvb_len < 2)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid PKM TLV");
return;
}
/* process PKM message TLV Encoded Attributes (11.9) */
for(offset = 0; 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PKM TLV error");
proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "PKM TLV Encoded Attributes TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
#endif
/* update the offset for the TLV value */
offset += tlv_value_offset;
/* parse PKM TLV Encoded Attributes (table 370) */
switch (tlv_type)
{
case PKM_ATTR_DISPLAY_STRING:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_display, tvb, offset-tlv_value_offset, ENC_ASCII|ENC_NA);
break;
case PKM_ATTR_AUTH_KEY:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_auth_key, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_TEK:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_tek, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_KEY_LIFE_TIME:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_key_life_time, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_KEY_SEQ_NUM:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_key_seq_num, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_HMAC_DIGEST:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_hmac_digest, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_SAID:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_said, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_TEK_PARAM:
tlv_tree = add_protocol_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, proto_wimax_utility_decoders, tvb, offset-tlv_value_offset, tlv_len, "TEK Parameters");
/* add subtree */
wimax_tek_parameters_decoder(tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
case PKM_ATTR_CBC_IV:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_cbc_iv, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_ERROR_CODE:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_error_code, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_CA_CERTIFICATE:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_ca_certificate, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_SS_CERTIFICATE:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_ss_certificate, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_SECURITY_CAPABILITIES:
tlv_tree = add_protocol_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, proto_wimax_utility_decoders, tvb, offset-tlv_value_offset, tlv_len, "Security Capabilities");
/* add subtree */
wimax_security_capabilities_decoder(tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
case PKM_ATTR_CRYPTO_SUITE:
/* add subtree */
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_crypto_suite, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_pkm_tlv_encoded_attributes_decoder);
proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_msb, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_middle, tvb, offset+1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_lsb, tvb, offset+2, 1, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_CRYPTO_LIST:
tlv_tree = add_protocol_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, proto_wimax_utility_decoders, tvb, offset-tlv_value_offset, tlv_len, "Cryptographic-Suite List");
/* add subtree */
wimax_cryptographic_suite_list_decoder(tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
#if 0 /* rserved by IEE 802.16E */
case PKM_ATTR_VERSION:
proto_tree_add_item(tree, hf_pkm_msg_version, tvb, offset, tlv_len, ENC_BIG_ENDIAN);
break;
#endif
case PKM_ATTR_SA_DESCRIPTOR:
tlv_tree = add_protocol_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, proto_wimax_utility_decoders, tvb, offset-tlv_value_offset, tlv_len, "SA-Descriptor");
/* add subtree */
wimax_sa_descriptor_decoder(tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
case PKM_ATTR_SA_TYPE:
add_tlv_subtree(&tlv_info, tree, hf_pkm_sa_type, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_SECURITY_NEGOTIATION_PARAMETERS:
tlv_tree = add_protocol_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, proto_wimax_utility_decoders, tvb, offset-tlv_value_offset, tlv_len, "Security Negotiation Parameters");
/* add subtree */
wimax_security_negotiation_parameters_decoder(tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
case PKM_ATTR_PKM_CONFIG_SETTINGS:
/* add subtree */
tlv_tree = add_protocol_subtree(&tlv_info, ett_pkm_tlv_encoded_attributes_decoder, tree, proto_wimax_utility_decoders, tvb, offset-tlv_value_offset, tlv_len, "PKM Configuration Settings");
wimax_pkm_configuration_settings_decoder(tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
case PKM_ATTR_PKM_EAP_PAYLOAD:
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_eap_payload, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_pkm_tlv_encoded_attributes_decoder);
if (eap_handle)
call_dissector(eap_handle, tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
case PKM_ATTR_PKM_NONCE:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_nonce, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_AUTH_RESULT_CODE:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_auth_result_code, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_SA_SERVICE_TYPE:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_sa_service_type, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_FRAME_NUMBER:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_frame_number, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_SS_RANDOM:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_ss_random, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_BS_RANDOM:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_bs_random, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_PRE_PAK:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_pre_pak, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_BS_CERTIFICATE:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_bs_certificate, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_SIG_BS:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_sig_bs, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_MS_MAC_ADDRESS:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_ms_mac_address, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_CMAC_DIGEST:
/* add TLV subtree */
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_cmac_digest, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_pkm_tlv_encoded_attributes_decoder);
proto_tree_add_item(tlv_tree, hf_pkm_attr_cmac_digest_pn, tvb, offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_pkm_attr_cmac_digest_value, tvb, (offset + 4), 8, ENC_NA);
break;
case PKM_ATTR_KEY_PUSH_MODES:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_push_modes, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_KEY_PUSH_COUNTER:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_key_push_counter, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_GKEK:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_gkek, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_SIG_SS:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_sig_ss, tvb, offset-tlv_value_offset, ENC_NA);
break;
case PKM_ATTR_AKID:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_akid, tvb, offset-tlv_value_offset, ENC_NA);
break;
default:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_unknown_type, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
offset += tlv_len;
} /* end of TLV process while loop */
}
/******************************************************************/
/* wimax_tek_parameters_decoder() */
/* decode and display the WiMax TEK Parameters subattributes */
/* parameter: */
/* tvb - pointer of the tvb of service flow encodings */
/* tree - pointer of Wireshark display tree */
/* pinfo - pointer of Wireshark packet information structure */
/******************************************************************/
void wimax_tek_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset;
guint tvb_len, tlv_len, tlv_value_offset;
gint tlv_type;
tlv_info_t tlv_info;
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* do nothing if the TLV fields is not exist */
if(!tvb_len)
return;
/* report error if the packet size is less than 2 bytes (type+length) */
if(tvb_len < 2)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid TEK Params");
return;
}
/* process PKM Message TEK Parameters (11.9.8) */
for(offset = 0; 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "TEK Param TLV error");
proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "TEK Parameters Subattributes TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
#endif
/* parse TEK Parameters Subattributes (table 372) */
switch (tlv_type)
{
case PKM_ATTR_TEK:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_tek, tvb, offset, ENC_NA);
break;
case PKM_ATTR_KEY_LIFE_TIME:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_key_life_time, tvb, offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_KEY_SEQ_NUM:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_key_seq_num, tvb, offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_CBC_IV:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_cbc_iv, tvb, offset, ENC_NA);
break;
case PKM_ATTR_ASSOCIATED_GKEK_SEQ_NUM:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_associated_gkek_seq_number, tvb, offset, ENC_NA);
break;
default:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_unknown_type, tvb, offset, ENC_NA);
break;
}
offset += (tlv_len+tlv_value_offset);
} /* end of TLV process while loop */
}
/******************************************************************/
/* wimax_pkm_configuration_settings_decoder() */
/* decode and display the WiMax PKM Configuration Settings */
/* parameter: */
/* tvb - pointer of the tvb of service flow encodings */
/* tree - pointer of Wireshark display tree */
/* pinfo - pointer of Wireshark packet information structure */
/******************************************************************/
void wimax_pkm_configuration_settings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset;
guint tvb_len, tlv_len, tlv_value_offset;
gint tlv_type;
tlv_info_t tlv_info;
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* do nothing if the TLV fields is not exist */
if(!tvb_len)
return;
/* report error if the packet size is less than 2 bytes (type+length) */
if(tvb_len < 2)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid PKM Config Settings");
return;
}
/* process PKM Configuration Settings (11.9.19) */
for(offset = 0; 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "PKM Config Settings TLV error");
proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "PKM Configuration Settings TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
#endif
/* parse PKM Configuration Settings (11.9.19.1 - 11.9.19.7 */
switch (tlv_type)
{
case PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZE_WAIT_TIMEOUT:
add_tlv_subtree(&tlv_info, tree, hf_pkm_config_settings_authorize_waitout, tvb, offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_PKM_CONFIG_SETTINGS_REAUTHORIZE_WAIT_TIMEOUT:
add_tlv_subtree(&tlv_info, tree, hf_pkm_config_settings_reauthorize_waitout, tvb, offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZATION_GRACE_TIME:
add_tlv_subtree(&tlv_info, tree, hf_pkm_config_settings_grace_time, tvb, offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_PKM_CONFIG_SETTINGS_OPERATIONAL_WAIT_TIMEOUT:
add_tlv_subtree(&tlv_info, tree, hf_pkm_config_settings_operational_waittime, tvb, offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_PKM_CONFIG_SETTINGS_REKEY_WAIT_TIMEOUT:
add_tlv_subtree(&tlv_info, tree, hf_pkm_config_settings_rekey_wait_timeout, tvb, offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_PKM_CONFIG_SETTINGS_TEK_GRACE_TIME:
add_tlv_subtree(&tlv_info, tree, hf_pkm_config_settings_tek_grace_time, tvb, offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_PKM_CONFIG_SETTINGS_AUTHORIZE_REJECT_WAIT_TIMEOUT:
add_tlv_subtree(&tlv_info, tree, hf_pkm_config_settings_authorize_reject_wait_timeout, tvb, offset, ENC_BIG_ENDIAN);
break;
default:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_unknown_type, tvb, offset, ENC_NA);
break;
}
offset += (tlv_len+tlv_value_offset);
} /* end of TLV process while loop */
}
/******************************************************************/
/* wimax_sa_descriptor_decoder() */
/* decode and display the WiMax PKM message SA-Descriptor */
/* parameter: */
/* tvb - pointer of the tvb of service flow encodings */
/* tree - pointer of Wireshark display tree */
/* pinfo - pointer of Wireshark packet information structure */
/******************************************************************/
void wimax_sa_descriptor_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset;
guint tvb_len, tlv_len, tlv_value_offset;
gint tlv_type;
proto_tree *tlv_tree;
proto_item *tlv_item;
tlv_info_t tlv_info;
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* do nothing if the TLV fields is not exist */
if(!tvb_len)
return;
/* report error if the packet size is less than 2 bytes (type+length) */
if(tvb_len < 2)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid SA-Descriptor");
return;
}
/* process SA-Descriptor (11.9.17) */
for(offset = 0; 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "SA-Descriptor TLV error");
proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "SA-Descriptor TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
#endif
/* update the offset for the TLV value */
offset += tlv_value_offset;
/* parse SA-Descriptor (table 380) */
switch (tlv_type)
{
case PKM_ATTR_SAID:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_attr_said, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_SA_TYPE:
add_tlv_subtree(&tlv_info, tree, hf_pkm_sa_type, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_SA_SERVICE_TYPE:
add_tlv_subtree(&tlv_info, tree, hf_pkm_attr_sa_service_type, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case PKM_ATTR_CRYPTO_SUITE:
/* add subtree */
tlv_item = add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_crypto_suite, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_sa_descriptor_decoder);
proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_msb, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_middle, tvb, offset+1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_pkm_msg_crypto_suite_lsb, tvb, offset+2, 1, ENC_BIG_ENDIAN);
break;
default:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_unknown_type, tvb, offset-tlv_value_offset, ENC_NA);
break;
}
offset += tlv_len;
} /* end of TLV process while loop */
}
/******************************************************************/
/* wimax_security_capabilities_decoder() */
/* decode and display the WiMax Security Capabilities */
/* parameter: */
/* tvb - pointer of the tvb of service flow encodings */
/* tree - pointer of Wireshark display tree */
/* pinfo - pointer of Wireshark packet information structure */
/******************************************************************/
void wimax_security_capabilities_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset;
guint tvb_len, tlv_len, tlv_value_offset;
gint tlv_type;
proto_tree *tlv_tree = NULL;
tlv_info_t tlv_info;
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* do nothing if the TLV fields is not exist */
if(!tvb_len)
return;
/* report error if the packet size is less than 2 bytes (type+length) */
if(tvb_len < 2)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Security Capabilities");
return;
}
/* process Security Capabilities (11.9.13) */
for(offset = 0; 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Security Capabilities TLV error");
proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Security Capabilities TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
#endif
/* parse Security Capabilities (table 374) */
switch (tlv_type)
{
case PKM_ATTR_CRYPTO_LIST:
tlv_tree = add_protocol_subtree(&tlv_info, ett_security_capabilities_decoder, tree, proto_wimax_utility_decoders, tvb, offset, tlv_len, "Cryptographic-Suite List");
/* add subtree */
wimax_cryptographic_suite_list_decoder(tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
default:
add_tlv_subtree(&tlv_info, tree, hf_pkm_msg_unknown_type, tvb, offset, ENC_NA);
break;
}
offset += (tlv_len+tlv_value_offset);
} /* end of TLV process while loop */
}
/******************************************************************/
/* wimax_vendor_specific_information_decoder() */
/* decode and display the WiMax Vendor-Specific Information */
/* parameter: */
/* tvb - pointer of the tvb of service flow encodings */
/* tree - pointer of Wireshark display tree */
/* pinfo - pointer of Wireshark packet information structure */
/******************************************************************/
void wimax_vendor_specific_information_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset;
guint tvb_len, tlv_len, tlv_value_offset;
gint tlv_type;
tlv_info_t tlv_info;
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* do nothing if the TLV fields is not exist */
if(!tvb_len)
return;
/* report error if the packet size is less than 2 bytes (type+length) */
if(tvb_len < 2)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Vendor Specific Info");
proto_tree_add_expert(tree, pinfo, &ei_common_tlv_info, tvb, 0, tvb_len);
return;
}
/* process Vendor Specific Information (11.1.6) */
for(offset = 0; 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Vendor Specific Info TLV error");
proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Vendor Specific Info TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
#endif
/* parse Vendor Specific Information (11.1.6) */
if(tlv_type == VENDOR_ID_ENCODING)
{
/* decode and display the Vendor ID Encoding */
add_tlv_subtree(&tlv_info, tree, hf_common_tlv_vendor_id, tvb, offset, ENC_NA);
}
else
{
/* decode and display the Vendor Specific Info */
proto_tree_add_item(tree, hf_common_tlv_vendor_specific_type, tvb, offset, 1, ENC_BIG_ENDIAN);
if(get_tlv_length_type(&tlv_info) == 0)
{ /* single byte TLV length */
proto_tree_add_item(tree, hf_common_tlv_vendor_specific_length, tvb, (offset + 1), 1, ENC_BIG_ENDIAN);
}
else
{ /* multiple bytes TLV length */
/* display the length of the TLV length with MSB */
proto_tree_add_item(tree, hf_common_tlv_vendor_specific_length_size, tvb, (offset + 1), 1, ENC_BIG_ENDIAN);
if(get_tlv_size_of_length(&tlv_info))
{ /* display the multiple byte TLV length */
proto_tree_add_uint(tree, hf_common_tlv_vendor_specific_length, tvb, (offset + 2), 1, get_tlv_size_of_length(&tlv_info));
}
else
{ /* length = 0 */
continue;
}
}
proto_tree_add_item(tree, hf_common_tlv_vendor_specific_value, tvb, (offset + tlv_value_offset), tlv_len, ENC_NA);
}
/* update the offset */
offset += tlv_value_offset + tlv_len;
}
}
/******************************************************************/
/* wimax_common_tlv_encoding_decoder() */
/* decode and display the WiMax Common TLV Encoding (Table 346) */
/* parameter: */
/* tvb - pointer of the tvb of service flow encodings */
/* tree - pointer of Wireshark display tree */
/* pinfo - pointer of Wireshark packet information structure */
/******************************************************************/
guint wimax_common_tlv_encoding_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset, value;
guint tvb_len, tlv_len, tlv_value_offset;
gint tlv_type;
proto_tree *tlv_tree = NULL;
tlv_info_t tlv_info;
gfloat current_power;
/* get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* do nothing if the TLV fields is not exist */
if(!tvb_len)
return 0;
/* report error if the packet size is less than 2 bytes (type+length) */
if(tvb_len < 2)
{ /* invalid tlv info */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Invalid Common TLV encoding");
proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, 0, tvb_len, ENC_NA);
return 0;
}
/* process Common TLV Encoding (11.1) */
for(offset = 0; 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 */
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Common TLV encoding TLV error");
proto_tree_add_item(tree, hf_cst_invalid_tlv, tvb, offset, (tvb_len - offset), ENC_NA);
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(tree, proto_wimax_utility_decoders, tvb, offset, (tlv_len + tlv_value_offset), "Common TLV Encoding TLV Type: %u (%u bytes, offset=%u, tvb_len=%u)", tlv_type, (tlv_len + tlv_value_offset), offset, tvb_len);
#endif
/* update the offset for the TLV value */
offset += tlv_value_offset;
/* parse Common TLV Encoding (table 346) */
switch (tlv_type)
{
case VENDOR_SPECIFIC_INFO:
/* display Vendor-Specific Information */
/* add subtree */
tlv_tree = add_protocol_subtree(&tlv_info, ett_vendor_specific_info_decoder, tree, proto_wimax_utility_decoders, tvb, offset-tlv_value_offset, tlv_len, "Vendor-Specific Information");
/* decode and display the Vendor-Specific Information */
wimax_vendor_specific_information_decoder(tvb_new_subset_length(tvb, offset, tlv_len), pinfo, tlv_tree);
break;
case VENDOR_ID_ENCODING:
add_tlv_subtree(&tlv_info, tree, hf_common_tlv_vendor_id, tvb, offset-tlv_value_offset, ENC_NA);
break;
case DSx_UPLINK_FLOW:
/* display Uplink Service Flow Encodings info */
/* add subtree */
tlv_tree = add_protocol_subtree(&tlv_info, ett_ul_service_flow_decoder, tree, proto_wimax_utility_decoders, tvb, offset-tlv_value_offset, tlv_len, "Uplink Service Flow Encodings");
/* decode and display the UL Service Flow Encodings */
wimax_service_flow_encodings_decoder(tvb_new_subset_length(tvb, offset, 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_dl_service_flow_decoder, tree, proto_wimax_utility_decoders, tvb, offset-tlv_value_offset, tlv_len, "Downlink Service Flow Encodings");
/* decode and display the DL Service Flow Encodings */
wimax_service_flow_encodings_decoder(tvb_new_subset_length(tvb,offset, tlv_len), pinfo, tlv_tree);
break;
case CURRENT_TX_POWER:
tlv_tree = add_tlv_subtree_no_item(&tlv_info, tree, hf_common_current_transmitted_power, tvb, offset-tlv_value_offset);
value = tvb_get_guint8(tvb, offset);
current_power = (gfloat)((value - 128) / 2.0);
proto_tree_add_float_format_value(tlv_tree, hf_common_current_transmitted_power, tvb, offset, tvb_len, current_power, "%.2f dBm (Value: 0x%x)", current_power, value);
break;
case MAC_VERSION_ENCODING:
add_tlv_subtree(&tlv_info, tree, hf_common_tlv_mac_version, tvb, offset-tlv_value_offset, ENC_BIG_ENDIAN);
break;
case HMAC_TUPLE: /* Table 348d */
tlv_tree = add_protocol_subtree(&tlv_info, ett_vendor_specific_info_decoder, tree, proto_wimax_utility_decoders, tvb, offset-tlv_value_offset, tlv_len, "HMAC Tuple");
/* decode and display the HMAC Tuple */
wimax_hmac_tuple_decoder(tlv_tree, tvb, offset, tlv_len);
break;
case CMAC_TUPLE: /* Table 348b */
tlv_tree = add_protocol_subtree(&tlv_info, ett_vendor_specific_info_decoder, tree, proto_wimax_utility_decoders, tvb, offset-tlv_value_offset, tlv_len, "CMAC Tuple");
/* decode and display the CMAC Tuple */
wimax_cmac_tuple_decoder(tlv_tree, tvb, offset, tlv_len);
break;
default:
/* Back to calling routine to finish decoding. */
return offset - tlv_value_offset; /* Ret amount decoded. */
break;
}
offset += tlv_len;
} /* end of while loop */
return offset;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C/C++ | wireshark/plugins/epan/wimax/wimax_utils.h | /* wimax_utils.h
* Header file of WiMax Utility Decoders
*
* Copyright (c) 2007 by Intel Corporation.
*
* Author: Lu Pan <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1999 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef WIMAX_UTILS_H
#define WIMAX_UTILS_H
#include <epan/packet.h>
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_power_saving_class(proto_tree *rng_req_tree, gint tlv_type, tvbuff_t *tvb, guint compound_tlv_len, packet_info *pinfo, guint offset);
extern gint dissect_ulmap_ie(proto_tree *ie_tree, packet_info* pinfo, gint offset, gint length, tvbuff_t *tvb);
extern guint get_service_type(void);
extern void init_wimax_globals(void); /* defined in msg_ulmap.c */
extern gboolean is_down_link(packet_info *pinfo);
extern gint RCID_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb, gint RCID_Type);
extern void wimax_service_flow_encodings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void wimax_convengence_service_parameter_encoding_rules_decoder(guint sfe_type, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern gint wimax_decode_ulmapc(proto_tree *base_tree, packet_info* pinfo, gint offset, gint length, tvbuff_t *tvb);
extern gint wimax_decode_ulmap_reduced_aas(proto_tree *ie_tree, gint offset, gint length, tvbuff_t *tvb);
extern gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdu_tree);
extern gint wimax_decode_dlmap_reduced_aas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tree);
extern void wimax_error_parameter_set_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void wimax_hmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length);
extern void wimax_cmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length);
extern void wimax_short_hmac_tuple_decoder(proto_tree *tree, tvbuff_t *tvb, guint offset, guint length);
extern void wimax_security_negotiation_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void wimax_tek_parameters_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void wimax_pkm_configuration_settings_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void wimax_sa_descriptor_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void wimax_pkm_tlv_encoded_attributes_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void wimax_cryptographic_suite_list_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void wimax_security_capabilities_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern void wimax_vendor_specific_information_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern guint wimax_common_tlv_encoding_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
//Windows can't handle plugins using globals from epan, so copies are necessary
extern const unit_name_string wimax_units_byte_bytes;
extern const unit_name_string wimax_units_bit_sec;
extern const unit_name_string wimax_units_db;
extern const unit_name_string wimax_units_dbm;
extern const unit_name_string wimax_units_frame_frames;
extern const unit_name_string wimax_units_frame_offset;
extern const unit_name_string wimax_units_hz;
extern const unit_name_string wimax_units_khz;
extern const unit_name_string wimax_units_ms;
extern const unit_name_string wimax_units_ps;
#endif /* WIMAX_UTILS_H */ |
wireshark/plugins/epan/wimaxasncp/AUTHORS | Authors :
Stephen Croll <[email protected]>
Zhang Li <[email protected]>
Wu Yanping <[email protected]>
Terry Le <[email protected]> |
|
wireshark/plugins/epan/wimaxasncp/ChangeLog | 2007-08-29 Stephen Croll <[email protected]>
* initial version
2007-10-09 Stephen Croll <[email protected]>
* TLVs defined in XML files.
* packet-wimaxasncp.c: fixed memory leak in function
wimaxasncp_dissect_tlv_value()
2007-11-04 Zhang Li <[email protected]>
* Add EAP support. EAP payload is dessected by calling EAP dissector
* Add port preference. |
|
Text | wireshark/plugins/epan/wimaxasncp/CMakeLists.txt | # CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <[email protected]>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
include(WiresharkPlugin)
# Plugin name and version info (major minor micro extra)
set_module_info(wimaxasncp 0 0 1 0)
set(DISSECTOR_SRC
packet-wimaxasncp.c
)
set(PLUGIN_FILES
plugin.c
${DISSECTOR_SRC}
)
add_lex_files(LEX_FILES PLUGIN_FILES
wimaxasncp_dict.l
)
set_source_files_properties(
${DISSECTOR_SRC}
PROPERTIES
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
)
register_plugin_files(plugin.c
plugin
${DISSECTOR_SRC}
)
add_wireshark_plugin_library(wimaxasncp epan)
target_link_libraries(wimaxasncp epan)
install_plugin(wimaxasncp epan)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
wimaxasncp
SWITCHES
--group dissectors-prohibited
--group dissectors-restricted
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
# LEX files commented out due to use of malloc, free etc.
# ${LEX_FILES}
)
#
# Editor modelines - https://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
# |
C | wireshark/plugins/epan/wimaxasncp/packet-wimaxasncp.c | /* packet-wimaxasncp.c
*
* Routines for WiMAX ASN Control Plane packet dissection dissection
*
* Copyright 2007, Mobile Metrics - http://www.mobilemetrics.net
*
* Author: Stephen Croll <[email protected]>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/sminmpec.h>
#include <epan/addr_resolv.h>
#include <epan/ipproto.h>
#include <epan/expert.h>
#include <epan/eap.h>
#include <wsutil/filesystem.h>
#include <wsutil/report_message.h>
#include <epan/ws_printf.h>
#include "wimaxasncp_dict.h"
/* Forward declarations we need below */
void proto_register_wimaxasncp(void);
void proto_reg_handoff_wimaxasncp(void);
/* Initialize the protocol and registered fields */
static int proto_wimaxasncp = -1;
static int hf_wimaxasncp_version = -1;
static int hf_wimaxasncp_flags = -1;
static int hf_wimaxasncp_function_type = -1;
static int hf_wimaxasncp_op_id = -1;
static int hf_wimaxasncp_message_type = -1;
/* static int hf_wimaxasncp_qos_msg = -1; */
/* static int hf_wimaxasncp_ho_control_msg = -1; */
/* static int hf_wimaxasncp_data_path_control_msg = -1; */
/* static int hf_wimaxasncp_context_delivery_msg = -1; */
/* static int hf_wimaxasncp_r3_mobility_msg = -1; */
/* static int hf_wimaxasncp_paging_msg = -1; */
/* static int hf_wimaxasncp_rrm_msg = -1; */
/* static int hf_wimaxasncp_authentication_msg = -1; */
/* static int hf_wimaxasncp_ms_state_msg = -1; */
/* static int hf_wimaxasncp_reauthentication_msg = -1; */
/* static int hf_wimaxasncp_session_msg = -1; */
static int hf_wimaxasncp_length = -1;
static int hf_wimaxasncp_msid = -1;
static int hf_wimaxasncp_reserved1 = -1;
static int hf_wimaxasncp_transaction_id = -1;
static int hf_wimaxasncp_reserved2 = -1;
/* static int hf_wimaxasncp_tlv = -1; */
static int hf_wimaxasncp_tlv_type = -1;
static int hf_wimaxasncp_tlv_length = -1;
static int hf_wimaxasncp_tlv_value_bytes = -1;
static int hf_wimaxasncp_tlv_value_bitflags8 = -1;
static int hf_wimaxasncp_tlv_value_bitflags16 = -1;
static int hf_wimaxasncp_tlv_value_bitflags32 = -1;
/* static int hf_wimaxasncp_tlv_value_protocol = -1; */
/* static int hf_wimaxasncp_tlv_value_vendor_id = -1; */
/* Preferences */
static gboolean show_transaction_id_d_bit = FALSE;
static gboolean debug_enabled = FALSE;
/* Default WiMAX ASN control protocol port */
#define WIMAXASNCP_DEF_UDP_PORT 2231
/* Initialize the subtree pointers */
static gint ett_wimaxasncp = -1;
static gint ett_wimaxasncp_flags = -1;
static gint ett_wimaxasncp_tlv = -1;
static gint ett_wimaxasncp_tlv_value_bitflags8 = -1;
static gint ett_wimaxasncp_tlv_value_bitflags16 = -1;
static gint ett_wimaxasncp_tlv_value_bitflags32 = -1;
static gint ett_wimaxasncp_tlv_protocol_list = -1;
static gint ett_wimaxasncp_tlv_port_range_list = -1;
static gint ett_wimaxasncp_tlv_ip_address_mask_list = -1;
static gint ett_wimaxasncp_tlv_ip_address_mask = -1;
static gint ett_wimaxasncp_tlv_eap = -1;
static gint ett_wimaxasncp_tlv_vendor_specific_information_field = -1;
static gint ett_wimaxasncp_port_range = -1;
static expert_field ei_wimaxasncp_tlv_type = EI_INIT;
static expert_field ei_wimaxasncp_function_type = EI_INIT;
static expert_field ei_wimaxasncp_op_id = EI_INIT;
static expert_field ei_wimaxasncp_message_type = EI_INIT;
static expert_field ei_wimaxasncp_length_bad = EI_INIT;
/* Header size, up to, but not including, the TLV fields. */
#define WIMAXASNCP_HEADER_SIZE 20
/* Offset to end of the length field in the headder. */
#define WIMAXASNCP_HEADER_LENGTH_END 6
#define WIMAXASNCP_BIT32(n) (1U << (31 - (n)))
#define WIMAXASNCP_BIT16(n) (1U << (15 - (n)))
#define WIMAXASNCP_BIT8(n) (1U << ( 7 - (n)))
#define WIMAXASNCP_FLAGS_T WIMAXASNCP_BIT8(6)
#define WIMAXASNCP_FLAGS_R WIMAXASNCP_BIT8(7)
typedef struct {
wmem_array_t* hf;
wmem_array_t* ett;
} wimaxasncp_build_dict_t;
static wimaxasncp_dict_t *wimaxasncp_dict = NULL;
wimaxasncp_build_dict_t wimaxasncp_build_dict;
static wimaxasncp_dict_tlv_t wimaxasncp_tlv_not_found =
{
0, "Unknown", NULL, WIMAXASNCP_TLV_UNKNOWN, 0,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
NULL, NULL, NULL
};
static dissector_handle_t wimaxasncp_handle;
static dissector_handle_t eap_handle;
/* ------------------------------------------------------------------------- */
static const value_string wimaxasncp_flag_vals[] =
{
{ WIMAXASNCP_BIT8(0), "Reserved" },
{ WIMAXASNCP_BIT8(1), "Reserved" },
{ WIMAXASNCP_BIT8(2), "Reserved" },
{ WIMAXASNCP_BIT8(3), "Reserved" },
{ WIMAXASNCP_BIT8(4), "Reserved" },
{ WIMAXASNCP_BIT8(5), "Reserved" },
{ WIMAXASNCP_FLAGS_T, "T - Source and Destination Identifier TLVs"},
{ WIMAXASNCP_FLAGS_R, "R - Reset Next Expected Transaction ID"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxasncp_op_id_vals[] =
{
{ 0, "Invalid"},
{ 1, "Request/Initiation"},
{ 2, "Response"},
{ 3, "Ack"},
{ 4, "Indication"},
{ 5, "Reserved"},
{ 6, "Reserved"},
{ 7, "Reserved"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
#define WIMAXASNCP_FT_QOS 1
#define WIMAXASNCP_FT_HO_CONTROL 2
#define WIMAXASNCP_FT_DATA_PATH_CONTROL 3
#define WIMAXASNCP_FT_CONTEXT_TRANSFER 4
#define WIMAXASNCP_FT_R3_MOBILITY 5
#define WIMAXASNCP_FT_PAGING 6
#define WIMAXASNCP_FT_RRM 7
#define WIMAXASNCP_FT_AUTHENTICATION 8
#define WIMAXASNCP_FT_MS_STATE 9
#define WIMAXASNCP_FT_REAUTHENTICATION 10
/* since NWG R1 V1.2.0 */
#define WIMAXASNCP_FT_IM_OPERATIONS 10
/* since NWG R1 V1.2.1 */
#define WIMAXASNCP_FT_ACCOUNTING 11
/* ------------------------------------------------------------------------- */
/* struct to hold a value_string tuple, per version */
typedef struct _ver_value_string
{
guint32 since;
value_string vs;
} ver_value_string;
static const ver_value_string wimaxasncp_function_type_vals[] =
{
{0, { WIMAXASNCP_FT_QOS, "QoS"}},
{0, { WIMAXASNCP_FT_HO_CONTROL, "HO Control"}},
{0, { WIMAXASNCP_FT_DATA_PATH_CONTROL, "Data Path Control"}},
{0, { WIMAXASNCP_FT_CONTEXT_TRANSFER, "Context Transfer"}},
{0, { WIMAXASNCP_FT_R3_MOBILITY, "R3 Mobility"}},
{0, { WIMAXASNCP_FT_PAGING, "Paging"}},
{0, { WIMAXASNCP_FT_RRM, "RRM"}},
{0, { WIMAXASNCP_FT_AUTHENTICATION, "Authentication Relay"}},
{0, { WIMAXASNCP_FT_MS_STATE, "MS State"}},
{0, { WIMAXASNCP_FT_REAUTHENTICATION, "Re-Authentication"}},
{WIMAXASNCP_NWGVER_R10_V120, {WIMAXASNCP_FT_IM_OPERATIONS, "IM Operations"}},
{WIMAXASNCP_NWGVER_R10_V121, { WIMAXASNCP_FT_ACCOUNTING, "Accounting"}},
{0, { 0, NULL}}
};
/* ------------------------------------------------------------------------- */
static const ver_value_string wimaxasncp_qos_msg_vals[] =
{
{0,{ 1, "RR_Req"}},
{0,{ 2, "RR_Rsp"}},
{0,{ 3, "RR_Ack"}},
{0,{ 0, NULL}}
};
/* ------------------------------------------------------------------------- */
static const ver_value_string wimaxasncp_ho_control_msg_vals[] =
{
{0, { 1, "HO_Ack"}},
{0, { 2, "HO_Complete"}},
{0, { 3, "HO_Cnf"}},
{0, { 4, "HO_Req"}},
{0, { 5, "HO_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 1, "HO_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 2, "HO_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 3, "HO_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 4, "HO_Cnf"}},
{WIMAXASNCP_NWGVER_R10_V120, { 5, "HO_Complete"}},
{WIMAXASNCP_NWGVER_R10_V120, { 6, "HO_Directive"}},
{WIMAXASNCP_NWGVER_R10_V120, { 7, "HO_Directive_Rsp"}},
{0, { 0, NULL}}
};
/* ------------------------------------------------------------------------- */
static const ver_value_string wimaxasncp_data_path_control_msg_vals[] =
{
{0, { 1, "Path_Dereg_Ack"}},
{0, { 2, "Path_Dereg_Req"}},
{0, { 3, "Path_Dereg_Rsp"}},
{0, { 4, "Path_Modification_Ack"}},
{0, { 5, "Path_Modification_Req"}},
{0, { 6, "Path_Modification_Rsp"}},
{0, { 7, "Path_Prereg_Ack"}},
{0, { 8, "Path_Prereg_Req"}},
{0, { 9, "Path_Prereg_Rsp"}},
{0, { 10, "Path_Reg_Ack"}},
{0, { 11, "Path_Reg_Req"}},
{0, { 12, "Path_Reg_Rsp"}},
{0, { 13, "MS_Attachment_Req"}},
{0, { 14, "MS_Attachment_Rsp"}},
{0, { 15, "MS_Attachment_Ack"}},
{0, { 16, "Key_Change_Directive"}},
{WIMAXASNCP_NWGVER_R10_V120, { 1, "Path_Dereg_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 2, "Path_Dereg_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 3, "Path_Dereg_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 4, "Path_Modification_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 5, "Path_Modification_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 6, "Path_Modification_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 7, "Path_Prereg_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 8, "Path_Prereg_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 9, "Path_Prereg_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 10, "Path_Reg_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 11, "Path_Reg_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 12, "Path_Reg_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 13, "Obsolete"}},
{WIMAXASNCP_NWGVER_R10_V120, { 14, "Obsolete"}},
{WIMAXASNCP_NWGVER_R10_V120, { 15, "Obsolete"}},
{WIMAXASNCP_NWGVER_R10_V120, { 16, "Obsolete"}},
{0, { 0, NULL}}
};
/* ------------------------------------------------------------------------- */
static const ver_value_string wimaxasncp_context_transfer_msg_vals[] =
{
{0, { 1, "Context_Rpt"}},
{0, { 2, "Context_Req"}},
{0, { 3, "Context_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 1, "Context_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 2, "Context_Rpt"}},
{WIMAXASNCP_NWGVER_R10_V120, { 4, "CMAC_Key_Count_Update"}},
{WIMAXASNCP_NWGVER_R10_V120, { 5, "CMAC_Key_Count_Update_ACK"}},
{WIMAXASNCP_NWGVER_R10_V120, { 6, "CMAC_Key_Count_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 7, "CMAC_Key_Count_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 8, "Prepaid Request"}},
{WIMAXASNCP_NWGVER_R10_V120, { 9, "Prepaid Notify"}},
{WIMAXASNCP_NWGVER_R10_V121, { 6, "VOID"}},
{WIMAXASNCP_NWGVER_R10_V121, { 7, "VOID"}},
{WIMAXASNCP_NWGVER_R10_V121, { 0, NULL}}
};
/* ------------------------------------------------------------------------- */
static const ver_value_string wimaxasncp_r3_mobility_msg_vals[] =
{
{0, { 1, "Anchor_DPF_HO_Req"}},
{0, { 2, "Anchor_DPF_HO_Trigger"}},
{0, { 3, "Anchor_DPF_HO_Rsp"}},
{0, { 4, "Anchor_DPF_Relocate_Req"}},
{0, { 5, "FA_Register_Req"}},
{0, { 6, "FA_Register_Rsp"}},
{0, { 7, "Anchor_DPF_Relocate_Rsp"}},
{0, { 8, "FA_Revoke_Req"}},
{0, { 9, "FA_Revoke_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 5, "Anchor_DPF_Relocate_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 6, "FA_Register_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 7, "FA_Register_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 10, "Anchor_DPF_Release_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 11, "Relocation_Ready_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 12, "Relocation_Ready_Rsp"}},
{0, { 0, NULL}}
};
/* ------------------------------------------------------------------------- */
static const ver_value_string wimaxasncp_paging_msg_vals[] =
{
{0, { 1, "Initiate_Paging_Req"}},
{0, { 2, "Initiate_Paging_Rsp"}},
{0, { 3, "LU_Cnf"}},
{0, { 4, "LU_Req"}},
{0, { 5, "LU_Rsp"}},
{0, { 6, "Paging_Announce"}},
{0, { 7, "CMAC_Key_Count_Req"}},
{0, { 8, "CMAC_Key_Count_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 1, "Paging_Announce"}},
{WIMAXASNCP_NWGVER_R10_V120, { 2, "Delete_MS_Entry_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 3, "PC_Relocation_Ind"}},
{WIMAXASNCP_NWGVER_R10_V120, { 4, "PC_Relocation_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 5, "Obsolete"}},
{WIMAXASNCP_NWGVER_R10_V120, { 6, "Obsolete"}},
{WIMAXASNCP_NWGVER_R10_V120, { 7, "Obsolete"}},
{WIMAXASNCP_NWGVER_R10_V120, { 8, "Obsolete"}},
{0, { 0, NULL}}
};
/* ------------------------------------------------------------------------- */
static const ver_value_string wimaxasncp_rrm_msg_vals[] =
{
{0, { 1, "R6 PHY_Parameters_Req"}},
{0, { 2, "R6 PHY_Parameters_Rpt"}},
{0, { 3, "R4/R6 Spare_Capacity_Req"}},
{0, { 4, "R4/R6 Spare_Capacity_Rpt"}},
{0, { 5, "R6 Neighbor_BS_Resource_Status_Update"}},
{0, { 6, "R4/R6 Radio_Config_Update_Req"}},
{0, { 7, "R4/R6 Radio_Config_Update_Rpt"}},
{WIMAXASNCP_NWGVER_R10_V120, { 8, "R4/R6 Radio_Config_Update_Ack"}},
{0, { 0, NULL}}
};
/* ------------------------------------------------------------------------- */
static const ver_value_string wimaxasncp_authentication_msg_vals[] =
{
{0, { 1, "AR_Authenticated_Eap_Start"}},
{0, { 2, "AR_Authenticated_EAP_Transfer"}},
{0, { 3, "AR_Eap_Start"}},
{0, { 4, "AR_EAP_Transfer"}},
{0, { 5, "AR_EAP_Complete"}},
{WIMAXASNCP_NWGVER_R10_V120, { 1, "AR_EAP_Start"}},
{WIMAXASNCP_NWGVER_R10_V120, { 2, "AR_EAP_Transfer"}},
{WIMAXASNCP_NWGVER_R10_V120, { 3, "Bulk_Interim_Update"}},
{WIMAXASNCP_NWGVER_R10_V120, { 4, "Bulk_Interim_Update_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 5, "Obsolete"}},
{0, { 0, NULL}}
};
/* ------------------------------------------------------------------------- */
static const ver_value_string wimaxasncp_ms_state_msg_vals[] =
{
{0, { 1, "IM_Entry_State_Change_Req"}},
{0, { 2, "IM_Entry_State_Change_Rsp"}},
{0, { 3, "IM_Exit_State_Change_Req"}},
{0, { 4, "IM_Exit_State_Change_Rsp"}},
{0, { 5, "NW_ReEntry_State_Change_Directive"}},
{0, { 6, "MS_PreAttachment_Req"}},
{0, { 7, "MS_PreAttachment_Rsp"}},
{0, { 8, "MS_PreAttachment_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 1, "MS_PreAttachment_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 2, "MS_PreAttachment_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 3, "MS_PreAttachment_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 4, "MS_Attachment_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 5, "MS_Attachment_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 6, "MS_Attachment_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 7, "Key_Change_Directive"}},
{WIMAXASNCP_NWGVER_R10_V120, { 8, "Key_Change_Cnf"}},
{WIMAXASNCP_NWGVER_R10_V120, { 9, "Key_Change_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 10, "Relocation_Complete_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 11, "Relocation_Complete_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 12, "Relocation_Complete_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 13, "Relocation_Notify"}},
{WIMAXASNCP_NWGVER_R10_V120, { 14, "Relocation_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 15, "Relocation_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 16, "NetExit_MS_State_Change_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 17, "NetExit_MS_State_Change_Rsp"}},
{0, { 0, NULL}}
};
/* ------------------------------------------------------------------------- */
/* note - function type 10-im_operation, was once used for re-authrntication */
static const ver_value_string wimaxasncp_im_operations_msg_vals[] =
{
{0, { 1, "AR_EAP_Start"}},
{0, { 2, "Key_Change_Directive"}},
{0, { 3, "Key_Change_Cnf"}},
{0, { 4, "Relocation_Cnf"}},
{0, { 5, "Relocation_Confirm_Ack"}},
{0, { 6, "Relocation_Notify"}},
{0, { 7, "Relocation_Notify_Ack"}},
{0, { 8, "Relocation_Req"}},
{0, { 9, "Relocation_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 1, "IM_Entry_State_Change_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 2, "IM_Entry_State_Change_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 3, "IM_Entry_State_Change_Ack"}},
{WIMAXASNCP_NWGVER_R10_V120, { 4, "IM_Exit_State_Change_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 5, "IM_Exit_State_Change_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 6, "Initiate_Paging_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 7, "Initiate_Paging_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 8, "LU_Req"}},
{WIMAXASNCP_NWGVER_R10_V120, { 9, "LU_Rsp"}},
{WIMAXASNCP_NWGVER_R10_V120, { 10, "LU_Cnf"}},
{0, { 0, NULL}}
};
/* ------------------------------------------------------------------------- */
static const ver_value_string wimaxasncp_accounting_msg_vals_r1v121[] =
{
{WIMAXASNCP_NWGVER_R10_V121, { 1, "Hot_lining_Req"}},
{WIMAXASNCP_NWGVER_R10_V121, { 2, "Hot_lining_Rsp"}},
{0, { 0, NULL}}
};
/* ------------------------------------------------------------------------- */
/* supported NWG versions */
static const enum_val_t wimaxasncp_nwg_versions[] = {
{ "Release 1.0, Version 1.0.0" , "R1.0 v1.0.0" , WIMAXASNCP_NWGVER_R10_V100 },
{ "Release 1.0, Version 1.2.0" , "R1.0 v1.2.0" , WIMAXASNCP_NWGVER_R10_V120 },
{ "Release 1.0, Version 1.2.1" , "R1.0 v1.2.1" , WIMAXASNCP_NWGVER_R10_V121 },
{ NULL, NULL, 0 }
};
/* ------------------------------------------------------------------------- */
/* NWG version */
#define WIMAXASNCP_DEF_NWGVER WIMAXASNCP_NWGVER_R10_V121
static guint global_wimaxasncp_nwg_ver = WIMAXASNCP_DEF_NWGVER;
/* ========================================================================= */
typedef struct {
guint8 function_type;
const ver_value_string *vals;
} wimaxasncp_func_msg_t;
/* ------------------------------------------------------------------------ */
static const wimaxasncp_func_msg_t wimaxasncp_func_to_msg_vals_map[] =
{
{ WIMAXASNCP_FT_QOS, wimaxasncp_qos_msg_vals },
{ WIMAXASNCP_FT_HO_CONTROL, wimaxasncp_ho_control_msg_vals },
{ WIMAXASNCP_FT_DATA_PATH_CONTROL, wimaxasncp_data_path_control_msg_vals },
{ WIMAXASNCP_FT_CONTEXT_TRANSFER, wimaxasncp_context_transfer_msg_vals },
{ WIMAXASNCP_FT_R3_MOBILITY, wimaxasncp_r3_mobility_msg_vals },
{ WIMAXASNCP_FT_PAGING, wimaxasncp_paging_msg_vals },
{ WIMAXASNCP_FT_RRM, wimaxasncp_rrm_msg_vals },
{ WIMAXASNCP_FT_AUTHENTICATION, wimaxasncp_authentication_msg_vals },
{ WIMAXASNCP_FT_MS_STATE, wimaxasncp_ms_state_msg_vals },
{ WIMAXASNCP_FT_IM_OPERATIONS, wimaxasncp_im_operations_msg_vals },
{ WIMAXASNCP_FT_ACCOUNTING, wimaxasncp_accounting_msg_vals_r1v121 }
};
/* ========================================================================= */
static const wimaxasncp_dict_tlv_t *wimaxasncp_get_tlv_info(
guint16 type)
{
wimaxasncp_dict_tlv_t *res = NULL;
if (wimaxasncp_dict)
{
wimaxasncp_dict_tlv_t *tlv;
for (tlv = wimaxasncp_dict->tlvs; tlv; tlv = tlv->next)
{
if (tlv->type == type)
{
/* if the TLV is defined for current NWG version */
if (tlv->since<= global_wimaxasncp_nwg_ver)
{
/* if the current TLV is newer then last found TLV, save it */
if (!res || (tlv->since > res->since))
{
res = tlv;
}
}
}
}
}
if (debug_enabled && !res)
{
g_print("fix-me: unknown TLV type: %u\n", type);
}
return res? res:&wimaxasncp_tlv_not_found;
}
/* ========================================================================= */
static const gchar *wimaxasncp_get_enum_name(
const wimaxasncp_dict_tlv_t *tlv_info,
guint32 code)
{
if (tlv_info->enum_vs)
{
return val_to_str_const(code, tlv_info->enum_vs, "Unknown");
}
else
{
return "Unknown";
}
}
/* ========================================================================= */
static const value_string wimaxasncp_decode_type_vals[] =
{
{ WIMAXASNCP_TLV_UNKNOWN, "WIMAXASNCP_TLV_UNKNOWN"},
{ WIMAXASNCP_TLV_TBD, "WIMAXASNCP_TLV_TBD"},
{ WIMAXASNCP_TLV_COMPOUND, "WIMAXASNCP_TLV_COMPOUND"},
{ WIMAXASNCP_TLV_BYTES, "WIMAXASNCP_TLV_BYTES"},
{ WIMAXASNCP_TLV_ENUM8, "WIMAXASNCP_TLV_ENUM8"},
{ WIMAXASNCP_TLV_ENUM16, "WIMAXASNCP_TLV_ENUM16"},
{ WIMAXASNCP_TLV_ENUM32, "WIMAXASNCP_TLV_ENUM32"},
{ WIMAXASNCP_TLV_ETHER, "WIMAXASNCP_TLV_ETHER"},
{ WIMAXASNCP_TLV_ASCII_STRING, "WIMAXASNCP_TLV_ASCII_STRING"},
{ WIMAXASNCP_TLV_FLAG0, "WIMAXASNCP_TLV_FLAG0"},
{ WIMAXASNCP_TLV_BITFLAGS8, "WIMAXASNCP_TLV_BITFLAGS8"},
{ WIMAXASNCP_TLV_BITFLAGS16, "WIMAXASNCP_TLV_BITFLAGS16"},
{ WIMAXASNCP_TLV_BITFLAGS32, "WIMAXASNCP_TLV_BITFLAGS32"},
{ WIMAXASNCP_TLV_ID, "WIMAXASNCP_TLV_ID"},
{ WIMAXASNCP_TLV_HEX8, "WIMAXASNCP_TLV_HEX8"},
{ WIMAXASNCP_TLV_HEX16, "WIMAXASNCP_TLV_HEX16"},
{ WIMAXASNCP_TLV_HEX32, "WIMAXASNCP_TLV_HEX32"},
{ WIMAXASNCP_TLV_DEC8, "WIMAXASNCP_TLV_DEC8"},
{ WIMAXASNCP_TLV_DEC16, "WIMAXASNCP_TLV_DEC16"},
{ WIMAXASNCP_TLV_DEC32, "WIMAXASNCP_TLV_DEC32"},
{ WIMAXASNCP_TLV_IP_ADDRESS, "WIMAXASNCP_TLV_IP_ADDRESS"},
{ WIMAXASNCP_TLV_IPV4_ADDRESS, "WIMAXASNCP_TLV_IPV4_ADDRESS"},
{ WIMAXASNCP_TLV_PROTOCOL_LIST, "WIMAXASNCP_TLV_PROTOCOL_LIST"},
{ WIMAXASNCP_TLV_PORT_RANGE_LIST, "WIMAXASNCP_TLV_PORT_RANGE_LIST"},
{ WIMAXASNCP_TLV_IP_ADDRESS_MASK_LIST, "WIMAXASNCP_TLV_IP_ADDRESS_MASK_LIST"},
{ WIMAXASNCP_TLV_VENDOR_SPECIFIC, "WIMAXASNCP_TLV_VENDOR_SPECIFIC"},
{ 0, NULL}
};
/* ========================================================================= */
static void wimaxasncp_proto_tree_add_tlv_ipv4_value(
packet_info *pinfo,
tvbuff_t *tvb,
proto_tree *tree,
proto_item *tlv_item,
guint offset,
const wimaxasncp_dict_tlv_t *tlv_info)
{
int hf_value;
guint32 ip;
const gchar *addr_res;
if (tlv_info->hf_ipv4 != -1)
{
hf_value = tlv_info->hf_ipv4;
}
else
{
hf_value = tlv_info->hf_value;
}
ip = tvb_get_ipv4(tvb, offset);
addr_res = tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_IPv4, offset);
proto_tree_add_ipv4_format(
tree, hf_value,
tvb, offset, 4, ip,
"Value: %s", addr_res);
proto_item_append_text(
tlv_item, " - %s", addr_res);
}
/* ========================================================================= */
static void wimaxasncp_proto_tree_add_tlv_ipv6_value(
packet_info *pinfo,
tvbuff_t *tvb,
proto_tree *tree,
proto_item *tlv_item,
guint offset,
const wimaxasncp_dict_tlv_t *tlv_info)
{
int hf_value;
ws_in6_addr ip;
const gchar *addr_res;
if (tlv_info->hf_ipv4 != -1)
{
hf_value = tlv_info->hf_ipv6;
}
else
{
hf_value = tlv_info->hf_value;
}
tvb_get_ipv6(tvb, offset, &ip);
addr_res = tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_IPv6, offset);
proto_tree_add_ipv6_format(
tree, hf_value,
tvb, offset, 16, &ip,
"Value: %s", addr_res);
proto_item_append_text(
tlv_item, " - %s", addr_res);
}
/* ========================================================================= */
static void wimaxasncp_proto_tree_add_ether_value(
packet_info *pinfo,
tvbuff_t *tvb,
proto_tree *tree,
proto_item *tlv_item,
guint offset,
guint length,
const wimaxasncp_dict_tlv_t *tlv_info)
{
int hf_value;
const guint8 *p;
const gchar *ether_name;
if (tlv_info->hf_bsid != -1)
{
hf_value = tlv_info->hf_bsid;
}
else
{
hf_value = tlv_info->hf_value;
}
p = tvb_get_ptr(tvb, offset, length);
ether_name = tvb_address_with_resolution_to_str(pinfo->pool, tvb, AT_ETHER, offset);
proto_tree_add_ether_format(
tree, hf_value,
tvb, offset, length, p,
"Value: %s",
ether_name);
proto_item_append_text(
tlv_item, " - %s",
ether_name);
}
/* ========================================================================= */
static void wimaxasncp_dissect_tlv_value(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree,
proto_item *tlv_item,
const wimaxasncp_dict_tlv_t *tlv_info)
{
guint offset = 0;
guint length;
const guint max_show_bytes = 24; /* arbitrary */
static const gchar *hex_note = "[hex]";
length = tvb_reported_length(tvb);
switch (tlv_info->decoder)
{
case WIMAXASNCP_TLV_ENUM8:
{
if (length != 1)
{
/* encoding error */
break;
}
if (tlv_info->enums == NULL)
{
if (debug_enabled)
{
g_print("fix-me: enum values missing for TLV %s (%u)\n",
tlv_info->name, tlv_info->type);
}
}
if (tree)
{
guint8 value;
const gchar *s;
value = tvb_get_guint8(tvb, offset);
s = wimaxasncp_get_enum_name(tlv_info, value);
proto_tree_add_uint_format(
tree, tlv_info->hf_value,
tvb, offset, length, value,
"Value: %s (%u)", s, value);
proto_item_append_text(tlv_item, " - %s", s);
}
return;
}
case WIMAXASNCP_TLV_ENUM16:
{
if (length != 2)
{
/* encoding error */
break;
}
if (tlv_info->enums == NULL)
{
if (debug_enabled)
{
g_print("fix-me: enum values missing for TLV %s (%u)\n",
tlv_info->name, tlv_info->type);
}
}
if (tree)
{
guint16 value;
const gchar *s;
value = tvb_get_ntohs(tvb, offset);
s = wimaxasncp_get_enum_name(tlv_info, value);
proto_tree_add_uint_format(
tree, tlv_info->hf_value,
tvb, offset, length, value,
"Value: %s (%u)", s, value);
proto_item_append_text(tlv_item, " - %s", s);
}
return;
}
case WIMAXASNCP_TLV_ENUM32:
{
if (length != 4)
{
/* encoding error */
break;
}
if (tlv_info->enums == NULL)
{
if (debug_enabled)
{
g_print("fix-me: enum values missing for TLV %s (%u)\n",
tlv_info->name, tlv_info->type);
}
}
if (tree)
{
guint32 value;
const gchar *s;
value = tvb_get_ntohl(tvb, offset);
s = wimaxasncp_get_enum_name(tlv_info, value);
proto_tree_add_uint_format(
tree, tlv_info->hf_value,
tvb, offset, length, value,
"Value: %s (%u)", s, value);
proto_item_append_text(tlv_item, " - %s", s);
}
return;
}
case WIMAXASNCP_TLV_ETHER:
{
if (length != 6)
{
/* encoding error */
break;
}
if (tree)
{
wimaxasncp_proto_tree_add_ether_value(
pinfo, tvb, tree, tlv_item, offset, length, tlv_info);
}
return;
}
case WIMAXASNCP_TLV_ASCII_STRING:
{
if (tree)
{
const gchar *s = tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_ASCII);
proto_tree_add_string_format(
tree, tlv_info->hf_value,
tvb, offset, length, s,
"Value: %s", s);
proto_item_append_text(
tlv_item, " - %s", s);
}
return;
}
case WIMAXASNCP_TLV_FLAG0:
{
if (length != 0)
{
/* encoding error */
break;
}
return;
}
case WIMAXASNCP_TLV_BITFLAGS8:
{
if (length != 1)
{
/* encoding error */
break;
}
if (tlv_info->enums == NULL)
{
/* enum values missing */
}
if (tree)
{
proto_tree *flags_tree;
proto_item *item;
guint8 value;
guint i;
value = tvb_get_guint8(tvb, offset);
item = proto_tree_add_item(
tree, tlv_info->hf_value,
tvb, offset, 1, ENC_NA);
proto_item_append_text(tlv_item, " - 0x%02x", value);
if (value != 0)
{
flags_tree = proto_item_add_subtree(
item, ett_wimaxasncp_tlv_value_bitflags8);
for (i = 0; i < 8; ++i)
{
guint8 mask;
mask = 1U << (7 - i);
if (value & mask)
{
const gchar *s;
s = wimaxasncp_get_enum_name(tlv_info, value & mask);
proto_tree_add_uint_format(
flags_tree, hf_wimaxasncp_tlv_value_bitflags8,
tvb, offset, length, value,
"Bit #%u is set: %s", i, s);
}
}
}
}
return;
}
case WIMAXASNCP_TLV_BITFLAGS16:
{
if (length != 2)
{
/* encoding error */
break;
}
if (tlv_info->enums == NULL)
{
/* enum values missing */
}
if (tree)
{
proto_tree *flags_tree;
proto_item *item;
guint16 value;
guint i;
value = tvb_get_ntohs(tvb, offset);
item = proto_tree_add_item(
tree, tlv_info->hf_value,
tvb, offset, 2, ENC_BIG_ENDIAN);
proto_item_append_text(tlv_item, " - 0x%04x", value);
if (value != 0)
{
flags_tree = proto_item_add_subtree(
item, ett_wimaxasncp_tlv_value_bitflags16);
for (i = 0; i < 16; ++i)
{
guint16 mask;
mask = 1U << (15 - i);
if (value & mask)
{
const gchar *s;
s = wimaxasncp_get_enum_name(tlv_info, value & mask);
proto_tree_add_uint_format(
flags_tree, hf_wimaxasncp_tlv_value_bitflags16,
tvb, offset, length, value,
"Bit #%u is set: %s", i, s);
}
}
}
}
return;
}
case WIMAXASNCP_TLV_BITFLAGS32:
{
if (length != 4)
{
/* encoding error */
break;
}
if (tlv_info->enums == NULL)
{
/* enum values missing */
}
if (tree)
{
proto_tree *flags_tree;
proto_item *item;
guint32 value;
guint i;
value = tvb_get_ntohl(tvb, offset);
item = proto_tree_add_item(
tree, tlv_info->hf_value,
tvb, offset, 4, ENC_BIG_ENDIAN);
proto_item_append_text(tlv_item, " - 0x%08x", value);
if (value != 0)
{
flags_tree = proto_item_add_subtree(
item, ett_wimaxasncp_tlv_value_bitflags32);
for (i = 0; i < 32; ++i)
{
guint32 mask;
mask = 1U << (31 - i);
if (value & mask)
{
const gchar *s;
s = wimaxasncp_get_enum_name(tlv_info, value & mask);
proto_tree_add_uint_format(
flags_tree, hf_wimaxasncp_tlv_value_bitflags32,
tvb, offset, length, value,
"Bit #%u is set: %s", i, s);
}
}
}
}
return;
}
case WIMAXASNCP_TLV_ID:
{
if (length == 4)
{
if (tree)
{
wimaxasncp_proto_tree_add_tlv_ipv4_value(
pinfo, tvb, tree, tlv_item, offset, tlv_info);
}
return;
}
else if (length == 6)
{
if (tree)
{
wimaxasncp_proto_tree_add_ether_value(
pinfo, tvb, tree, tlv_item, offset, length, tlv_info);
}
return;
}
else if (length == 16)
{
if (tree)
{
wimaxasncp_proto_tree_add_tlv_ipv6_value(
pinfo, tvb, tree, tlv_item, offset, tlv_info);
}
return;
}
else
{
/* encoding error */
break;
}
}
case WIMAXASNCP_TLV_BYTES:
{
if (tree)
{
proto_tree_add_item(
tree, tlv_info->hf_value,
tvb, offset, length, ENC_NA);
if (length) {
const gchar* format;
if (length <= max_show_bytes)
{
format = " - %s";
}
else
{
format = " - %s...";
}
const gchar* s = tvb_bytes_to_str_punct(
pinfo->pool, tvb, offset, MIN(length, max_show_bytes), 0);
proto_item_append_text(
tlv_item, format, s);
} else {
proto_item_append_text(tlv_item, " - <MISSING>");
}
}
return;
}
case WIMAXASNCP_TLV_HEX8:
{
if (length != 1)
{
/* encoding error */
break;
}
if (tree)
{
guint8 value;
value = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format(
tree, tlv_info->hf_value,
tvb, offset, length, value,
"Value: 0x%02x", value);
proto_item_append_text(tlv_item, " - 0x%02x", value);
}
return;
}
case WIMAXASNCP_TLV_HEX16:
{
if (length != 2)
{
/* encoding error */
break;
}
if (tree)
{
guint16 value;
value = tvb_get_ntohs(tvb, offset);
proto_tree_add_uint_format(
tree, tlv_info->hf_value,
tvb, offset, length, value,
"Value: 0x%04x", value);
proto_item_append_text(tlv_item, " - 0x%04x", value);
}
return;
}
case WIMAXASNCP_TLV_HEX32:
{
if (length != 4)
{
/* encoding error */
break;
}
if (tree)
{
guint32 value;
value = tvb_get_ntohl(tvb, offset);
proto_tree_add_uint_format(
tree, tlv_info->hf_value,
tvb, offset, length, value,
"Value: 0x%08x", value);
proto_item_append_text(tlv_item, " - 0x%08x", value);
}
return;
}
case WIMAXASNCP_TLV_DEC8:
{
if (length != 1)
{
/* encoding error */
break;
}
if (tree)
{
guint8 value;
value = tvb_get_guint8(tvb, offset);
proto_tree_add_uint_format(
tree, tlv_info->hf_value,
tvb, offset, length, value,
"Value: %u", value);
proto_item_append_text(tlv_item, " - %u", value);
}
return;
}
case WIMAXASNCP_TLV_DEC16:
{
if (length != 2)
{
/* encoding error */
break;
}
if (tree)
{
guint16 value;
value = tvb_get_ntohs(tvb, offset);
proto_tree_add_uint_format(
tree, tlv_info->hf_value,
tvb, offset, length, value,
"Value: %u", value);
proto_item_append_text(tlv_item, " - %u", value);
}
return;
}
case WIMAXASNCP_TLV_DEC32:
{
if (length != 4)
{
/* encoding error */
break;
}
if (tree)
{
guint32 value;
value = tvb_get_ntohl(tvb, offset);
proto_tree_add_uint_format(
tree, tlv_info->hf_value,
tvb, offset, length, value,
"Value: %u", value);
proto_item_append_text(tlv_item, " - %u", value);
}
return;
}
case WIMAXASNCP_TLV_TBD:
{
if (debug_enabled)
{
g_print(
"fix-me: TBD: TLV %s (%u)\n", tlv_info->name, tlv_info->type);
}
if (tree)
{
if (length) {
const char *format;
const char *s = tvb_bytes_to_str_punct(
pinfo->pool, tvb, offset, length, 0);
if (length <= max_show_bytes) {
format = "%s %s";
} else {
format = "%s %s...";
}
proto_tree_add_bytes_format_value(
tree, tlv_info->hf_value,
tvb, offset, length, NULL, format, hex_note, s);
} else {
proto_tree_add_bytes_format_value(
tree, tlv_info->hf_value,
tvb, offset, length, NULL, "%s", "<MISSING>");
}
proto_item_append_text(tlv_item, " - TBD");
}
return;
}
case WIMAXASNCP_TLV_IP_ADDRESS:
{
if (length == 4)
{
if (tree)
{
wimaxasncp_proto_tree_add_tlv_ipv4_value(
pinfo, tvb, tree, tlv_item, offset, tlv_info);
}
return;
}
else if (length == 16)
{
if (tree)
{
wimaxasncp_proto_tree_add_tlv_ipv6_value(
pinfo, tvb, tree, tlv_item, offset, tlv_info);
}
return;
}
else
{
/* encoding error */
break;
}
}
case WIMAXASNCP_TLV_IPV4_ADDRESS:
{
if (length != 4)
{
/* encoding error */
break;
}
if (tree)
{
wimaxasncp_proto_tree_add_tlv_ipv4_value(
pinfo, tvb, tree, tlv_item, offset, tlv_info);
}
return;
}
case WIMAXASNCP_TLV_PROTOCOL_LIST:
{
if (length % 2 != 0)
{
/* encoding error */
break;
}
if (tree && length > 0)
{
proto_tree *protocol_list_tree;
proto_item *item;
const guint max_protocols_in_tlv_item = 8; /* arbitrary */
protocol_list_tree = proto_tree_add_subtree(
tree, tvb, offset, length,
ett_wimaxasncp_tlv_protocol_list, NULL, "Value");
/* hidden item for filtering */
item = proto_tree_add_item(
protocol_list_tree, tlv_info->hf_value,
tvb, offset, length, ENC_NA);
proto_item_set_hidden(item);
while (offset < tvb_reported_length(tvb))
{
guint16 protocol;
const gchar *protocol_name;
protocol = tvb_get_ntohs(tvb, offset);
protocol_name = ipprotostr(protocol);
proto_tree_add_uint_format(
protocol_list_tree, tlv_info->hf_protocol,
tvb, offset, 2, protocol,
"Protocol: %s (%u)", protocol_name, protocol);
if (offset == 0)
{
proto_item_append_text(tlv_item, " - %s", protocol_name);
}
else if (offset < 2 * max_protocols_in_tlv_item)
{
proto_item_append_text(tlv_item, ", %s", protocol_name);
}
else if (offset == 2 * max_protocols_in_tlv_item)
{
proto_item_append_text(tlv_item, ", ...");
}
offset += 2;
}
}
return;
}
case WIMAXASNCP_TLV_PORT_RANGE_LIST:
{
if (length % 4 != 0)
{
/* encoding error */
break;
}
if (tree && length > 0)
{
proto_tree *port_range_list_tree;
proto_item *item;
const guint max_port_ranges_in_tlv_item = 3; /* arbitrary */
port_range_list_tree = proto_tree_add_subtree(
tree, tvb, offset, length,
ett_wimaxasncp_tlv_port_range_list, NULL, "Value");
/* hidden item for filtering */
item = proto_tree_add_item(
port_range_list_tree, tlv_info->hf_value,
tvb, offset, length, ENC_NA);
proto_item_set_hidden(item);
while (offset < tvb_reported_length(tvb))
{
guint16 portLow;
guint16 portHigh;
proto_tree* range_tree;
portLow = tvb_get_ntohs(tvb, offset);
portHigh = tvb_get_ntohs(tvb, offset + 2);
range_tree = proto_tree_add_subtree_format(
port_range_list_tree, tvb, offset, 4,
ett_wimaxasncp_port_range, NULL, "Port Range: %u-%u", portLow, portHigh);
/* hidden items are for filtering */
item = proto_tree_add_item(
range_tree, tlv_info->hf_port_low,
tvb, offset, 2, ENC_BIG_ENDIAN);
proto_item_set_hidden(item);
item = proto_tree_add_item(
range_tree, tlv_info->hf_port_high,
tvb, offset + 2, 2, ENC_BIG_ENDIAN);
proto_item_set_hidden(item);
if (offset == 0)
{
proto_item_append_text(
tlv_item, " - %u-%u", portLow, portHigh);
}
else if (offset < 4 * max_port_ranges_in_tlv_item)
{
proto_item_append_text(
tlv_item, ", %u-%u", portLow, portHigh);
}
else if (offset == 4 * max_port_ranges_in_tlv_item)
{
proto_item_append_text(tlv_item, ", ...");
}
offset += 4;
}
}
return;
}
case WIMAXASNCP_TLV_IP_ADDRESS_MASK_LIST:
{
/* --------------------------------------------------------------------
* The definion of these TLVs are ambiguous. The length in octets is
* described as Nx8 (IPv4) or Nx32 (IPv6), but this function cannot
* always differentiate between IPv4 and IPv6. For example, if length
* = 32, then is it IPv4 where N=4 (4x8) or IPv6 where N=1 (1x32)?
*
* For now, we presume lengths that *can* indicate an IPv6 address and
* mask list *do* denote an IPv6 address and mask list.
* --------------------------------------------------------------------
*/
if (length % 8 != 0)
{
/* encoding error */
break;
}
if (tree && length > 0)
{
proto_tree *ip_address_mask_list_tree;
proto_item *item;
ip_address_mask_list_tree = proto_tree_add_subtree(
tree, tvb, offset, length,
ett_wimaxasncp_tlv_ip_address_mask_list, NULL, "Value");
/* hidden item for filtering */
item = proto_tree_add_item(
ip_address_mask_list_tree, tlv_info->hf_value,
tvb, offset, length, ENC_NA);
proto_item_set_hidden(item);
if (length % 32 == 0)
{
/* ------------------------------------------------------------
* presume IPv6
* ------------------------------------------------------------
*/
while (offset < tvb_reported_length(tvb))
{
proto_tree *ip_address_mask_tree;
ip_address_mask_tree = proto_tree_add_subtree(
ip_address_mask_list_tree, tvb, offset, 32,
ett_wimaxasncp_tlv_ip_address_mask, NULL, "IPv6 Address and Mask");
/* --------------------------------------------------------
* address
* --------------------------------------------------------
*/
proto_tree_add_item(
ip_address_mask_tree,
tlv_info->hf_ipv6,
tvb, offset, 16, ENC_NA);
/* too long to display ?
proto_item_append_text(
item, " - %s (%s)",
get_hostname6(&ip), ip6_to_str(&ip));
*/
offset += 16;
/* --------------------------------------------------------
* mask
* --------------------------------------------------------
*/
proto_tree_add_item(
ip_address_mask_tree,
tlv_info->hf_ipv6_mask,
tvb, offset, 16, ENC_NA);
/* too long to display ?
proto_item_append_text(
item, " / %s", s);
*/
offset += 16;
}
}
else
{
/* ------------------------------------------------------------
* IPv4
* ------------------------------------------------------------
*/
while (offset < tvb_reported_length(tvb))
{
proto_tree *ip_address_mask_tree;
guint32 ip;
const gchar *s;
ip_address_mask_tree = proto_tree_add_subtree(
ip_address_mask_list_tree, tvb, offset, 8,
ett_wimaxasncp_tlv_ip_address_mask, NULL, "IPv4 Address and Mask");
/* --------------------------------------------------------
* address
* --------------------------------------------------------
*/
ip = tvb_get_ipv4(tvb, offset);
proto_tree_add_item(
ip_address_mask_tree,
tlv_info->hf_ipv4,
tvb, offset, 4, ENC_BIG_ENDIAN);
proto_item_append_text(
item, " - %s (%s)",
get_hostname(ip), tvb_ip_to_str(pinfo->pool, tvb, offset));
offset += 4;
/* --------------------------------------------------------
* mask
* --------------------------------------------------------
*/
s = tvb_ip_to_str(pinfo->pool, tvb, offset);
proto_tree_add_item(
ip_address_mask_tree,
tlv_info->hf_ipv4_mask,
tvb, offset, 4, ENC_BIG_ENDIAN);
proto_item_append_text(
item, " / %s", s);
offset += 4;
}
}
}
return;
}
case WIMAXASNCP_TLV_EAP:
{
/*
* EAP payload, call eap dissector to dissect eap payload
*/
guint8 eap_code;
guint8 eap_type = 0;
/* Get code */
eap_code = tvb_get_guint8(tvb, offset);
if (eap_code == EAP_REQUEST || eap_code == EAP_RESPONSE)
{
/* Get type */
eap_type = tvb_get_guint8(tvb, offset + 4);
}
/* Add code and type to info column */
col_append_str(pinfo->cinfo, COL_INFO, " [");
col_append_str(pinfo->cinfo, COL_INFO,
val_to_str(eap_code, eap_code_vals, "Unknown code (0x%02X)"));
if (eap_code == EAP_REQUEST || eap_code == EAP_RESPONSE)
{
col_append_str(pinfo->cinfo, COL_INFO, ", ");
col_append_str(pinfo->cinfo, COL_INFO,
val_to_str_ext(eap_type, &eap_type_vals_ext, "Unknown type (0x%02X)"));
}
col_append_str(pinfo->cinfo, COL_INFO, "]");
{
proto_tree *eap_tree;
proto_item *item;
gboolean save_writable;
tvbuff_t *eap_tvb;
/* Create EAP subtree */
item = proto_tree_add_item(tree, tlv_info->hf_value, tvb,
offset, length, ENC_NA);
proto_item_set_text(item, "Value");
eap_tree = proto_item_add_subtree(item, ett_wimaxasncp_tlv_eap);
/* Also show high-level details in this root item */
proto_item_append_text(item, " (%s",
val_to_str(eap_code, eap_code_vals,
"Unknown code (0x%02X)"));
if (eap_code == EAP_REQUEST || eap_code == EAP_RESPONSE)
{
proto_item_append_text(item, ", %s",
val_to_str_ext(eap_type, &eap_type_vals_ext,
"Unknown type (0x%02X)"));
}
proto_item_append_text(item, ")");
/* Extract remaining bytes into new tvb */
eap_tvb = tvb_new_subset_remaining(tvb, offset);
/* Disable writing to info column while calling eap dissector */
save_writable = col_get_writable(pinfo->cinfo, -1);
col_set_writable(pinfo->cinfo, -1, FALSE);
/* Call the EAP dissector. */
call_dissector(eap_handle, eap_tvb, pinfo, eap_tree);
/* Restore previous writable state of info column */
col_set_writable(pinfo->cinfo, -1, save_writable);
}
return;
}
case WIMAXASNCP_TLV_VENDOR_SPECIFIC:
{
/* --------------------------------------------------------------------
* The format of the vendor specific information field (VSIF) is not
* clearly defined. It appears to be compound as the spec states
* that the vendor ID field shall be the first TLV embedded inside
* the VSIF. However, the vendor ID is shown as a 24-bit value. Does
* this mean the field is 24-bits? If so, how is alignment/padding
* handled?
*
* For now, we decode the vendor ID as a non-padded 24-bit value and
* dump the rest as hex.
* --------------------------------------------------------------------
*/
if (length < 3)
{
/* encoding error */
break;
}
if (tree)
{
proto_tree *vsif_tree;
proto_item *item;
guint32 vendorId;
const gchar *vendorName;
vsif_tree = proto_tree_add_subtree(
tree, tvb, offset, length,
ett_wimaxasncp_tlv_vendor_specific_information_field, NULL, "Value");
/* hidden item for filtering */
item = proto_tree_add_item(
vsif_tree, tlv_info->hf_value,
tvb, offset, length, ENC_NA);
proto_item_set_hidden(item);
/* ----------------------------------------------------------------
* vendor ID (24-bit)
* ----------------------------------------------------------------
*/
vendorId = tvb_get_ntoh24(tvb, offset);
vendorName = enterprises_lookup(vendorId, "Unknown");
proto_tree_add_uint_format(
vsif_tree, tlv_info->hf_vendor_id,
tvb, offset, 3, vendorId,
"Vendor ID: %s (%u)", vendorName, vendorId);
proto_item_append_text(tlv_item, " - %s", vendorName);
offset += 3;
/* ----------------------------------------------------------------
* hex dump the rest
* ----------------------------------------------------------------
*/
if (offset < tvb_reported_length(tvb))
{
proto_tree_add_item(
vsif_tree, tlv_info->hf_vendor_rest_of_info,
tvb, offset, length - offset, ENC_NA);
}
}
return;
}
case WIMAXASNCP_TLV_UNKNOWN:
{
if (tree)
{
const char* s;
if (length) {
const char* format1;
const char* format2;
if (length <= max_show_bytes)
{
format1 = "%s %s";
format2 = " - %s %s";
}
else
{
format1 = "%s %s...";
format2 = " - %s %s...";
}
s = tvb_bytes_to_str_punct(
pinfo->pool, tvb, offset, MIN(length, max_show_bytes), 0);
proto_tree_add_bytes_format_value(
tree, tlv_info->hf_value,
tvb, offset, length, NULL, format1, hex_note, s);
proto_item_append_text(
tlv_item, format2, hex_note, s);
}
else {
proto_tree_add_bytes_format_value(
tree, tlv_info->hf_value,
tvb, offset, length, NULL, "%s", "<MISSING>");
proto_item_append_text(tlv_item, " - <MISSING>");
}
}
return;
}
default:
if (debug_enabled)
{
g_print(
"fix-me: unknown decoder: %d\n", tlv_info->decoder);
}
break;
}
/* default is hex dump */
if (tree)
{
if (length) {
const char* format;
const char *s = tvb_bytes_to_str_punct(
pinfo->pool, tvb, offset, MIN(length, max_show_bytes), 0);
if (length <= max_show_bytes) {
format = "%s %s";
} else {
format = "%s %s...";
}
proto_tree_add_bytes_format_value(
tree, hf_wimaxasncp_tlv_value_bytes,
tvb, offset, length, NULL,
format, hex_note, s);
} else {
proto_tree_add_bytes_format_value(
tree, hf_wimaxasncp_tlv_value_bytes,
tvb, offset, length, NULL,
"%s", "<MISSING>");
}
}
}
/* ========================================================================= */
static guint dissect_wimaxasncp_tlvs(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree)
{
guint offset;
offset = 0;
while (offset < tvb_reported_length(tvb))
{
const wimaxasncp_dict_tlv_t *tlv_info;
proto_tree *tlv_tree;
proto_item *tlv_item;
guint16 type;
guint16 length;
guint pad;
/* --------------------------------------------------------------------
* type and length
* --------------------------------------------------------------------
*/
type = tvb_get_ntohs(tvb, offset);
tlv_info = wimaxasncp_get_tlv_info(type);
length = tvb_get_ntohs(tvb, offset + 2);
#if 0 /* Commented out padding; As there is no mention of padding in
the Latest specification */
pad = 4 - (length % 4);
if (pad == 4)
{
pad = 0;
}
#endif
pad = 0;
{
proto_item *type_item;
gint tree_length = MIN(
(gint)(4 + length + pad), tvb_captured_length_remaining(tvb, offset));
tlv_item = proto_tree_add_item(
tree, tlv_info->hf_root,
tvb, offset, tree_length, ENC_NA);
/* Set label for tlv item */
proto_item_set_text(tlv_item, "TLV: %s", tlv_info->name);
/* Show code number if unknown */
if (tlv_info->decoder == WIMAXASNCP_TLV_UNKNOWN)
{
proto_item_append_text(tlv_item, " (%u)", type);
}
/* Indicate if a compound tlv */
if (tlv_info->decoder == WIMAXASNCP_TLV_COMPOUND)
{
proto_item_append_text(tlv_item, " [Compound]");
}
/* Create TLV subtree */
tlv_tree = proto_item_add_subtree(
tlv_item, ett_wimaxasncp_tlv);
/* Type (expert item if unknown) */
type_item = proto_tree_add_uint_format(
tlv_tree, hf_wimaxasncp_tlv_type,
tvb, offset, 2, type,
"Type: %s (%u)", tlv_info->name, type);
if (tlv_info->decoder == WIMAXASNCP_TLV_UNKNOWN)
{
expert_add_info_format(pinfo, type_item, &ei_wimaxasncp_tlv_type,
"Unknown TLV type (%u)",
type);
}
/* Length */
proto_tree_add_uint(
tlv_tree, hf_wimaxasncp_tlv_length,
tvb, offset + 2, 2, length);
}
offset += 4;
/* --------------------------------------------------------------------
* value
* --------------------------------------------------------------------
*/
if (tlv_info->decoder == WIMAXASNCP_TLV_COMPOUND)
{
if (length == 0)
{
/* error? compound, but no TLVs inside */
}
else if (tvb_reported_length_remaining(tvb, offset) > 0)
{
tvbuff_t *tlv_tvb;
/* N.B. Not padding out tvb length */
tlv_tvb = tvb_new_subset_length_caplen(
tvb, offset,
MIN(length, tvb_captured_length_remaining(tvb, offset)),
length);
/* N.B. This is a recursive call... */
dissect_wimaxasncp_tlvs(tlv_tvb, pinfo, tlv_tree);
}
else
{
/* this should throw */
tvb_ensure_bytes_exist(tvb, offset, length + pad);
}
}
else
{
tvbuff_t *tlv_tvb;
tvb_ensure_bytes_exist(tvb, offset, length + pad);
tlv_tvb = tvb_new_subset_length_caplen(
tvb, offset,
MIN(length, tvb_captured_length_remaining(tvb, offset)),
length);
wimaxasncp_dissect_tlv_value(
tlv_tvb, pinfo, tlv_tree, tlv_item, tlv_info);
}
offset += length + pad;
}
return offset;
}
/* ========================================================================= */
static guint dissect_wimaxasncp_backend(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree)
{
guint offset = 0;
guint16 ui16;
guint32 ui32;
const guint8 *pmsid;
guint16 tid = 0;
gboolean dbit_show;
/* ------------------------------------------------------------------------
* MSID
* ------------------------------------------------------------------------
*/
if (tree)
{
proto_tree_add_item(
tree, hf_wimaxasncp_msid,
tvb, offset, 6, ENC_NA);
}
pmsid = tvb_ether_to_str(pinfo->pool, tvb, offset);
offset += 6;
/* ------------------------------------------------------------------------
* reserved
* ------------------------------------------------------------------------
*/
ui32 = tvb_get_ntohl(tvb, offset);
if (tree)
{
proto_tree_add_uint(
tree, hf_wimaxasncp_reserved1,
tvb, offset, 4, ui32);
}
offset += 4;
/* ------------------------------------------------------------------------
* transaction ID
* ------------------------------------------------------------------------
*/
dbit_show = FALSE;
ui16 = tvb_get_ntohs(tvb, offset);
if (show_transaction_id_d_bit)
{
const guint16 mask = 0x7fff;
if (ui16 & 0x8000)
{
proto_tree_add_uint_format(
tree, hf_wimaxasncp_transaction_id,
tvb, offset, 2, ui16,
"Transaction ID: D + 0x%04x (0x%04x)", mask & ui16, ui16);
tid = ui16 & mask;
dbit_show = TRUE;
}
else
{
proto_tree_add_uint_format(
tree, hf_wimaxasncp_transaction_id,
tvb, offset, 2, ui16,
"Transaction ID: 0x%04x", ui16);
tid = ui16;
}
}
else
{
proto_tree_add_uint(
tree, hf_wimaxasncp_transaction_id,
tvb, offset, 2, ui16);
tid = ui16;
}
offset += 2;
/* ------------------------------------------------------------------------
* reserved
* ------------------------------------------------------------------------
*/
ui16 = tvb_get_ntohs(tvb, offset);
if (tree)
{
proto_tree_add_uint(
tree, hf_wimaxasncp_reserved2,
tvb, offset, 2, ui16);
}
offset += 2;
/* ------------------------------------------------------------------------
* TLVs
* ------------------------------------------------------------------------
*/
if (tvb_reported_length_remaining(tvb, offset) > 0)
{
tvbuff_t *tlv_tvb;
tlv_tvb = tvb_new_subset_remaining(tvb, offset);
offset += dissect_wimaxasncp_tlvs(tlv_tvb, pinfo, tree);
}
col_append_fstr(pinfo->cinfo, COL_INFO, " - MSID:%s", pmsid);
if (dbit_show)
{
col_append_fstr(pinfo->cinfo, COL_INFO, ", TID:D+0x%04x", tid);
}
else
{
col_append_fstr(pinfo->cinfo, COL_INFO, ", TID:0x%04x", tid);
}
return offset;
}
/* ========================================================================= */
static const gchar*
match_ver_value_string(
const guint32 val,
const ver_value_string* const strings,
const guint32 max_ver)
{
const ver_value_string* vvs;
const ver_value_string* res = NULL;
/* loop on the levels, from max to 0 */
for(vvs=strings; vvs->vs.strptr; vvs++)
{
if ((vvs->vs.value == val) && (vvs->since <= max_ver))
{
if (!res || (vvs->since > res->since))
{
res = vvs;
}
}
}
return res? res->vs.strptr : NULL;
}
static int
dissect_wimaxasncp(
tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *tree,
void *data _U_)
{
static const gchar unknown[] = "Unknown";
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *packet_item = NULL;
proto_item *item = NULL;
proto_tree *wimaxasncp_tree = NULL;
tvbuff_t *subtree;
guint offset;
guint8 ui8;
guint8 function_type;
const gchar *function_type_name;
proto_item *function_type_item;
guint16 length;
const wimaxasncp_func_msg_t *p = NULL;
const gchar *message_name;
gsize i;
/* ------------------------------------------------------------------------
* First, we do some heuristics to check if the packet cannot be our
* protocol.
* ------------------------------------------------------------------------
*/
/* Should we check a minimum size? If so, uncomment out the following
* code. */
#if 0
if (tvb_reported_length(tvb) < WIMAXASNCP_HEADER_SIZE)
{
return 0;
}
#endif
/* We currently only support version 1. */
if (tvb_bytes_exist(tvb, 0, 1) && tvb_get_guint8(tvb, 0) != 1)
{
return 0;
}
/* ------------------------------------------------------------------------
* Initialize the protocol and info column.
* ------------------------------------------------------------------------
*/
/* Make entries in Protocol column and Info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "WiMAX");
/* We'll fill in the "Info" column after fetch data, so we clear the
column first in case calls to fetch data from the packet throw an
exception. */
col_clear(pinfo->cinfo, COL_INFO);
/* ========================================================================
* Disesction starts here
* ========================================================================
*/
/* ------------------------------------------------------------------------
* total packet, we'll adjust after we read the length field
* ------------------------------------------------------------------------
*/
offset = 0;
/* Register protocol fields, etc if haven't done yet. */
if (hf_wimaxasncp_version == -1)
{
proto_registrar_get_byname("wimaxasncp.version");
}
if (tree)
{
packet_item = proto_tree_add_item(
tree, proto_wimaxasncp,
tvb, 0, MIN(WIMAXASNCP_HEADER_LENGTH_END, tvb_captured_length(tvb)), ENC_NA);
wimaxasncp_tree = proto_item_add_subtree(
packet_item, ett_wimaxasncp);
}
/* ------------------------------------------------------------------------
* version
* ------------------------------------------------------------------------
*/
if (tree)
{
proto_tree_add_item(
wimaxasncp_tree, hf_wimaxasncp_version,
tvb, offset, 1, ENC_BIG_ENDIAN);
}
offset += 1;
/* ------------------------------------------------------------------------
* flags
* ------------------------------------------------------------------------
*/
ui8 = tvb_get_guint8(tvb, offset);
if (tree)
{
proto_tree *flags_tree;
if (ui8 == 0)
{
proto_tree_add_uint_format(
wimaxasncp_tree, hf_wimaxasncp_flags,
tvb, offset, 1, ui8,
"Flags: 0x%02x", ui8);
}
else
{
guint j;
item = proto_tree_add_uint_format(
wimaxasncp_tree, hf_wimaxasncp_flags,
tvb, offset, 1, ui8,
"Flags: ");
if (ui8 & (WIMAXASNCP_FLAGS_T | WIMAXASNCP_FLAGS_R))
{
if (ui8 & WIMAXASNCP_FLAGS_T)
{
proto_item_append_text(item, "T");
}
if (ui8 & WIMAXASNCP_FLAGS_R)
{
proto_item_append_text(item, "R");
}
proto_item_append_text(item, " - ");
}
proto_item_append_text(item, "0x%02x", ui8);
flags_tree = proto_item_add_subtree(
item, ett_wimaxasncp_flags);
for (j = 0; j < 8; ++j)
{
guint8 mask;
mask = 1U << (7 - j);
/* Only add flags that are set */
if (ui8 & mask)
{
proto_tree_add_uint_format(
flags_tree, hf_wimaxasncp_flags,
tvb, offset, 1, ui8,
"Bit #%u is set: %s",
j,
val_to_str(
ui8 & mask, wimaxasncp_flag_vals, "Unknown"));
}
}
}
}
offset += 1;
/* ------------------------------------------------------------------------
* function type
* ------------------------------------------------------------------------
*/
function_type = tvb_get_guint8(tvb, offset);
function_type_name = match_ver_value_string(function_type,
wimaxasncp_function_type_vals,
global_wimaxasncp_nwg_ver);
if (function_type_name)
{
/* add the item to the tree */
proto_tree_add_uint_format(
wimaxasncp_tree, hf_wimaxasncp_function_type,
tvb, offset, 1, function_type,
"%s (%u)", function_type_name, function_type);
}
else
{
/* if not matched, add the item and append expert item */
function_type_item = proto_tree_add_uint_format(
wimaxasncp_tree, hf_wimaxasncp_function_type,
tvb, offset, 1, function_type,
"Unknown (%u)", function_type);
expert_add_info_format(pinfo, function_type_item,
&ei_wimaxasncp_function_type,
"Unknown function type (%u)",
function_type);
}
offset += 1;
/* ------------------------------------------------------------------------
* OP ID and message type
* ------------------------------------------------------------------------
*/
ui8 = tvb_get_guint8(tvb, offset);
/* --------------------------------------------------------------------
* OP ID
* --------------------------------------------------------------------
*/
item = proto_tree_add_uint_format(
wimaxasncp_tree, hf_wimaxasncp_op_id,
tvb, offset, 1, ui8,
"OP ID: %s", val_to_str(ui8 >> 5, wimaxasncp_op_id_vals, unknown));
proto_item_append_text(item, " (%u)", ((ui8 >> 5) & 7));
/* use the function type to find the message vals */
for (i = 0; i < array_length(wimaxasncp_func_to_msg_vals_map); ++i)
{
p = &wimaxasncp_func_to_msg_vals_map[i];
if (function_type == p->function_type)
{
break;
}
}
/* --------------------------------------------------------------------
* message type
* --------------------------------------------------------------------
*/
message_name = p ? match_ver_value_string(0x1f & ui8, p->vals, global_wimaxasncp_nwg_ver) : unknown;
if (message_name == NULL)
{
message_name = unknown;
}
item = proto_tree_add_uint_format(
wimaxasncp_tree, hf_wimaxasncp_message_type,
tvb, offset, 1, ui8,
"Message Type: %s", message_name);
proto_item_append_text(item, " (%u)", ui8 & 0x1F);
/* Add expert item if not matched */
if (strcmp(message_name, unknown) == 0)
{
expert_add_info_format(pinfo, item, &ei_wimaxasncp_message_type,
"Unknown message type (%u)",
0x1f & ui8);
}
col_add_str(pinfo->cinfo, COL_INFO, message_name);
offset += 1;
/* ------------------------------------------------------------------------
* length
* ------------------------------------------------------------------------
*/
length = tvb_get_ntohs(tvb, offset);
if (tree)
{
proto_item_set_len(
packet_item, MAX(WIMAXASNCP_HEADER_LENGTH_END, length));
item = proto_tree_add_uint(
wimaxasncp_tree, hf_wimaxasncp_length,
tvb, offset, 2, length);
}
offset += 2;
if (length < WIMAXASNCP_HEADER_SIZE)
{
expert_add_info(pinfo, item, &ei_wimaxasncp_length_bad);
if (tree)
{
proto_item_append_text(
item, " [error: specified length less than header size (20)]");
}
if (length <= WIMAXASNCP_HEADER_LENGTH_END)
{
return offset;
}
}
/* ------------------------------------------------------------------------
* remaining header fields and TLVs
* ------------------------------------------------------------------------
*/
subtree = tvb_new_subset_length_caplen(
tvb, offset,
MIN(length, tvb_captured_length_remaining(tvb, offset)),
length - WIMAXASNCP_HEADER_LENGTH_END);
offset += dissect_wimaxasncp_backend(
subtree, pinfo, wimaxasncp_tree);
/* ------------------------------------------------------------------------
* done, return the amount of data this dissector was able to dissect
* ------------------------------------------------------------------------
*/
return offset;
}
/* ========================================================================= */
/* Modify the given string to make a suitable display filter */
static char *alnumerize(
char *name)
{
char *r = name; /* read pointer */
char *w = name; /* write pointer */
char c;
for ( ; (c = *r); ++r)
{
if (g_ascii_isalnum(c) || c == '_' || c == '.')
{
/* These characters are fine - copy them */
*(w++) = c;
}
else if (c == ' ' || c == '-' || c == '/')
{
/* Skip these others if haven't written any characters out yet */
if (w == name)
{
continue;
}
/* Skip if we would produce multiple adjacent '_'s */
if (*(w - 1) == '_')
{
continue;
}
/* OK, replace with underscore */
*(w++) = '_';
}
/* Other undesirable characters are just skipped */
}
/* Terminate and return modified string */
*w = '\0';
return name;
}
/* ========================================================================= */
static void add_reg_info(
int *hf_ptr,
const char *name,
const char *abbrev,
enum ftenum type,
int display,
const char *blurb)
{
hf_register_info hf = {
hf_ptr, { name, abbrev, type, display, NULL, 0x0, blurb, HFILL } };
wmem_array_append_one(wimaxasncp_build_dict.hf, hf);
}
/* ========================================================================= */
static void add_tlv_reg_info(
wimaxasncp_dict_tlv_t *tlv)
{
char *name;
char *abbrev;
const char *root_blurb;
char *blurb;
/* ------------------------------------------------------------------------
* add root reg info
* ------------------------------------------------------------------------
*/
name = wmem_strdup(wmem_epan_scope(), tlv->name);
abbrev = alnumerize(wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s", tlv->name));
switch (tlv->decoder)
{
case WIMAXASNCP_TLV_UNKNOWN:
root_blurb = "type=Unknown";
break;
case WIMAXASNCP_TLV_TBD:
root_blurb = wmem_strdup_printf(wmem_epan_scope(), "type=%u, TBD", tlv->type);
break;
case WIMAXASNCP_TLV_COMPOUND:
root_blurb = wmem_strdup_printf(wmem_epan_scope(), "type=%u, Compound", tlv->type);
break;
case WIMAXASNCP_TLV_FLAG0:
root_blurb = wmem_strdup_printf(wmem_epan_scope(), "type=%u, Value = Null", tlv->type);
break;
default:
root_blurb = wmem_strdup_printf(wmem_epan_scope(), "type=%u", tlv->type);
break;
}
add_reg_info(
&tlv->hf_root, name, abbrev, FT_BYTES, BASE_NONE, root_blurb);
/* ------------------------------------------------------------------------
* add value(s) reg info
* ------------------------------------------------------------------------
*/
name = wmem_strdup(wmem_epan_scope(), "Value");
abbrev = alnumerize(wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.value", tlv->name));
blurb = wmem_strdup_printf(wmem_epan_scope(), "value for type=%u", tlv->type);
switch (tlv->decoder)
{
case WIMAXASNCP_TLV_UNKNOWN:
wmem_free(wmem_epan_scope(), blurb);
add_reg_info(
&tlv->hf_value, name, abbrev, FT_BYTES, BASE_NONE,
"value for unknown type");
break;
case WIMAXASNCP_TLV_TBD:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_BYTES, BASE_NONE, blurb);
break;
case WIMAXASNCP_TLV_COMPOUND:
case WIMAXASNCP_TLV_FLAG0:
wmem_free(wmem_epan_scope(), name);
wmem_free(wmem_epan_scope(), abbrev);
wmem_free(wmem_epan_scope(), blurb);
break;
case WIMAXASNCP_TLV_BYTES:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_BYTES, BASE_NONE, blurb);
break;
case WIMAXASNCP_TLV_ENUM8:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_UINT8, BASE_DEC, blurb);
break;
case WIMAXASNCP_TLV_ENUM16:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_UINT16, BASE_DEC, blurb);
break;
case WIMAXASNCP_TLV_ENUM32:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_UINT32, BASE_DEC, blurb);
break;
case WIMAXASNCP_TLV_ETHER:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_ETHER, BASE_NONE, blurb);
break;
case WIMAXASNCP_TLV_ASCII_STRING:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_STRING, BASE_NONE, blurb);
break;
case WIMAXASNCP_TLV_BITFLAGS8:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_UINT8, BASE_HEX, blurb);
break;
case WIMAXASNCP_TLV_BITFLAGS16:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_UINT16, BASE_HEX, blurb);
break;
case WIMAXASNCP_TLV_BITFLAGS32:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_UINT32, BASE_HEX, blurb);
break;
case WIMAXASNCP_TLV_ID:
wmem_free(wmem_epan_scope(), abbrev);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.ipv4_value", tlv->name));
add_reg_info(
&tlv->hf_ipv4, "IPv4 Address", abbrev, FT_IPv4, BASE_NONE, blurb);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.ipv6_value", tlv->name));
add_reg_info(
&tlv->hf_ipv6, "IPv6 Address", abbrev, FT_IPv6, BASE_NONE, blurb);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.bsid_value", tlv->name));
add_reg_info(
&tlv->hf_bsid, "BS ID", abbrev, FT_ETHER, BASE_NONE, blurb);
break;
case WIMAXASNCP_TLV_HEX8:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_UINT8, BASE_HEX, blurb);
break;
case WIMAXASNCP_TLV_HEX16:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_UINT16, BASE_HEX, blurb);
break;
case WIMAXASNCP_TLV_HEX32:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_UINT32, BASE_HEX, blurb);
break;
case WIMAXASNCP_TLV_DEC8:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_UINT8, BASE_DEC, blurb);
break;
case WIMAXASNCP_TLV_DEC16:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_UINT16, BASE_DEC, blurb);
break;
case WIMAXASNCP_TLV_DEC32:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_UINT32, BASE_DEC, blurb);
break;
case WIMAXASNCP_TLV_IP_ADDRESS:
wmem_free(wmem_epan_scope(), abbrev);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.ipv4_value", tlv->name));
add_reg_info(
&tlv->hf_ipv4, "IPv4 Address", abbrev, FT_IPv4, BASE_NONE, blurb);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.ipv6_value", tlv->name));
add_reg_info(
&tlv->hf_ipv6, "IPv6 Address", abbrev, FT_IPv6, BASE_NONE, blurb);
break;
case WIMAXASNCP_TLV_IPV4_ADDRESS:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_IPv4, BASE_NONE, blurb);
break;
case WIMAXASNCP_TLV_PROTOCOL_LIST:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_BYTES, BASE_NONE, blurb);
blurb = wmem_strdup_printf(wmem_epan_scope(), "value component for type=%u", tlv->type);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.value.protocol", tlv->name));
add_reg_info(
&tlv->hf_protocol, "Protocol", abbrev, FT_UINT16, BASE_DEC, blurb);
break;
case WIMAXASNCP_TLV_PORT_RANGE_LIST:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_BYTES, BASE_NONE, blurb);
blurb = wmem_strdup_printf(wmem_epan_scope(), "value component for type=%u", tlv->type);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.value.port_low", tlv->name));
add_reg_info(
&tlv->hf_port_low, "Port Low", abbrev, FT_UINT16, BASE_DEC, blurb);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.value.port_high", tlv->name));
add_reg_info(
&tlv->hf_port_high, "Port High", abbrev, FT_UINT16, BASE_DEC, blurb);
break;
case WIMAXASNCP_TLV_IP_ADDRESS_MASK_LIST:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_BYTES, BASE_NONE, blurb);
blurb = wmem_strdup_printf(wmem_epan_scope(), "value component for type=%u", tlv->type);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.value.ipv4", tlv->name));
add_reg_info(
&tlv->hf_ipv4, "IPv4 Address", abbrev, FT_IPv4, BASE_NONE, blurb);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.value.ipv4_mask", tlv->name));
add_reg_info(
&tlv->hf_ipv4_mask, "IPv4 Mask", abbrev, FT_IPv4, BASE_NONE, blurb);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.value.ipv6", tlv->name));
add_reg_info(
&tlv->hf_ipv6, "IPv6 Address", abbrev, FT_IPv6, BASE_NONE, blurb);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.value.ipv6_mask", tlv->name));
add_reg_info(
&tlv->hf_ipv6_mask, "IPv6 Mask", abbrev, FT_IPv6, BASE_NONE, blurb);
break;
case WIMAXASNCP_TLV_VENDOR_SPECIFIC:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_BYTES, BASE_NONE, blurb);
blurb = wmem_strdup_printf(wmem_epan_scope(), "value component for type=%u", tlv->type);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(), "wimaxasncp.tlv.%s.value.vendor_id", tlv->name));
add_reg_info(
&tlv->hf_vendor_id, "Vendor ID", abbrev, FT_UINT24, BASE_DEC, blurb);
abbrev = alnumerize(
wmem_strdup_printf(wmem_epan_scope(),
"wimaxasncp.tlv.%s.value.vendor_rest_of_info", tlv->name));
add_reg_info(
&tlv->hf_vendor_rest_of_info, "Rest of Info", abbrev, FT_BYTES, BASE_NONE,
blurb);
break;
case WIMAXASNCP_TLV_EAP:
blurb = wmem_strdup_printf(wmem_epan_scope(), "EAP payload embedded in %s", name);
add_reg_info(
&tlv->hf_value, name, abbrev, FT_BYTES, BASE_NONE, blurb);
break;
default:
add_reg_info(
&tlv->hf_value, name, abbrev, FT_BYTES, BASE_NONE, blurb);
if (debug_enabled)
{
g_print(
"fix-me: unknown decoder: %d\n", tlv->decoder);
}
break;
}
}
/* ========================================================================= */
/* Register the protocol fields and subtrees with Wireshark */
static void
register_wimaxasncp_fields(const char* unused _U_)
{
gboolean debug_parser;
gboolean dump_dict;
gchar *dir;
gchar* dict_error;
/* ------------------------------------------------------------------------
* List of header fields
* ------------------------------------------------------------------------
*/
static hf_register_info hf_base[] = {
{
&hf_wimaxasncp_version, /* ID */
{
"Version", /* FIELDNAME */
"wimaxasncp.version", /* PROTOABBREV.FIELDABBRE */
FT_UINT8, /* FIELDTYPE */
BASE_DEC, /* FIELDBASE */
NULL, /* FIELDCONVERT */
0x0, /* BITMASK */
NULL, /* FIELDDESCR */
HFILL /* HFILL */
}
},
{
&hf_wimaxasncp_flags,
{
"Flags",
"wimaxasncp.flags",
FT_UINT8,
BASE_HEX,
NULL,
0xff,
NULL,
HFILL
}
},
{
&hf_wimaxasncp_function_type,
{
"Function Type",
"wimaxasncp.function_type",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxasncp_op_id,
{
"OP ID",
"wimaxasncp.opid",
FT_UINT8,
BASE_HEX,
VALS(wimaxasncp_op_id_vals),
0xE0,
NULL,
HFILL
}
},
{
&hf_wimaxasncp_message_type,
{
"Message Type",
"wimaxasncp.message_type",
FT_UINT8,
BASE_HEX,
NULL,
0x1F,
NULL,
HFILL
}
},
#if 0
{
&hf_wimaxasncp_qos_msg,
{
"Message Type",
"wimaxasncp.qos_msg",
FT_UINT8,
BASE_HEX,
NULL,
0x1F,
NULL,
HFILL
}
},
#endif
#if 0
{
&hf_wimaxasncp_ho_control_msg,
{
"Message Type",
"wimaxasncp.ho_control_msg",
FT_UINT8,
BASE_HEX,
NULL,
0x1F,
NULL,
HFILL
}
},
#endif
#if 0
{
&hf_wimaxasncp_data_path_control_msg,
{
"Message Type",
"wimaxasncp.data_path_control_msg",
FT_UINT8,
BASE_HEX,
NULL,
0x1F,
NULL,
HFILL
}
},
#endif
#if 0
{
&hf_wimaxasncp_context_delivery_msg,
{
"Message Type",
"wimaxasncp.context_delivery_msg",
FT_UINT8,
BASE_HEX,
NULL,
0x1F,
NULL,
HFILL
}
},
#endif
#if 0
{
&hf_wimaxasncp_r3_mobility_msg,
{
"Message Type",
"wimaxasncp.r3_mobility_msg",
FT_UINT8,
BASE_HEX,
NULL,
0x1F,
NULL,
HFILL
}
},
#endif
#if 0
{
&hf_wimaxasncp_paging_msg,
{
"Message Type",
"wimaxasncp.paging_msg",
FT_UINT8,
BASE_HEX,
NULL,
0x1F,
NULL,
HFILL
}
},
#endif
#if 0
{
&hf_wimaxasncp_rrm_msg,
{
"Message Type",
"wimaxasncp.rrm_msg",
FT_UINT8,
BASE_HEX,
NULL,
0x1F,
NULL,
HFILL
}
},
#endif
#if 0
{
&hf_wimaxasncp_authentication_msg,
{
"Message Type",
"wimaxasncp.authentication_msg",
FT_UINT8,
BASE_HEX,
NULL,
0x1F,
NULL,
HFILL
}
},
#endif
#if 0
{
&hf_wimaxasncp_ms_state_msg,
{
"Message Type",
"wimaxasncp.ms_state_msg",
FT_UINT8,
BASE_HEX,
NULL,
0x1F,
NULL,
HFILL
}
},
#endif
#if 0
{
&hf_wimaxasncp_reauthentication_msg,
{
"Message Type",
"wimaxasncp.reauthentication_msg",
FT_UINT8,
BASE_HEX,
NULL,
0x1F,
NULL,
HFILL
}
},
#endif
#if 0
{
&hf_wimaxasncp_session_msg,
{
"Message Type",
"wimaxasncp.session_msg",
FT_UINT8,
BASE_HEX,
NULL,
0x1F,
NULL,
HFILL
}
},
#endif
{
&hf_wimaxasncp_length,
{
"Length",
"wimaxasncp.length",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxasncp_msid,
{
"MSID",
"wimaxasncp.msid",
FT_ETHER,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxasncp_reserved1,
{
"Reserved",
"wimaxasncp.reserved1",
FT_UINT32,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxasncp_transaction_id,
{
"Transaction ID",
"wimaxasncp.transaction_id",
FT_UINT16,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxasncp_reserved2,
{
"Reserved",
"wimaxasncp.reserved2",
FT_UINT16,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
#if 0
{
&hf_wimaxasncp_tlv,
{
"TLV",
"wimaxasncp.tlv",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
#endif
{
&hf_wimaxasncp_tlv_type,
{
"Type",
"wimaxasncp.tlv.type",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxasncp_tlv_length,
{
"Length",
"wimaxasncp.tlv.length",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxasncp_tlv_value_bytes,
{
"Value",
"wimaxasncp.tlv_value_bytes",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxasncp_tlv_value_bitflags8,
{
"Value",
"wimaxasncp.tlv_value_bitflags8",
FT_UINT8,
BASE_HEX,
NULL,
0xff,
NULL,
HFILL
}
},
{
&hf_wimaxasncp_tlv_value_bitflags16,
{
"Value",
"wimaxasncp.tlv_value_bitflags16",
FT_UINT16,
BASE_HEX,
NULL,
0xffff,
NULL,
HFILL
}
},
{
&hf_wimaxasncp_tlv_value_bitflags32,
{
"Value",
"wimaxasncp.tlv_value_bitflags32",
FT_UINT32,
BASE_HEX,
NULL,
0xffffffff,
NULL,
HFILL
}
},
#if 0
{
&hf_wimaxasncp_tlv_value_protocol,
{
"Value",
"wimaxasncp.tlv_value_protocol",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
#endif
#if 0
{
&hf_wimaxasncp_tlv_value_vendor_id,
{
"Vendor ID",
"wimaxasncp.tlv_value_vendor_id",
FT_UINT24,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
}
#endif
};
/* ------------------------------------------------------------------------
* Protocol subtree array
* ------------------------------------------------------------------------
*/
static gint *ett_base[] = {
&ett_wimaxasncp,
&ett_wimaxasncp_flags,
&ett_wimaxasncp_tlv,
&ett_wimaxasncp_tlv_value_bitflags8,
&ett_wimaxasncp_tlv_value_bitflags16,
&ett_wimaxasncp_tlv_value_bitflags32,
&ett_wimaxasncp_tlv_protocol_list,
&ett_wimaxasncp_tlv_port_range_list,
&ett_wimaxasncp_tlv_ip_address_mask_list,
&ett_wimaxasncp_tlv_ip_address_mask,
&ett_wimaxasncp_tlv_eap,
&ett_wimaxasncp_tlv_vendor_specific_information_field,
&ett_wimaxasncp_port_range
};
static ei_register_info ei[] = {
{ &ei_wimaxasncp_tlv_type, { "wimaxasncp.tlv.type.unknown", PI_UNDECODED, PI_WARN, "Unknown tlv", EXPFILL }},
{ &ei_wimaxasncp_function_type, { "wimaxasncp.function_type.unknown", PI_UNDECODED, PI_WARN, "Unknown function type", EXPFILL }},
{ &ei_wimaxasncp_op_id, { "wimaxasncp.opid.unknown", PI_UNDECODED, PI_WARN, "Unknown message op", EXPFILL }},
{ &ei_wimaxasncp_message_type, { "wimaxasncp.message_type.unknown", PI_UNDECODED, PI_WARN, "Unknown message type", EXPFILL }},
{ &ei_wimaxasncp_length_bad, { "wimaxasncp.length.bad", PI_MALFORMED, PI_ERROR, "Bad length", EXPFILL }},
};
expert_module_t* expert_wimaxasncp;
/* ------------------------------------------------------------------------
* load the XML dictionary
* ------------------------------------------------------------------------
*/
debug_parser = getenv("WIRESHARK_DEBUG_WIMAXASNCP_DICT_PARSER") != NULL;
dump_dict = getenv("WIRESHARK_DUMP_WIMAXASNCP_DICT") != NULL;
dir = ws_strdup_printf(
"%s" G_DIR_SEPARATOR_S "wimaxasncp",
get_datafile_dir());
wimaxasncp_dict =
wimaxasncp_dict_scan(dir, "dictionary.xml", debug_parser, &dict_error);
g_free(dir);
if (dict_error)
{
report_failure("wimaxasncp - %s", dict_error);
g_free(dict_error);
}
if (wimaxasncp_dict && dump_dict)
{
wimaxasncp_dict_print(stdout, wimaxasncp_dict);
}
/* ------------------------------------------------------------------------
* build the hf and ett dictionary entries
* ------------------------------------------------------------------------
*/
wimaxasncp_build_dict.hf =
wmem_array_new(wmem_epan_scope(), sizeof(hf_register_info));
wmem_array_append(
wimaxasncp_build_dict.hf, hf_base, array_length(hf_base));
wimaxasncp_build_dict.ett =
wmem_array_new(wmem_epan_scope(), sizeof(gint*));
wmem_array_append(
wimaxasncp_build_dict.ett, ett_base, array_length(ett_base));
if (wimaxasncp_dict)
{
wimaxasncp_dict_tlv_t *tlv;
/* For each TLV found in XML file */
for (tlv = wimaxasncp_dict->tlvs; tlv; tlv = tlv->next)
{
if (tlv->enums)
{
/* Create array for enums */
wimaxasncp_dict_enum_t *e;
wmem_array_t* array = wmem_array_new(wmem_epan_scope(), sizeof(value_string));
/* Copy each entry into value_string array */
for (e = tlv->enums; e; e = e->next)
{
value_string item = { e->code, e->name };
wmem_array_append_one(array, item);
}
/* Set enums to use with this TLV */
wmem_array_set_null_terminator(array);
tlv->enum_vs = (value_string*)wmem_array_get_raw(array);
}
add_tlv_reg_info(tlv);
}
}
/* add an entry for unknown TLVs */
add_tlv_reg_info(&wimaxasncp_tlv_not_found);
/* The following debug will only be printed if the debug_enabled variable
* is set programmatically. Setting the value via preferences will not
* work as it will be set too late to affect this code path.
*/
if (debug_enabled)
{
if (wimaxasncp_dict)
{
wimaxasncp_dict_tlv_t *tlv;
for (tlv = wimaxasncp_dict->tlvs; tlv; tlv = tlv->next)
{
ws_debug_printf(
"%s\n"
" type = %u\n"
" description = %s\n"
" decoder = %s\n"
" hf_root = %d\n"
" hf_value = %d\n"
" hf_ipv4 = %d\n"
" hf_ipv6 = %d\n"
" hf_bsid = %d\n"
" hf_protocol = %d\n"
" hf_port_low = %d\n"
" hf_port_high = %d\n"
" hf_ipv4_mask = %d\n"
" hf_ipv6_mask = %d\n"
" hf_vendor_id = %d\n"
" hf_vendor_rest_of_info = %d\n",
tlv->name,
tlv->type,
tlv->description,
val_to_str(
tlv->decoder, wimaxasncp_decode_type_vals, "Unknown"),
tlv->hf_root,
tlv->hf_value,
tlv->hf_ipv4,
tlv->hf_ipv6,
tlv->hf_bsid,
tlv->hf_protocol,
tlv->hf_port_low,
tlv->hf_port_high,
tlv->hf_ipv4_mask,
tlv->hf_ipv6_mask,
tlv->hf_vendor_id,
tlv->hf_vendor_rest_of_info);
}
}
}
/* Required function calls to register the header fields and subtrees
* used */
proto_register_field_array(
proto_wimaxasncp,
(hf_register_info*)wmem_array_get_raw(wimaxasncp_build_dict.hf),
wmem_array_get_count(wimaxasncp_build_dict.hf));
proto_register_subtree_array(
(gint**)wmem_array_get_raw(wimaxasncp_build_dict.ett),
wmem_array_get_count(wimaxasncp_build_dict.ett));
expert_wimaxasncp = expert_register_protocol(proto_wimaxasncp);
expert_register_field_array(expert_wimaxasncp, ei, array_length(ei));
}
/* ========================================================================= */
/* Register the protocol with Wireshark */
/* this format is require because a script is used to build the C function
that calls all the protocol registration.
*/
void
proto_register_wimaxasncp(void)
{
module_t *wimaxasncp_module;
/* ------------------------------------------------------------------------
* complete registration
* ------------------------------------------------------------------------
*/
/* Register the protocol name and description */
proto_wimaxasncp = proto_register_protocol("WiMAX ASN Control Plane Protocol", "WiMAX ASN CP", "wimaxasncp");
/* Register this dissector by name */
wimaxasncp_handle = register_dissector("wimaxasncp", dissect_wimaxasncp, proto_wimaxasncp);
wimaxasncp_module = prefs_register_protocol(proto_wimaxasncp, NULL);
/* Register preferences */
prefs_register_bool_preference(
wimaxasncp_module,
"show_transaction_id_d_bit",
"Show transaction ID direction bit",
"Show transaction ID direction bit separately from the rest of "
"the transaction ID field.",
&show_transaction_id_d_bit);
prefs_register_bool_preference(
wimaxasncp_module,
"debug_enabled",
"Enable debug output",
"Print debug output to the console.",
&debug_enabled);
prefs_register_enum_preference(
wimaxasncp_module,
"nwg_version",
"NWG Version",
"Version of the NWG that the R6 protocol complies with",
&global_wimaxasncp_nwg_ver,
wimaxasncp_nwg_versions,
FALSE);
proto_register_prefix("wimaxasncp", register_wimaxasncp_fields);
}
/* ========================================================================= */
/* If this dissector uses sub-dissector registration add a registration
routine. This exact format is required because a script is used to find
these routines and create the code that calls these routines.
This function is also called by preferences whenever "Apply" is pressed
(see prefs_register_protocol above) so it should accommodate being called
more than once.
*/
void
proto_reg_handoff_wimaxasncp(void)
{
/* Find the EAP dissector */
eap_handle = find_dissector_add_dependency("eap", proto_wimaxasncp);
dissector_add_uint_with_preference("udp.port", WIMAXASNCP_DEF_UDP_PORT, wimaxasncp_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/ |
C/C++ | wireshark/plugins/epan/wimaxasncp/wimaxasncp_dict.h | /*
** wimaxasncp_dict.h
** WIMAXASNCP Dictionary Import Routines
**
** (c) 2007, Stephen Croll <[email protected]>
**
** SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef _WIMAXASNCP_DICT_H_
#define _WIMAXASNCP_DICT_H_
/* -------------------------------------------------------------------------
* NWG versions
* ------------------------------------------------------------------------- */
#define WIMAXASNCP_NWGVER_R10_V100 0
#define WIMAXASNCP_NWGVER_R10_V120 1
#define WIMAXASNCP_NWGVER_R10_V121 2
#define WIMAXASNCP_NWGVER_NUM 3
/* -------------------------------------------------------------------------
* decode types
* ------------------------------------------------------------------------- */
enum
{
WIMAXASNCP_TLV_UNKNOWN,
WIMAXASNCP_TLV_TBD,
WIMAXASNCP_TLV_COMPOUND,
WIMAXASNCP_TLV_BYTES,
WIMAXASNCP_TLV_ENUM8,
WIMAXASNCP_TLV_ENUM16,
WIMAXASNCP_TLV_ENUM32,
WIMAXASNCP_TLV_ETHER,
WIMAXASNCP_TLV_ASCII_STRING,
WIMAXASNCP_TLV_FLAG0,
WIMAXASNCP_TLV_BITFLAGS8,
WIMAXASNCP_TLV_BITFLAGS16,
WIMAXASNCP_TLV_BITFLAGS32,
WIMAXASNCP_TLV_ID,
WIMAXASNCP_TLV_HEX8,
WIMAXASNCP_TLV_HEX16,
WIMAXASNCP_TLV_HEX32,
WIMAXASNCP_TLV_DEC8,
WIMAXASNCP_TLV_DEC16,
WIMAXASNCP_TLV_DEC32,
WIMAXASNCP_TLV_IP_ADDRESS, /* Note: IPv4 or IPv6, determined by length */
WIMAXASNCP_TLV_IPV4_ADDRESS,
WIMAXASNCP_TLV_PROTOCOL_LIST,
WIMAXASNCP_TLV_PORT_RANGE_LIST,
WIMAXASNCP_TLV_IP_ADDRESS_MASK_LIST,
WIMAXASNCP_TLV_EAP,
WIMAXASNCP_TLV_VENDOR_SPECIFIC
};
/* -------------------------------------------------------------------------
* structures and functions
* ------------------------------------------------------------------------- */
struct _wimaxasncp_dict_namecode_t {
gchar *name;
guint code;
struct _wimaxasncp_dict_namecode_t *next;
};
typedef struct _wimaxasncp_dict_namecode_t wimaxasncp_dict_enum_t;
typedef struct _wimaxasncp_dict_tlv_t {
guint16 type;
gchar *name;
gchar *description;
gint decoder;
guint since;
int hf_root;
int hf_value;
int hf_ipv4;
int hf_ipv6;
int hf_bsid;
int hf_protocol;
int hf_port_low;
int hf_port_high;
int hf_ipv4_mask;
int hf_ipv6_mask;
int hf_vendor_id;
int hf_vendor_rest_of_info;
value_string *enum_vs;
wimaxasncp_dict_enum_t *enums;
struct _wimaxasncp_dict_tlv_t *next;
} wimaxasncp_dict_tlv_t;
typedef struct _wimaxasncp_dict_xmlpi_t {
gchar *name;
gchar *key;
gchar *value;
struct _wimaxasncp_dict_xmlpi_t *next;
} wimaxasncp_dict_xmlpi_t;
typedef struct _wimaxasncp_dict_t {
wimaxasncp_dict_tlv_t *tlvs;
wimaxasncp_dict_xmlpi_t *xmlpis;
} wimaxasncp_dict_t;
extern void wimaxasncp_dict_print(
FILE *fh, wimaxasncp_dict_t *d);
extern wimaxasncp_dict_t *wimaxasncp_dict_scan(
const gchar *system_directory, const gchar *filename, int dbg,
gchar **error);
extern void wimaxasncp_dict_free(
wimaxasncp_dict_t *d);
#endif |
wireshark/plugins/epan/wimaxasncp/wimaxasncp_dict.l | %top {
/* Include this before everything else, for various large-file definitions */
#include "config.h"
#include <wireshark.h>
}
/*
* We want a reentrant scanner.
*/
%option reentrant
/*
* We don't use input, so don't generate code for it.
*/
%option noinput
/*
* We don't use unput, so don't generate code for it.
*/
%option nounput
/*
* We don't read interactively from the terminal.
*/
%option never-interactive
/*
* We want to stop processing when we get to the end of the input.
*/
%option noyywrap
/*
* The type for the state we keep for a scanner.
*/
%option extra-type="WimaxasncpDict_scanner_state_t *"
/*
* We have to override the memory allocators so that we don't get
* "unused argument" warnings from the yyscanner argument (which
* we don't use, as we have a global memory allocator).
*
* We provide, as macros, our own versions of the routines generated by Flex,
* which just call malloc()/realloc()/free() (as the Flex versions do),
* discarding the extra argument.
*/
%option noyyalloc
%option noyyrealloc
%option noyyfree
/*
* The language we're scanning is case-insensitive.
*/
%option caseless
/*
* We use start condition stacks.
*/
%option stack
/*
* Prefix scanner routines with "WimaxasncpDict_" rather than "yy", so this
* scanner can coexist with other scanners.
*/
%option prefix="WimaxasncpDict_"
%option outfile="wimaxasncp_dict.c"
%{
/*
** wimaxasncp_dict.h
** WIMAXASNCP Dictionary Import Routines
**
** (c) 2007, Luis E. Garcia Ontanon <[email protected]>
** (c) 2007, Stephen Croll <[email protected]>
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Library General Public
** License as published by the Free Software Foundation; either
** version 2 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details.
**
** You should have received a copy of the GNU Library General Public
** License along with this library; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor,
** Boston, MA 02110-1301, USA.
*/
#include <glib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <stdarg.h>
#include <epan/value_string.h>
#include <epan/packet.h> /* array_length */
#include <wsutil/file_util.h>
#include "wimaxasncp_dict.h"
/*
* Disable diagnostics in the code generated by Flex.
*/
DIAG_OFF_FLEX()
typedef struct entity_t {
gchar *name;
gchar *file;
struct entity_t *next;
} entity_t;
#define ATTR_UINT(cont) do { D(("attr_uint " #cont "\t" )); yyextra->attr_uint = &(cont); yy_push_state(GET_UINT_ATTR, yyscanner); } while(0)
#define ATTR_UINT16(cont) do { D(("attr_uint16 " #cont "\t" )); yyextra->attr_uint16 = &(cont); yy_push_state(GET_UINT16_ATTR, yyscanner); } while(0)
#define ATTR_STR(cont) do { D(("attr_str " #cont "\t" )); yyextra->attr_str = &(cont); yy_push_state(GET_ATTR, yyscanner); } while(0)
#define ATTR_DECODER(cont) do { D(("attr_decoder " #cont "\t" )); yyextra->attr_uint = &(cont); yy_push_state(GET_DECODER_ATTR, yyscanner); } while(0)
#define WIMAXASNCP_IGNORE() do { D(("ignore: %s\t",yytext)); yy_push_state(IGNORE_ATTR, yyscanner); } while(0)
#define D(args) wimaxasncp_dict_debug args
#define MAX_INCLUDE_DEPTH 10
#define YY_INPUT(buf,result,max_size) { result = yyextra->current_yyinput(buf,max_size,yyscanner); }
#define YY_USER_INIT { \
WimaxasncpDict_scanner_state_t *scanner_state = WimaxasncpDict_get_extra(yyscanner); \
BEGIN(scanner_state->start_state); \
}
#define ECHO
#define APPEND(txt,len) append_to_buffer(txt,(int)len,yyextra)
typedef struct {
GString *dict_error;
const gchar *sys_dir;
gchar *strbuf;
guint size_strbuf;
guint len_strbuf;
gchar *write_ptr;
gchar *read_ptr;
wimaxasncp_dict_t *dict;
wimaxasncp_dict_tlv_t *tlv;
wimaxasncp_dict_enum_t *enumitem;
wimaxasncp_dict_xmlpi_t *xmlpi;
wimaxasncp_dict_tlv_t *last_tlv;
wimaxasncp_dict_enum_t *last_enumitem;
wimaxasncp_dict_xmlpi_t *last_xmlpi;
entity_t *ents;
YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
int include_stack_ptr;
size_t (*current_yyinput)(gchar*,size_t,yyscan_t);
gchar **attr_str;
guint *attr_uint;
gint16 *attr_uint16;
int start_state;
} WimaxasncpDict_scanner_state_t;
static guint wimaxasncp_bits(guint bits, char *n);
static gint wimaxasncp_decode_type(const gchar *name);
static void wimaxasncp_dict_debug(const gchar *fmt, ...) G_GNUC_PRINTF(1, 2);
static void append_to_buffer(const gchar *txt, int len, WimaxasncpDict_scanner_state_t *state);
static FILE *wimaxasncp_dict_open(const gchar*, const gchar*);
/*
* Sleazy hack to suppress compiler warnings in yy_fatal_error().
*/
#define YY_EXIT_FAILURE ((void)yyscanner, 2)
/*
* Macros for the allocators, to discard the extra argument.
*/
#define WimaxasncpDict_alloc(size, yyscanner) (void *)malloc(size)
#define WimaxasncpDict_realloc(ptr, size, yyscanner) (void *)realloc((char *)(ptr), (size))
#define WimaxasncpDict_free(ptr, yyscanner) free((char *)ptr)
%}
xmlpi_start [[:blank:] \r\n]*<\?[[:blank:] \r\n]*
xmlpi_end [[:blank:] \r\n]*\?>[[:blank:] \r\n]*
xmlpi_key_attr [[:blank:] \r\n]*key[[:blank:] \r\n]*=[[:blank:] \r\n]*\042
xmlpi_value_attr [[:blank:] \r\n]*value[[:blank:] \r\n]*=[[:blank:] \r\n]*\042
comment_start [[:blank:] \r\n]*<!--[[:blank:] \r\n]*
comment_end [[:blank:] \r\n]*-->[[:blank:] \r\n]*
open_tag [[:blank:] \r\n]*<[[:blank:] \r\n]*
end_tag [[:blank:] \r\n]*\/>[[:blank:] \r\n]*
close_tag [[:blank:] \r\n]*>[[:blank:] \r\n]*
open_closetag [[:blank:] \r\n]*<\/[[:blank:] \r\n]*
equals [[:blank:] \r\n]*=[[:blank:] \r\n]*
whitespace [[:blank:] \r\n]*
dquoted \042[^\042]*\042
doctype [[:blank:] \r\n]*<!DOCTYPE[^\[]*\[[[:blank:] \r\n]*
doctype_end [[:blank:] \r\n]*\][[:blank:] \r\n]*>[[:blank:] \r\n]*
start_entity [[:blank:] \r\n]*<\!ENTITY[[:blank:] \r\n]*
system [[:blank:] \r\n]*SYSTEM[[:blank:] \r\n]*\042
entityname [a-z0-9-]+
ndquot [^\042]+
end_entity \042[[:blank:] \r\n]*>[[:blank:] \r\n]*
entity \&[a-z0-9-]+;
any .
stop >
stop_end \/>
dquot \042
number [-]?[0-9]*|(0x)?[0-9a-fA-F]*
dictionary_start <dictionary>
dictionary_end <\/dictionary>
tlv_start <tlv
tlv_end <\/tlv>
type_start <type
enum_start <enum
ignored_attr [a-z0-9-]+=
ignored_quoted \042[^\042]*\042
name_attr name=\042
type_attr type=\042
code_attr code=\042
typename_attr type-name=\042
description_attr description=\042
decoder_attr decoder=\042
since_attr since=\042
%S LOADING LOADING_COMMENT LOADING_XMLPI ENTITY GET_SYSTEM GET_FILE END_ENTITY
%S GET_ATTR GET_UINT_ATTR GET_UINT16_ATTR
%S BIT32 BIT16 BIT8 GET_DECODER_ATTR END_ATTR
%S OUTSIDE IN_DICT IN_APPL IN_TLV IGNORE_ATTR
%S ENUM_ATTRS TLV_ATTRS
%S XMLPI_ATTRS XMLPI_GETKEY XMLPI_GETVAL XMLPI_ENDATTR
%%
<LOADING>{doctype} ;
<LOADING>{doctype_end} ;
<LOADING>{comment_start} BEGIN LOADING_COMMENT;
<LOADING_COMMENT>. ;
<LOADING_COMMENT>{comment_end} BEGIN LOADING;
<LOADING>{xmlpi_start} BEGIN LOADING_XMLPI;
<LOADING_XMLPI>{whitespace} ;
<LOADING_XMLPI>{entityname} {
yyextra->xmlpi = g_new(wimaxasncp_dict_xmlpi_t,1);
yyextra->xmlpi->name = g_strdup(yytext);
yyextra->xmlpi->key = NULL;
yyextra->xmlpi->value = NULL;
yyextra->xmlpi->next = NULL;
if (!yyextra->dict->xmlpis) yyextra->last_xmlpi = yyextra->dict->xmlpis = yyextra->xmlpi;
else yyextra->last_xmlpi = yyextra->last_xmlpi->next = yyextra->xmlpi;
BEGIN XMLPI_ATTRS;
}
<XMLPI_ATTRS>{xmlpi_key_attr} BEGIN XMLPI_GETKEY;
<XMLPI_GETKEY>{ndquot} { yyextra->xmlpi->key = g_strdup(yytext); BEGIN XMLPI_ATTRS; }
<XMLPI_ATTRS>{xmlpi_value_attr} BEGIN XMLPI_GETVAL;
<XMLPI_GETVAL>{ndquot} { yyextra->xmlpi->value = g_strdup(yytext); BEGIN XMLPI_ATTRS; }
<XMLPI_ATTRS>.
<XMLPI_ATTRS>{xmlpi_end} BEGIN LOADING;
<LOADING>{start_entity} BEGIN ENTITY;
<ENTITY>{entityname} {
entity_t *e = g_new(entity_t,1);
D(("ENTITY: %s\n",yytext));
e->name = g_strdup(yytext);
e->next = yyextra->ents;
yyextra->ents = e;
BEGIN GET_SYSTEM;
};
<GET_SYSTEM>{system} BEGIN GET_FILE;
<GET_FILE>{ndquot} {
D(("GET_FILE: %s\n",yytext));
yyextra->ents->file = g_strdup(yytext);
BEGIN END_ENTITY;
}
<END_ENTITY>{end_entity} BEGIN LOADING;
<LOADING>{open_tag} APPEND("<",1);
<LOADING>{close_tag} APPEND(">",1);
<LOADING>{end_tag} APPEND("/>",2);
<LOADING>{open_closetag} APPEND("</",2);
<LOADING>{whitespace} APPEND(" ",1);
<LOADING>{dquoted} APPEND(yytext,yyleng);
<LOADING>{equals} APPEND("=",1);
<LOADING>{any} APPEND(yytext,yyleng);
<LOADING,IN_DICT>{entity} {
gchar *p = ++yytext, *temp_str;
entity_t* e;
while(*p != ';') p++;
*p = '\0';
D(("looking for entity: %s\n",yytext));
if ( yyextra->include_stack_ptr >= MAX_INCLUDE_DEPTH ) {
yyextra->dict_error = g_string_append(
yyextra->dict_error, "included files nested too deeply\n");
yyterminate();
}
yyextra->include_stack[yyextra->include_stack_ptr++] = YY_CURRENT_BUFFER;
for (e = yyextra->ents; e; e = e->next) {
if (strcmp(e->name,yytext) == 0) {
yyin = wimaxasncp_dict_open(yyextra->sys_dir,e->file);
D(("entity: %s filename: %s yyin: %p\n",e->name,e->file,(void*)yyin));
if (!yyin) {
yyterminate();
} else {
WimaxasncpDict__switch_to_buffer(WimaxasncpDict__create_buffer(yyin, YY_BUF_SIZE, yyscanner), yyscanner);
}
break;
}
}
if (!e) {
temp_str = ws_strdup_printf(
"cannot find entity: '%s'\n", yytext);
yyextra->dict_error = g_string_append(yyextra->dict_error, temp_str);
g_free(temp_str);
yyterminate();
}
}
<<EOF>> {
if (!yyin) yyterminate();
fclose(yyin);
D(("closing: %p %i\n",(void*)yyin,yyextra->include_stack_ptr));
if ( --yyextra->include_stack_ptr < 0 ) {
D(("DONE READING\n"));
yyin = NULL;
yyterminate();
} else {
WimaxasncpDict__delete_buffer(YY_CURRENT_BUFFER, yyscanner);
WimaxasncpDict__switch_to_buffer(yyextra->include_stack[yyextra->include_stack_ptr], yyscanner);
BEGIN LOADING;
}
}
<GET_ATTR>{ndquot} {
*yyextra->attr_str = wmem_strdup(wmem_epan_scope(), yytext);
D(("%s\n",yytext));
yyextra->attr_str = NULL;
BEGIN END_ATTR;
}
<GET_UINT_ATTR>{number} {
*yyextra->attr_uint = (guint)strtoul(yytext,NULL,0);
D(("%s\n",yytext););
yyextra->attr_uint = NULL;
BEGIN END_ATTR;
}
<GET_UINT16_ATTR>{number} {
*yyextra->attr_uint16 = (gint16) strtol(yytext,NULL,0);
D(("%s\n",yytext););
yyextra->attr_uint16 = NULL;
BEGIN END_ATTR;
}
<GET_UINT_ATTR>"WIMAXASNCP_BIT32"[ \t]*"(" { BEGIN BIT32; }
<BIT32>[0-9]+ {
*yyextra->attr_uint = wimaxasncp_bits(32, yytext);
D(("WIMAXASNCP_BIT32(%s)\n",yytext););
yyextra->attr_uint = NULL;
}
<GET_UINT_ATTR>"WIMAXASNCP_BIT16"[ \t]*"(" { BEGIN BIT16; }
<BIT16>[0-9]+ {
*yyextra->attr_uint = wimaxasncp_bits(16, yytext);
D(("WIMAXASNCP_BIT16(%s)\n",yytext););
yyextra->attr_uint = NULL;
}
<GET_UINT_ATTR>"WIMAXASNCP_BIT8"[ \t]*"(" { BEGIN BIT8; }
<BIT8>[0-9]+ {
*yyextra->attr_uint = wimaxasncp_bits(8, yytext);
D(("WIMAXASNCP_BIT8(%s)\n",yytext););
yyextra->attr_uint = NULL;
}
<BIT32,BIT16,BIT8>[ \t]*")" { BEGIN END_ATTR; }
<GET_DECODER_ATTR>{ndquot} {
*yyextra->attr_uint = wimaxasncp_decode_type(yytext);
D(("%s\n",yytext));
yyextra->attr_uint = NULL;
BEGIN END_ATTR;
}
<END_ATTR>{dquot} { yy_pop_state(yyscanner); }
<IGNORE_ATTR>. {
/* XXX: should go?*/
D(("{%s}",yytext));
}
<IGNORE_ATTR>{ignored_quoted} {
D(("=>%s<=\n",yytext));
yy_pop_state(yyscanner);
}
<OUTSIDE>{dictionary_start} {
D(("dictionary_start\n"));
BEGIN IN_DICT;
}
<IN_DICT>{tlv_start} {
D(("tlv_start\n"));
yyextra->tlv = wmem_new0(wmem_epan_scope(), wimaxasncp_dict_tlv_t);
yyextra->tlv->hf_root = -1;
yyextra->tlv->hf_value = -1;
yyextra->tlv->hf_ipv4 = -1;
yyextra->tlv->hf_ipv6 = -1;
yyextra->tlv->hf_bsid = -1;
yyextra->tlv->hf_protocol = -1;
yyextra->tlv->hf_port_low = -1;
yyextra->tlv->hf_port_high = -1;
yyextra->tlv->hf_ipv4_mask = -1;
yyextra->tlv->hf_ipv6_mask = -1;
yyextra->tlv->hf_vendor_id = -1;
yyextra->tlv->hf_vendor_rest_of_info = -1;
if (! yyextra->dict->tlvs )
yyextra->last_tlv = yyextra->dict->tlvs = yyextra->tlv;
else
yyextra->last_tlv = yyextra->last_tlv->next = yyextra->tlv;
BEGIN TLV_ATTRS;
}
<TLV_ATTRS>{name_attr} { ATTR_STR(yyextra->tlv->name); }
<TLV_ATTRS>{description_attr} { ATTR_STR(yyextra->tlv->description); }
<TLV_ATTRS>{type_attr} { ATTR_UINT16(yyextra->tlv->type); }
<TLV_ATTRS>{decoder_attr} { ATTR_DECODER(yyextra->tlv->decoder); }
<TLV_ATTRS>{since_attr} { ATTR_UINT(yyextra->tlv->since); }
<TLV_ATTRS>{stop} { BEGIN IN_TLV; }
<TLV_ATTRS>{stop_end} { BEGIN IN_DICT; }
<IN_TLV>{enum_start} {
D(("enum_start\n"));
yyextra->enumitem = wmem_new(wmem_epan_scope(), wimaxasncp_dict_enum_t);
yyextra->enumitem->name = NULL;
yyextra->enumitem->code = 0;
yyextra->enumitem->next = NULL;
if (!yyextra->tlv->enums)
yyextra->last_enumitem = yyextra->tlv->enums = yyextra->enumitem;
else
yyextra->last_enumitem = yyextra->last_enumitem->next = yyextra->enumitem;
BEGIN ENUM_ATTRS;
}
<ENUM_ATTRS>{name_attr} { ATTR_STR(yyextra->enumitem->name); }
<ENUM_ATTRS>{code_attr} { ATTR_UINT(yyextra->enumitem->code); }
<ENUM_ATTRS>{stop} { BEGIN IN_TLV; }
<ENUM_ATTRS>{stop_end} { BEGIN IN_TLV; }
<IN_TLV>{tlv_end} { D(("tlv_end")); BEGIN IN_DICT; }
<IN_DICT>{dictionary_end} {
yyterminate();
}
<TLV_ATTRS,ENUM_ATTRS>{ignored_attr} WIMAXASNCP_IGNORE();
<OUTSIDE>. ;
%%
/*
* Turn diagnostics back on, so we check the code that we've written.
*/
DIAG_ON_FLEX()
static int debugging = 0;
static void wimaxasncp_dict_debug(const gchar *fmt, ...) {
va_list ap;
va_start(ap, fmt);
if (debugging) vfprintf(stderr, fmt, ap);
va_end(ap);
fflush(stderr);
}
static guint wimaxasncp_bits(guint bits, char *n)
{
return 1u << ((bits - 1) - (strtoul(n, NULL, 10)));
}
static const value_string wimaxasncp_decode_type_vals[] =
{
{ WIMAXASNCP_TLV_TBD, "WIMAXASNCP_TLV_TBD"},
{ WIMAXASNCP_TLV_COMPOUND, "WIMAXASNCP_TLV_COMPOUND"},
{ WIMAXASNCP_TLV_BYTES, "WIMAXASNCP_TLV_BYTES"},
{ WIMAXASNCP_TLV_ENUM8, "WIMAXASNCP_TLV_ENUM8"},
{ WIMAXASNCP_TLV_ENUM16, "WIMAXASNCP_TLV_ENUM16"},
{ WIMAXASNCP_TLV_ENUM32, "WIMAXASNCP_TLV_ENUM32"},
{ WIMAXASNCP_TLV_ETHER, "WIMAXASNCP_TLV_ETHER"},
{ WIMAXASNCP_TLV_ASCII_STRING, "WIMAXASNCP_TLV_ASCII_STRING"},
{ WIMAXASNCP_TLV_FLAG0, "WIMAXASNCP_TLV_FLAG0"},
{ WIMAXASNCP_TLV_BITFLAGS8, "WIMAXASNCP_TLV_BITFLAGS8"},
{ WIMAXASNCP_TLV_BITFLAGS16, "WIMAXASNCP_TLV_BITFLAGS16"},
{ WIMAXASNCP_TLV_BITFLAGS32, "WIMAXASNCP_TLV_BITFLAGS32"},
{ WIMAXASNCP_TLV_ID, "WIMAXASNCP_TLV_ID"},
{ WIMAXASNCP_TLV_HEX8, "WIMAXASNCP_TLV_HEX8"},
{ WIMAXASNCP_TLV_HEX16, "WIMAXASNCP_TLV_HEX16"},
{ WIMAXASNCP_TLV_HEX32, "WIMAXASNCP_TLV_HEX32"},
{ WIMAXASNCP_TLV_DEC8, "WIMAXASNCP_TLV_DEC8"},
{ WIMAXASNCP_TLV_DEC16, "WIMAXASNCP_TLV_DEC16"},
{ WIMAXASNCP_TLV_DEC32, "WIMAXASNCP_TLV_DEC32"},
{ WIMAXASNCP_TLV_IP_ADDRESS, "WIMAXASNCP_TLV_IP_ADDRESS"},
{ WIMAXASNCP_TLV_IPV4_ADDRESS, "WIMAXASNCP_TLV_IPV4_ADDRESS"},
{ WIMAXASNCP_TLV_PROTOCOL_LIST, "WIMAXASNCP_TLV_PROTOCOL_LIST"},
{ WIMAXASNCP_TLV_PORT_RANGE_LIST, "WIMAXASNCP_TLV_PORT_RANGE_LIST"},
{ WIMAXASNCP_TLV_IP_ADDRESS_MASK_LIST,"WIMAXASNCP_TLV_IP_ADDRESS_MASK_LIST"},
{ WIMAXASNCP_TLV_EAP, "WIMAXASNCP_TLV_EAP"},
{ WIMAXASNCP_TLV_VENDOR_SPECIFIC, "WIMAXASNCP_TLV_VENDOR_SPECIFIC"},
{ 0, NULL}
};
static gint wimaxasncp_decode_type(const gchar *name)
{
gsize i;
for (i = 0; i < array_length(wimaxasncp_decode_type_vals) - 1; ++i)
{
if (strcmp(name, wimaxasncp_decode_type_vals[i].strptr) == 0)
{
return wimaxasncp_decode_type_vals[i].value;
}
}
/* not found, emit some sort of error here? */
return WIMAXASNCP_TLV_TBD;
}
extern void wimaxasncp_dict_unused(yyscan_t yyscanner);
void wimaxasncp_dict_unused(yyscan_t yyscanner) {
yy_top_state(yyscanner);
}
static void append_to_buffer(const gchar *txt, int len, WimaxasncpDict_scanner_state_t *state) {
if (state->strbuf == NULL) {
state->read_ptr = state->write_ptr = state->strbuf = (gchar *)g_malloc(state->size_strbuf);
}
if (state->len_strbuf + len >= state->size_strbuf) {
state->read_ptr = state->strbuf = (gchar *)g_realloc(state->strbuf,state->size_strbuf *= 2);
}
state->write_ptr = state->strbuf + state->len_strbuf;
memcpy(state->write_ptr, txt, len + 1);
state->len_strbuf += len;
}
static size_t file_input(gchar *buf, size_t max, yyscan_t scanner) {
FILE *in = yyget_in(scanner);
size_t read_cnt;
read_cnt = fread(buf,1,max,in);
if ( read_cnt == max ) {
return max;
} else if (read_cnt > 0) {
return read_cnt;
} else {
return YY_NULL;
}
}
static size_t string_input(gchar *buf, size_t max, yyscan_t scanner) {
WimaxasncpDict_scanner_state_t *statep = yyget_extra(scanner);
if (statep->read_ptr >= statep->write_ptr ) {
return YY_NULL;
} else if ( statep->read_ptr + max > statep->write_ptr ) {
max = statep->write_ptr - statep->read_ptr;
}
memcpy(buf,statep->read_ptr,max);
statep->read_ptr += max;
return max;
}
static FILE *wimaxasncp_dict_open(
const gchar *system_directory,
const gchar *filename)
{
FILE *fh;
gchar *fname;
if (system_directory)
{
fname = ws_strdup_printf("%s%s%s",
system_directory, G_DIR_SEPARATOR_S,filename);
}
else
{
fname = g_strdup(filename);
}
fh = ws_fopen(fname,"r");
D(("fname: %s fh: %p\n",fname,(void*)fh));
g_free(fname);
return fh;
}
wimaxasncp_dict_t *wimaxasncp_dict_scan(
const gchar *system_directory, const gchar *filename, int dbg,
gchar **error) {
WimaxasncpDict_scanner_state_t state;
FILE *in;
yyscan_t scanner;
entity_t *e;
debugging = dbg;
state.dict_error = g_string_new("");
state.sys_dir = system_directory;
state.dict = g_new(wimaxasncp_dict_t,1);
state.dict->tlvs = NULL;
state.dict->xmlpis = NULL;
state.strbuf = NULL;
state.size_strbuf = 8192;
state.len_strbuf = 0;
state.write_ptr = NULL;
state.read_ptr = NULL;
state.tlv = NULL;
state.enumitem = NULL;
state.xmlpi = NULL;
state.last_tlv = NULL;
state.last_enumitem = NULL;
state.last_xmlpi = NULL;
state.ents = NULL;
/*
* Pass 1.
*
* Reads the file, does some work, and stores a modified version
* of the file contents in memory.
*/
state.current_yyinput = file_input;
state.include_stack_ptr = 0;
in = wimaxasncp_dict_open(system_directory,filename);
if (in == NULL) {
/*
* Couldn't open the dictionary.
*
* Treat all failures other then ENOENT as errors?
*/
*error = NULL;
return state.dict;
}
if (WimaxasncpDict_lex_init(&scanner) != 0) {
D(("Can't initialize scanner: %s\n", strerror(errno)));
fclose(in);
g_free(state.dict);
return NULL;
}
WimaxasncpDict_set_in(in, scanner);
/* Associate the state with the scanner */
WimaxasncpDict_set_extra(&state, scanner);
state.start_state = LOADING;
WimaxasncpDict_lex(scanner);
WimaxasncpDict_lex_destroy(scanner);
/*
* XXX - can the lexical analyzer terminate without closing
* all open input files?
*/
D(("\n---------------\n%s\n------- %d -------\n",
state.strbuf, state.len_strbuf));
/*
* Pass 2.
*
* Reads the modified version of the file contents and does the
* rest of the work.
*/
state.current_yyinput = string_input;
if (WimaxasncpDict_lex_init(&scanner) != 0) {
D(("Can't initialize scanner: %s\n", strerror(errno)));
fclose(in);
g_free(state.dict);
g_free(state.strbuf);
return NULL;
}
/* Associate the state with the scanner */
WimaxasncpDict_set_extra(&state, scanner);
state.start_state = OUTSIDE;
WimaxasncpDict_lex(scanner);
WimaxasncpDict_lex_destroy(scanner);
g_free(state.strbuf);
e = state.ents;
while (e)
{
entity_t *next = e->next;
g_free(e->name);
g_free(e->file);
g_free(e);
e = next;
}
if (state.dict_error->len > 0)
{
*error = g_string_free(state.dict_error, FALSE);
}
else
{
*error = NULL;
g_string_free(state.dict_error, TRUE);
}
return state.dict;
}
void wimaxasncp_dict_free(wimaxasncp_dict_t *d) {
wimaxasncp_dict_tlv_t *t, *tn;
#define FREE_NAMEANDOBJ(n) do { g_free(n->name); g_free(n); } while(0)
for (t = d->tlvs; t; t = tn) {
wimaxasncp_dict_enum_t *e, *en;
tn = t->next;
for (e = t->enums; e; e = en) {
en = e->next;
FREE_NAMEANDOBJ(e);
}
g_free(t->description);
FREE_NAMEANDOBJ(t);
}
g_free(d);
}
void wimaxasncp_dict_print(FILE *fh, wimaxasncp_dict_t *d) {
wimaxasncp_dict_tlv_t *tlvp;
fprintf(fh,"\n");
for (tlvp = d->tlvs; tlvp; tlvp = tlvp->next) {
wimaxasncp_dict_enum_t *e;
fprintf(fh,"TLV: %s[%u] %s[%d] %s (since %u)\n",
tlvp->name ? tlvp->name : "-",
tlvp->type,
val_to_str(tlvp->decoder,
wimaxasncp_decode_type_vals,
"Unknown"),
tlvp->decoder,
tlvp->description ? tlvp->description : "",
tlvp->since);
for (e = tlvp->enums; e; e = e->next) {
fprintf(fh,"\tEnum: %s[%u]\n",
e->name ? e->name : "-",
e->code);
}
}
}
#ifdef TEST_WIMAXASNCP_DICT_STANDALONE
int main(int argc, char **argv) {
wimaxasncp_dict_t *d;
gchar *dname = NULL;
gchar *fname;
int i = 1;
switch (argc) {
case 3:
dname = argv[i++];
case 2:
fname = argv[i];
break;
default:
fprintf(stderr,"%s: usage [dictionary_dir] dictionary_filename\n",argv[0]);
return 1;
}
d = wimaxasncp_dict_scan(dname,fname,1,&dict_error);
if (dict_error)
{
printf("wimaxasncp - %s", dict_error);
g_free(dict_error);
}
wimaxasncp_dict_print(stdout, d);
return 0;
}
#endif |
|
wireshark/plugins/epan/wimaxmacphy/AUTHORS | Initial development commissioned by Mobile Metrics - http://mobilemetrics.net/
Authors :
Stephen Croll <[email protected]> |
|
Text | wireshark/plugins/epan/wimaxmacphy/CMakeLists.txt | # CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <[email protected]>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
include(WiresharkPlugin)
# Plugin name and version info (major minor micro extra)
set_module_info(wimaxmacphy 0 0 1 0)
set(DISSECTOR_SRC
packet-wimaxmacphy.c
)
set(PLUGIN_FILES
plugin.c
${DISSECTOR_SRC}
)
set_source_files_properties(
${PLUGIN_FILES}
PROPERTIES
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
)
register_plugin_files(plugin.c
plugin
${DISSECTOR_SRC}
)
add_wireshark_plugin_library(wimaxmacphy epan)
target_link_libraries(wimaxmacphy epan)
install_plugin(wimaxmacphy epan)
file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
wimaxmacphy
SWITCHES
--group dissectors-prohibited
--group dissectors-restricted
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
)
#
# Editor modelines - https://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
# |
C | wireshark/plugins/epan/wimaxmacphy/packet-wimaxmacphy.c | /* packet-wimaxmacphy.c
* Routines for wimaxmacphy (WiMAX MAX PHY over Ethernet) packet dissection
* Copyright 2008, Mobile Metrics - http://mobilemetrics.net/
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
/* IF PROTO exposes code to other dissectors, then it must be exported
in a header file. If not, a header file is not needed at all. */
#include "packet-wimaxmacphy.h"
/* Initialize the protocol and registered fields */
static dissector_handle_t wimaxmacphy_handle;
static int proto_wimaxmacphy = -1;
static int hf_wimaxmacphy_hdr_phy_entity_id = -1;
static int hf_wimaxmacphy_hdr_message_segmentation = -1;
static int hf_wimaxmacphy_hdr_message_type = -1;
static int hf_wimaxmacphy_unknown = -1;
static int hf_wimaxmacphy_prim_length_of_txvector = -1;
static int hf_wimaxmacphy_prim_length_of_rxvector = -1;
static int hf_wimaxmacphy_prim_status = -1;
static int hf_wimaxmacphy_prim_txstart_indication_status = -1;
static int hf_wimaxmacphy_prim_reserved1 = -1;
static int hf_wimaxmacphy_prim_reserved2 = -1;
static int hf_wimaxmacphy_prim_reserved3 = -1;
static int hf_wimaxmacphy_prim_reserved4 = -1;
static int hf_wimaxmacphy_prim_reserved5 = -1;
static int hf_wimaxmacphy_prim_next_frame_number = -1;
static int hf_wimaxmacphy_prim_extended_frame_number = -1;
static int hf_wimaxmacphy_prim_current_frame_number_lsn = -1;
static int hf_wimaxmacphy_prim_initial_frame_number = -1;
static int hf_wimaxmacphy_prim_dl_zone_number = -1;
static int hf_wimaxmacphy_prim_sub_burst_burst_split_point = -1;
static int hf_wimaxmacphy_prim_dl_sub_burst_burst_number = -1;
static int hf_wimaxmacphy_prim_phy_sdu = -1;
static int hf_wimaxmacphy_prim_phy_request = -1;
static int hf_wimaxmacphy_prim_requested_aas_calibration_zone_size = -1;
static int hf_wimaxmacphy_prim_requested_aas_calibration_zone_alloc = -1;
static int hf_wimaxmacphy_prim_number_of_consecutive_frames_with_aas = -1;
static int hf_wimaxmacphy_prim_frame_number = -1;
static int hf_wimaxmacphy_prim_issid = -1;
static int hf_wimaxmacphy_prim_integrity = -1;
static int hf_wimaxmacphy_prim_number_of_bytes_received = -1;
static int hf_wimaxmacphy_prim_rssi_per_subcarrier_level = -1;
static int hf_wimaxmacphy_prim_cinr = -1;
static int hf_wimaxmacphy_prim_power_offset = -1;
static int hf_wimaxmacphy_prim_current_frame_number_msn = -1;
static int hf_wimaxmacphy_prim_acid_for_harq_data_bursts = -1;
static int hf_wimaxmacphy_prim_indication_type = -1;
static int hf_wimaxmacphy_prim_zone_permutation_type = -1;
static int hf_wimaxmacphy_prim_update_aas_handle_in_mac = -1;
static int hf_wimaxmacphy_prim_aas_handle = -1;
static int hf_wimaxmacphy_prim_time_deviation = -1;
static int hf_wimaxmacphy_prim_frequency_deviation = -1;
static int hf_wimaxmacphy_prim_phy_aas_report_present = -1;
static int hf_wimaxmacphy_prim_number_of_affected_ss = -1;
static int hf_wimaxmacphy_prim_zonexid = -1;
static int hf_wimaxmacphy_prim_cdma_code = -1;
static int hf_wimaxmacphy_prim_cdma_symbol = -1;
static int hf_wimaxmacphy_prim_cdma_subchannel = -1;
static int hf_wimaxmacphy_prim_harq_ack_issid = -1;
static int hf_wimaxmacphy_prim_harq_ack_acid = -1;
static int hf_wimaxmacphy_prim_harq_ack_reserved1 = -1;
static int hf_wimaxmacphy_prim_harq_ack_ack_valid = -1;
static int hf_wimaxmacphy_prim_harq_ack_unnamed = -1;
static int hf_wimaxmacphy_prim_harq_ack_reserved2 = -1;
static int hf_wimaxmacphy_prim_fast_issid = -1;
static int hf_wimaxmacphy_prim_fast_cqich_id = -1;
static int hf_wimaxmacphy_prim_fast_feedback_type_coding = -1;
static int hf_wimaxmacphy_prim_fast_feedback_type_coding_bit0 = -1;
static int hf_wimaxmacphy_prim_fast_feedback_type_coding_bit1 = -1;
static int hf_wimaxmacphy_prim_fast_feedback_type_coding_bit2 = -1;
static int hf_wimaxmacphy_prim_fast_feedback_type_coding_bit3 = -1;
static int hf_wimaxmacphy_prim_fast_feedback_type_coding_bit4 = -1;
static int hf_wimaxmacphy_prim_fast_feedback_type_coding_bit5 = -1;
static int hf_wimaxmacphy_prim_fast_feedback_type_coding_bit6 = -1;
static int hf_wimaxmacphy_prim_fast_feedback_type_coding_bit7 = -1;
static int hf_wimaxmacphy_prim_fast_feedback_valid = -1;
static int hf_wimaxmacphy_prim_fast_feedback_sub_type = -1;
static int hf_wimaxmacphy_prim_fast_reserved = -1;
static int hf_wimaxmacphy_prim_fast_feedback_value = -1;
static int hf_wimaxmacphy_subframe_subframe_type = -1;
static int hf_wimaxmacphy_subframe_frame_number = -1;
static int hf_wimaxmacphy_subframe_downlink_reserved1 = -1;
static int hf_wimaxmacphy_subframe_phy_sap_version_number = -1;
static int hf_wimaxmacphy_subframe_downlink_reserved2 = -1;
static int hf_wimaxmacphy_subframe_allocation_start_time = -1;
static int hf_wimaxmacphy_number_of_zone_descriptors = -1;
static int hf_wimaxmacphy_zone_padding = -1;
static int hf_wimaxmacphy_dl_zone_type = -1;
static int hf_wimaxmacphy_ul_zone_type = -1;
static int hf_wimaxmacphy_zone_number = -1;
static int hf_wimaxmacphy_zone_start_symbol_offset = -1;
static int hf_wimaxmacphy_zone_end_symbol_offset = -1;
static int hf_wimaxmacphy_dl_zone_permutation_type = -1;
static int hf_wimaxmacphy_ul_zone_permutation_type = -1;
static int hf_wimaxmacphy_dl_zone_use_all_subchannels_indicator = -1;
static int hf_wimaxmacphy_ul_zone_use_all_subchannels_indicator = -1;
static int hf_wimaxmacphy_ul_zone_disable_pusc_subchannel_rotation = -1;
static int hf_wimaxmacphy_zone_dl_perm_base = -1;
static int hf_wimaxmacphy_zone_ul_perm_base = -1;
static int hf_wimaxmacphy_zone_prbs_id = -1;
static int hf_wimaxmacphy_zone_agc_range_extension = -1;
static int hf_wimaxmacphy_zone_dedicated_pilots = -1;
static int hf_wimaxmacphy_zone_reserved = -1;
static int hf_wimaxmacphy_zone_stc_type = -1;
static int hf_wimaxmacphy_zone_matrix_indicator = -1;
static int hf_wimaxmacphy_zone_midamble_presence = -1;
static int hf_wimaxmacphy_zone_midamble_boosting = -1;
static int hf_wimaxmacphy_zone_preamble_configuration = -1;
static int hf_wimaxmacphy_zone_sdma_supported_indication = -1;
static int hf_wimaxmacphy_zone_preamble_type = -1;
static int hf_wimaxmacphy_dl_zone_aas_reserved = -1;
static int hf_wimaxmacphy_ul_zone_aas_reserved = -1;
static int hf_wimaxmacphy_number_of_burst_descriptors = -1;
static int hf_wimaxmacphy_burst_padding = -1;
static int hf_wimaxmacphy_dl_burst_type = -1;
static int hf_wimaxmacphy_ul_burst_type = -1;
static int hf_wimaxmacphy_burst_type_extension = -1;
static int hf_wimaxmacphy_burst_number = -1;
static int hf_wimaxmacphy_burst_modulation_fec_code_type = -1;
static int hf_wimaxmacphy_burst_data_length = -1;
static int hf_wimaxmacphy_burst_ofdma_symbol_offset = -1;
static int hf_wimaxmacphy_burst_subchannel_offset = -1;
static int hf_wimaxmacphy_burst_boosting = -1;
static int hf_wimaxmacphy_burst_reserved = -1;
static int hf_wimaxmacphy_burst_repetition_coding_indication = -1;
static int hf_wimaxmacphy_burst_issid = -1;
static int hf_wimaxmacphy_burst_aas_handle = -1;
static int hf_wimaxmacphy_dl_burst_map_number_of_slots = -1;
static int hf_wimaxmacphy_dl_burst_map_reserved = -1;
static int hf_wimaxmacphy_dl_burst_normal_number_of_symbols = -1;
static int hf_wimaxmacphy_dl_burst_normal_number_of_subchannels = -1;
static int hf_wimaxmacphy_dl_burst_normal_aas_handle = -1;
static int hf_wimaxmacphy_ul_burst_normal_number_of_slots = -1;
static int hf_wimaxmacphy_ul_burst_normal_reserved = -1;
static int hf_wimaxmacphy_burst_papr_number_of_symbols = -1;
static int hf_wimaxmacphy_burst_papr_number_of_subchannels = -1;
static int hf_wimaxmacphy_burst_papr_reserved = -1;
static int hf_wimaxmacphy_ul_burst_papr_unnamed = -1;
static int hf_wimaxmacphy_ul_burst_harq_ack_number_of_symbols = -1;
static int hf_wimaxmacphy_ul_burst_harq_ack_number_of_subchannels = -1;
static int hf_wimaxmacphy_ul_burst_harq_ack_reserved = -1;
static int hf_wimaxmacphy_ul_burst_fast_number_of_symbols = -1;
static int hf_wimaxmacphy_ul_burst_fast_number_of_subchannels = -1;
static int hf_wimaxmacphy_ul_burst_fast_reserved = -1;
static int hf_wimaxmacphy_ul_burst_initial_number_of_symbols = -1;
static int hf_wimaxmacphy_ul_burst_initial_number_of_subchannels = -1;
static int hf_wimaxmacphy_ul_burst_initial_ranging_method = -1;
static int hf_wimaxmacphy_ul_burst_initial_reserved1 = -1;
static int hf_wimaxmacphy_ul_burst_initial_zone_xid = -1;
static int hf_wimaxmacphy_ul_burst_initial_reserved2 = -1;
static int hf_wimaxmacphy_ul_burst_periodic_number_of_symbols = -1;
static int hf_wimaxmacphy_ul_burst_periodic_number_of_subchannels = -1;
static int hf_wimaxmacphy_ul_burst_periodic_ranging_method = -1;
static int hf_wimaxmacphy_ul_burst_periodic_reserved1 = -1;
static int hf_wimaxmacphy_ul_burst_periodic_zone_xid = -1;
static int hf_wimaxmacphy_ul_burst_periodic_reserved2 = -1;
static int hf_wimaxmacphy_ul_burst_sounding_number_of_symbols = -1;
static int hf_wimaxmacphy_ul_burst_sounding_number_of_subchannels = -1;
static int hf_wimaxmacphy_ul_burst_sounding_type = -1;
static int hf_wimaxmacphy_ul_burst_sounding_separability_type = -1;
static int hf_wimaxmacphy_ul_burst_sounding_max_cyclic_shift_indx = -1;
static int hf_wimaxmacphy_ul_burst_sounding_decimation_value = -1;
static int hf_wimaxmacphy_ul_burst_sounding_decimation_offset_rand = -1;
static int hf_wimaxmacphy_ul_burst_sounding_reserved = -1;
static int hf_wimaxmacphy_ul_burst_noise_number_of_symbols = -1;
static int hf_wimaxmacphy_ul_burst_noise_number_of_subchannels = -1;
static int hf_wimaxmacphy_ul_burst_noise_reserved = -1;
static int hf_wimaxmacphy_burst_opt_aas_preamble_modifier_type = -1;
static int hf_wimaxmacphy_burst_opt_aas_preamble_shift_index = -1;
static int hf_wimaxmacphy_burst_opt_aas_reserved = -1;
static int hf_wimaxmacphy_burst_opt_mimo_matrix_indicator = -1;
static int hf_wimaxmacphy_burst_opt_mimo_layer_index = -1;
static int hf_wimaxmacphy_dl_burst_opt_mimo_reserved = -1;
static int hf_wimaxmacphy_ul_burst_opt_mimo_matrix_indicator = -1;
static int hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns = -1;
static int hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns_bit0 = -1;
static int hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns_bit1 = -1;
static int hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns_bit2 = -1;
static int hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns_bit3 = -1;
static int hf_wimaxmacphy_ul_burst_opt_mimo_collaborative = -1;
static int hf_wimaxmacphy_ul_burst_opt_mimo_antenna_unnamed = -1;
static int hf_wimaxmacphy_number_of_sub_burst_descriptors = -1;
static int hf_wimaxmacphy_sub_burst_padding = -1;
static int hf_wimaxmacphy_dl_sub_burst_type = -1;
static int hf_wimaxmacphy_ul_sub_burst_type = -1;
static int hf_wimaxmacphy_sub_burst_number = -1;
static int hf_wimaxmacphy_sub_burst_symbol_offset = -1;
static int hf_wimaxmacphy_sub_burst_subchannel_offset = -1;
static int hf_wimaxmacphy_sub_burst_number_of_slots = -1;
static int hf_wimaxmacphy_sub_burst_reserved1 = -1;
static int hf_wimaxmacphy_sub_burst_reserved2 = -1;
static int hf_wimaxmacphy_sub_burst_modulation_fec_code_type = -1;
static int hf_wimaxmacphy_sub_burst_issid = -1;
static int hf_wimaxmacphy_sub_burst_aas_handle = -1;
static int hf_wimaxmacphy_sub_burst_boosting = -1;
static int hf_wimaxmacphy_sub_burst_repetition_coding_indication = -1;
static int hf_wimaxmacphy_sub_burst_data_length = -1;
static int hf_wimaxmacphy_sub_burst_harq_chase_harq_channel_id = -1;
static int hf_wimaxmacphy_sub_burst_harq_chase_harq_sequence_number = -1;
static int hf_wimaxmacphy_sub_burst_harq_chase_flush_unnamed = -1;
static int hf_wimaxmacphy_sub_burst_harq_chase_reserved = -1;
static int hf_wimaxmacphy_sub_burst_mimo_chase_harq_channel_id = -1;
static int hf_wimaxmacphy_sub_burst_mimo_chase_harq_sequence_number = -1;
static int hf_wimaxmacphy_sub_burst_mimo_chase_flush_unnamed = -1;
static int hf_wimaxmacphy_sub_burst_mimo_chase_layer_index = -1;
static int hf_wimaxmacphy_ul_sub_burst_ctype = -1;
static int hf_wimaxmacphy_ul_sub_burst_mini_subchannel_index = -1;
static int hf_wimaxmacphy_ul_sub_burst_mini_reserved = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_type_coding = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit0 = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit1 = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit2 = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit3 = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit4 = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit5 = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit6 = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit7 = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_reserved1 = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_sub_type = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_cqich_id = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_reserved2 = -1;
static int hf_wimaxmacphy_ul_sub_burst_feedback_slot_offset = -1;
static int hf_wimaxmacphy_ul_sub_burst_harq_ack_acid = -1;
static int hf_wimaxmacphy_ul_sub_burst_harq_ack_reserved = -1;
static int hf_wimaxmacphy_ul_sub_burst_sounding_symbol_index = -1;
static int hf_wimaxmacphy_ul_sub_burst_sounding_power_assignment = -1;
static int hf_wimaxmacphy_ul_sub_burst_sounding_power_boost = -1;
static int hf_wimaxmacphy_ul_sub_burst_sounding_allocation_mode = -1;
static int hf_wimaxmacphy_ul_sub_burst_sounding_start_freq_band = -1;
static int hf_wimaxmacphy_ul_sub_burst_sounding_num_freq_bands = -1;
static int hf_wimaxmacphy_ul_sub_burst_sounding_band_bit_map = -1;
static int hf_wimaxmacphy_ul_sub_burst_sounding_cyclic_time_shift = -1;
static int hf_wimaxmacphy_ul_sub_burst_sounding_decimation_offset = -1;
static int hf_wimaxmacphy_ul_sub_burst_sounding_reserved = -1;
static int hf_wimaxmacphy_ul_sub_burst_mimo_chase_matrix = -1;
/* Initialize the subtree pointers */
static gint ett_wimaxmacphy = -1;
static gint ett_wimaxmacphy_primitive = -1;
static gint ett_wimaxmacphy_prim_harq_ack = -1;
static gint ett_wimaxmacphy_prim_fast_feedback = -1;
static gint ett_wimaxmacphy_prim_fast_feedback_type_coding = -1;
static gint ett_wimaxmacphy_dl_zone_descriptor = -1;
static gint ett_wimaxmacphy_dl_zone_stc = -1;
static gint ett_wimaxmacphy_dl_zone_aas = -1;
static gint ett_wimaxmacphy_dl_burst_descriptor = -1;
static gint ett_wimaxmacphy_dl_burst_map = -1;
static gint ett_wimaxmacphy_dl_burst_normal = -1;
static gint ett_wimaxmacphy_dl_burst_papr = -1;
static gint ett_wimaxmacphy_dl_sub_burst_descriptor = -1;
static gint ett_wimaxmacphy_dl_sub_burst_harq_chase = -1;
static gint ett_wimaxmacphy_dl_sub_burst_mimo_chase = -1;
static gint ett_wimaxmacphy_dl_burst_opt_aas = -1;
static gint ett_wimaxmacphy_dl_burst_opt_mimo = -1;
static gint ett_wimaxmacphy_ul_zone_descriptor = -1;
static gint ett_wimaxmacphy_ul_zone_aas = -1;
static gint ett_wimaxmacphy_ul_burst_descriptor = -1;
static gint ett_wimaxmacphy_ul_burst_harq_ack = -1;
static gint ett_wimaxmacphy_ul_burst_fast_feedback = -1;
static gint ett_wimaxmacphy_ul_burst_initial_ranging = -1;
static gint ett_wimaxmacphy_ul_burst_periodic_ranging = -1;
static gint ett_wimaxmacphy_ul_burst_papr_safety_zone = -1;
static gint ett_wimaxmacphy_ul_burst_sounding_zone = -1;
static gint ett_wimaxmacphy_ul_burst_noise_floor = -1;
static gint ett_wimaxmacphy_ul_burst_normal_data = -1;
static gint ett_wimaxmacphy_ul_burst_opt_aas = -1;
static gint ett_wimaxmacphy_ul_burst_opt_mimo = -1;
static gint ett_wimaxmacphy_ul_sub_burst_descriptor = -1;
static gint ett_wimaxmacphy_ul_pilot_patterns = -1;
static gint ett_wimaxmacphy_ul_feedback_type_coding = -1;
static gint ett_wimaxmacphy_ul_sub_burst_mini_subchannel = -1;
static gint ett_wimaxmacphy_ul_sub_burst_fast_feedback = -1;
static gint ett_wimaxmacphy_ul_sub_burst_harq_ack = -1;
static gint ett_wimaxmacphy_ul_sub_burst_sounding_signal = -1;
static gint ett_wimaxmacphy_ul_sub_burst_harq_chase = -1;
static gint ett_wimaxmacphy_ul_sub_burst_mimo_chase = -1;
static gint ett_wimaxmacphy_ul_sub_burst_sub_allocation_specific = -1;
static expert_field ei_wimaxmacphy_unknown = EI_INIT;
/* PHY SAP message header size */
#define WIMAXMACPHY_HEADER_SIZE 2
#define WIMAXMACPHY_BIT(n) (1 << (n))
#define WIMAXMACPHY_PHY_TXSTART_REQUEST 1
#define WIMAXMACPHY_PHY_TXSTART_CONFIRMATION 2
#define WIMAXMACPHY_PHY_TXSTART_INDICATION 3
#define WIMAXMACPHY_PHY_TXSDU_REQUEST 4
#define WIMAXMACPHY_PHY_TXSDU_CONFIRMATION 5
#define WIMAXMACPHY_PHY_TXEND_INDICATION 6
#define WIMAXMACPHY_PHY_RXSTART_REQUEST 7
#define WIMAXMACPHY_PHY_RXSTART_CONFIRMATION 8
#define WIMAXMACPHY_PHY_RXSTART_INDICATION 9
#define WIMAXMACPHY_PHY_RXSDU_INDICATION 10
#define WIMAXMACPHY_PHY_RXEND_INDICATION 11
#define WIMAXMACPHY_PHY_RXCDMA_INDICATION 15
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_message_segmentation_vals[] =
{
{ 0x00, "Middle segment of the message segment sequence"},
{ 0x01, "Last segment of the message segment sequence"},
{ 0x02, "First segment of the message segment sequence"},
{ 0x03, "The entire message is contained in this segment"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_message_type_vals[] =
{
{ 0, "Reserved"},
{ 1, "PHY_TXSTART.request"},
{ 2, "PHY_TXSTART.confirmation"},
{ 3, "PHY_TXSTART.indication"},
{ 4, "PHY_TXSDU.request"},
{ 5, "PHY_TXSDU.confirmation"},
{ 6, "PHY_TXEND.indication"},
{ 7, "PHY_RXSTART.request"},
{ 8, "PHY_RXSTART.confirmation"},
{ 9, "PHY_RXSTART.indication"},
{ 10, "PHY_RXSDU.indication"},
{ 11, "PHY_RXEND.indication"},
{ 12, "Reserved (OFDM)"},
{ 13, "Reserved (OFDM)"},
{ 14, "Reserved (OFDM)"},
{ 15, "PHY_RXCDMA.indication"},
{ 16, "Reserved (OFDMA SS)"},
{ 17, "Reserved (OFDMA SS)"},
{ 0, NULL}
};
#if 0 /* XXX: 'tshark -G values' gives warning on Windows' */
static value_string_ext wimaxmacphy_message_type_vals_ext = VALUE_STRING_EXT_INIT(wimaxmacphy_message_type_vals);
#endif
/* ------------------------------------------------------------------------- */
/* error code field coding, for all but TXSTART.indication
*/
static const value_string wimaxmacphy_prim_status_vals[]=
{
{ 0, "Success"},
{ 1, "Primitive is not supported"},
{ 2, "FEC code type is not supported"},
{ 3, "Overrun"},
{ 4, "Underrun"},
{ 5, "Transport Media Error"},
{ 6, "TX data size do not match TXVECTOR"},
{ 7, "Invalid RX/TX VECTOR format"},
{ 0, NULL}
};
/* ---------------------------------------------------------------------------
* error code field coding, TXSTART.indication specific, delta is description
* for value 1
*/
static const value_string wimaxmacphy_prim_txstart_indication_status_vals[]=
{
{ 0, "Success"},
{ 1, "Restart flag"},
{ 2, "FEC code type is not supported"},
{ 3, "Overrun"},
{ 4, "Underrun"},
{ 5, "Transport Media Error"},
{ 6, "TX data size do not match TXVECTOR"},
{ 7, "Invalid RX/TX VECTOR format"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
#if 0
static const value_string wimaxmacphy_prim_sub_burst_burst_split_point_vals[]=
{
{ 0x00, "all 10 bits for burst number"},
{ 0x01, "1 bit sub-burst and 9 bits burst number"},
{ 0x02, "2 bit sub-burst and 8 bits burst number"},
{ 0x03, "3 bit sub-burst and 7 bits burst number"},
{ 0x04, "4 bit sub-burst and 6 bits burst number"},
{ 0x05, "5 bit sub-burst and 5 bits burst number"},
{ 0x06, "6 bit sub-burst and 4 bits burst number"},
{ 0x07, "7 bit sub-burst and 3 bits burst number"},
{ 0, NULL}
};
#endif
/* ------------------------------------------------------------------------- */
#if 0
static const value_string wimaxmacphy_prim_phy_request_vals[]=
{
{ 0x0, "LW 1 not present"},
{ 0x1, "AAS calibration request present in LW 1"},
{ 0, NULL}
};
#endif
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_prim_integrity_vals[]=
{
{ 0, "valid data"},
{ 1, "invalid data"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_prim_indication_type_vals[]=
{
{ 0, "Data burst"},
{ 1, "HARQ ACK channel"},
{ 2, "Fast Feedback Channel"},
{ 3, "HARQ data burst"},
{ 4, "MIMO data burst"},
{ 5, "MIMO HARQ data burst"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_prim_zone_permutation_type_vals[]=
{
{ 0x0, "PUSC"},
{ 0x1, "Optional PUSC"},
{ 0x2, "AMC - 1 x 6"},
{ 0x3, "AMC - 2 x 3"},
{ 0x4, "AMC - 3 x 2"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_prim_phy_aas_report_present_vals[]=
{
{ 0x0, " not present (only LW 0 is significant)"},
{ 0x1, "AAS info aged out report present"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_prim_harq_ack_ack_valid_vals[]=
{
{ 0, "valid data"},
{ 1, "invalid data"},
{ 0, NULL}
};
static const true_false_string set_notset = {
"Set",
"Not set"
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_prim_harq_ack_unnamed_vals[]=
{
{ 0, "ACK"},
{ 1, "NAK"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_prim_fast_feedback_valid_vals[]=
{
{ 0, "valid data"},
{ 1, "invalid data"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static
const value_string wimaxmacphy_prim_fast_feedback_sub_type_vals[]=
{
{ 0, "CQI (CINR) measurement"},
{ 1, "Control feedback"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_subframe_type_vals[]=
{
{ 1, "Downlink Subframe"},
{ 2, "Uplink Subframe"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_dl_zone_type_vals[]=
{
{ 0x20, "Normal Zone Parameters"},
{ 0x21, "STC Zone Parameters"},
{ 0x22, "AAS Zone Parameters"},
{ 0x23, "Common Sync Symbol Parameters"},
{ 0x24, "AAS Calibration Zone"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_ul_zone_type_vals[]=
{
{ 0x20, "Normal Zone Parameters"},
{ 0x21, "Reserved"},
{ 0x22, "AAS Zone Parameters"},
{ 0x23, "Reserved"},
{ 0x24, "Reserved"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_dl_zone_permutation_type_vals[]=
{
{ 0x00, "PUSC"},
{ 0x01, "FUSC"},
{ 0x02, "Optional FUSC"},
{ 0x03, "AMC - 1 x 6"},
{ 0x04, "AMC - 2 x 3"},
{ 0x05, "AMC - 3 x 2"},
{ 0x06, "TUSC1"},
{ 0x07, "TUSC2"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_ul_zone_permutation_type_vals[]=
{
{ 0x00, "PUSC"},
{ 0x01, "FUSC"},
{ 0x02, "Optional FUSC"},
{ 0x03, "AMC - 1 x 6"},
{ 0x04, "AMC - 2 x 3"},
{ 0x05, "AMC - 3 x 2"},
{ 0x06, "Reserved"},
{ 0x07, "Reserved"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static
const value_string wimaxmacphy_zone_use_all_subchannels_indicator_vals[]=
{
{ 0, "use only subchannels specified in PHY configuration register"},
{ 1, "use all subchannels"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static
const value_string wimaxmacphy_ul_zone_disable_pusc_subchannel_rotation_vals[]=
{
{ 0, "rotation enabled"},
{ 1, "rotation disabled"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_zone_dedicated_pilots_vals[]=
{
{ 0, "pilots are broadcast"},
{ 1, "pilots are dedicated"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_zone_agc_range_extension_vals[]=
{
{ 0, "default range"},
{ 1, "range to cover SS very close to BS"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_zone_stc_type_vals[]=
{
{ 0x00, "STC using 2 antennas"},
{ 0x01, "STC using 3 antennas"},
{ 0x02, "STC using 4 antennas"},
{ 0x03, "FHDC using 2 antennas"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_matrix_indicator_vals[]=
{
{ 0x00, "Matrix A"},
{ 0x01, "Matrix B"},
{ 0x02, "Matrix C"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_zone_midamble_presence_vals[]=
{
{ 0, "not present"},
{ 1, "present"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_zone_midamble_boosting_vals[]=
{
{ 0, "no boosting"},
{ 1, "boosting"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_zone_preamble_configuration_vals[]=
{
{ 0x00, "0 symbols (preambles not supported)"},
{ 0x01, "1 symbol"},
{ 0x02, "2 symbols"},
{ 0x03, "3 symbols"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_zone_sdma_supported_indication_vals[]=
{
{ 0, "SDMA not supported"},
{ 1, "SDMA supported"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_zone_preamble_type_vals[]=
{
{ 0, "frequency shifted preamble"},
{ 1, "time shifted preamble"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_dl_burst_type_vals[]=
{
{ 0x40, "Map Data Burst"},
{ 0x41, "Normal Data Burst"},
{ 0x42, "Control Command"},
{ 0x43, "PAPR Allocation"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_ul_burst_type_vals[]=
{
{ 0x40, "HARQ ACK Channel allocation"},
{ 0x41, "Fast Feedback Channel allocation"},
{ 0x42, "Initial Ranging/Handover Ranging region"},
{ 0x43, "Periodic Ranging/Bandwidth Request region"},
{ 0x44, "PAPR/Safety Zone allocation"},
{ 0x45, "Sounding Zone allocation"},
{ 0x46, "Noise Floor Calculation allocation"},
{ 0x47, "Normal Data burst"},
{ 0x48, "Control Command"},
{ 0x49, "Reserved"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_burst_type_extension_vals[]=
{
{ 0x00, "no extended data:"},
{ 0x01, "AAS v1"},
{ 0x02, "MIMO v1"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_modulation_fec_code_type_vals[]=
{
{ 0, "QPSK (CC) 1/2"},
{ 1, "QPSK (CC) 3/4"},
{ 2, "16-QAM (CC) 1/2"},
{ 3, "16-QAM (CC) 3/4"},
{ 4, "64-QAM (CC) 1/2"},
{ 5, "64-QAM (CC) 2/3"},
{ 6, "64-QAM (CC) 3/4"},
{ 7, "QPSK (BTC) 1/2"},
{ 8, "QPSK (BTC) 3/4"},
{ 9, "16-QAM (BTC) 3/5"},
{ 10, "16-QAM (BTC) 4/5"},
{ 11, "64-QAM (BTC) 5/8"},
{ 12, "64-QAM (BTC) 4/5"},
{ 13, "QPSK (CTC) 1/2"},
{ 14, "Reserved"},
{ 15, "QPSK (CTC) 3/4"},
{ 16, "16-QAM (CTC) 1/2"},
{ 17, "16-QAM (CTC) 3/4"},
{ 18, "64-QAM (CTC) 1/2"},
{ 19, "64-QAM (CTC) 2/3"},
{ 20, "64-QAM (CTC) 3/4"},
{ 21, "64-QAM (CTC) 5/6"},
{ 22, "QPSK (ZT CC) 1/2"},
{ 23, "QPSK (ZT CC) 3/4"},
{ 24, "16-QAM (ZT CC) 1/2"},
{ 25, "16-QAM (ZT CC) 3/4"},
{ 26, "64-QAM (ZT CC) 1/2"},
{ 27, "64-QAM (ZT CC) 2/3"},
{ 28, "64-QAM (ZT CC) 3/4"},
{ 29, "QPSK (LDPC) 1/2"},
{ 30, "QPSK (LDPC) 2/3 A code"},
{ 31, "QPSK (LDPC) 3/4 A code"},
{ 32, "16-QAM (LDPC) 1/2"},
{ 33, "16-QAM (LDPC) 2/3 A code"},
{ 34, "16-QAM (LDPC) 3/4 A code"},
{ 35, "64-QAM (LDPC) 1/2"},
{ 36, "64-QAM (LDPC) 2/3 A code"},
{ 37, "64-QAM (LDPC) 3/4 A code"},
{ 38, "QPSK (LDPC) 2/3 B code"},
{ 39, "QPSK (LDPC) 3/4 B code"},
{ 40, "16-QAM (LDPC) 2/3 B code"},
{ 41, "16-QAM (LDPC) 3/4 B code"},
{ 42, "64-QAM (LDPC) 2/3 B code"},
{ 43, "64-QAM (LDPC) 3/4 B code"},
{ 44, "QPSK (CC with optional interleaver) 1/2"},
{ 45, "QPSK (CC with optional interleaver) 3/4"},
{ 46, "16-QAM (CC with optional interleaver) 1/2"},
{ 47, "16-QAM (CC with optional interleaver) 3/4"},
{ 48, "64-QAM (CC with optional interleaver) 2/3"},
{ 49, "64-QAM (CC with optional interleaver) 3/4"},
{ 50, "QPSK (LDPC) 5/6"},
{ 51, "16-QAM(LDPC) 5/6"},
{ 52, "64-QAM(LDPC) 5/6"},
{ 0, NULL}
};
#if 0 /* XXX: 'tshark -G values' gives warning on Windows' */
static value_string_ext wimaxmacphy_modulation_fec_code_type_vals_ext =
VALUE_STRING_EXT_INIT(wimaxmacphy_modulation_fec_code_type_vals);
#endif
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_burst_boosting_vals[]=
{
{ 0x00, "normal"},
{ 0x01, "+6dB"},
{ 0x02, "-6dB"},
{ 0x03, "+9dB"},
{ 0x04, "+3dB"},
{ 0x05, "-3dB"},
{ 0x06, "-9 dB"},
{ 0x07, "-12 dB"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static
const value_string wimaxmacphy_burst_repetition_coding_indication_vals[]=
{
{ 0x00, "No repetition coding"},
{ 0x01, "Repetition coding of 2"},
{ 0x02, "Repetition coding of 4"},
{ 0x03, "Repetition coding of 6"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_dl_sub_burst_type_vals[]=
{
{ 0x60, "No HARQ"},
{ 0x61, "HARQ Chase Combining"},
{ 0x62, "HARQ IR-CTC"},
{ 0x63, "HARQ IR-CC"},
{ 0x64, "MIMO Chase Combining"},
{ 0x65, "MIMO IR-CTC"},
{ 0x66, "MIMO IR-CC"},
{ 0x67, "MIMO-STC"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_ul_sub_burst_type_vals[]=
{
{ 0x60, "No HARQ"},
{ 0x61, "HARQ Chase Combining"},
{ 0x62, "HARQ IR-CTC"},
{ 0x63, "HARQ IR-CC"},
{ 0x64, "MIMO Chase Combining"},
{ 0x65, "MIMO IR-CTC"},
{ 0x66, "MIMO IR-CC"},
{ 0x67, "MIMO-STC"},
{ 0x68, "Mini-subchannel"},
{ 0x69, "Fast Feedback channel"},
{ 0x6A, "HARQ ACK subchannel"},
{ 0x6B, "Sounding signal"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_sub_burst_flush_unnamed_vals[]=
{
{ 0x00, "no flush action"},
{ 0x02, "flush request to PHY for the ISSID/ACID"},
{ 0x03, "flush request to PHY for the given ISSID"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_ul_burst_papr_unnamed_vals[]=
{
{ 0, "UL PAPR reduction"},
{ 1, "UL Safety zone"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_ul_burst_ranging_method_vals[]=
{
{ 0, "ranging over 2 symbols"},
{ 1, "ranging over 4 symbols"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_ul_burst_sounding_type_vals[]=
{
{ 0, "Type A"},
{ 1, "Type B"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static
const value_string wimaxmacphy_ul_burst_sounding_separability_type_vals[]=
{
{ 0, "all subcarriers"},
{ 1, "decimated subcarriers in a band"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static
const value_string wimaxmacphy_ul_burst_sounding_max_cyclic_shift_indx_vals[]=
{
{ 0x00, "P=4"},
{ 0x01, "P=8;"},
{ 0x02, "P=16"},
{ 0x03, "P=32"},
{ 0x04, "P=9"},
{ 0x05, "P=18"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static
const value_string wimaxmacphy_ul_burst_sounding_decimation_offset_rand_vals[]=
{
{ 0, "no randomization"},
{ 1, "randomization"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static
const value_string wimaxmacphy_ul_burst_opt_mimo_matrix_indicator_vals[]=
{
{ 0x00, "Matrix A (STTD)"},
{ 0x01, "Matrix B (SM)"},
{ 0x02, "Reserved"},
{ 0x03, "Reserved"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_ul_burst_opt_mimo_collaborative_vals[]=
{
{ 0, "non-collaborative"},
{ 1, "collaborative"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_ul_burst_opt_mimo_antenna_unnamed_vals[]=
{
{ 0, "Single TX antenna SS"},
{ 1, "Dual TX antenna SS"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_ul_sub_burst_ctype_vals[]=
{
{ 0x00, "2 mini-subchannels adjacent tiles"},
{ 0x01, "2 mini subchannels interleaved tiles"},
{ 0x02, "3 mini subchannels"},
{ 0x03, "6 mini subchannels"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
#if 0
static const value_string wimaxmacphy_ul_sub_burst_feedback_sub_type_vals[]=
{
{ 0, "CQI (CINR) measurement"},
{ 1, "Control feedback"},
{ 0, NULL}
};
#endif
/* ------------------------------------------------------------------------- */
static
const value_string wimaxmacphy_ul_sub_burst_sounding_power_assignment_vals[]=
{
{ 0x00, "Equal power"},
{ 0x01, "Reserved"},
{ 0x02, "Interference dependent. Per subcarrier power limit."},
{ 0x03, "Interference dependent. Total power limit."},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_ul_sub_burst_sounding_power_boost_vals[]=
{
{ 0, "no boost"},
{ 1, "boost"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static
const value_string wimaxmacphy_ul_sub_burst_sounding_allocation_mode_vals[]=
{
{ 0, "Normal"},
{ 1, "Band AMC"},
{ 0, NULL}
};
/* ------------------------------------------------------------------------- */
static const value_string wimaxmacphy_ul_sub_burst_mimo_chase_matrix_vals[]=
{
{ 0, "Matrix A"},
{ 1, "Matrix B"},
{ 0, NULL}
};
static gint dissect_wimaxmacphy_dl_sub_burst_descriptor(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree)
{
guint start_offset = offset;
guint8 sub_burst_type;
proto_tree *subtree;
sub_burst_type = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_dl_sub_burst_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_symbol_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_subchannel_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_number_of_slots, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_reserved1, tvb, offset, 2, ENC_NA);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_reserved2, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_modulation_fec_code_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_issid, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_aas_handle, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_boosting, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_repetition_coding_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_data_length, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
/* sub-burst-specific parts */
switch (sub_burst_type)
{
case 0x61: /* HARQ chase combining */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_sub_burst_harq_chase, NULL, "HARQ Chase Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_harq_chase_harq_channel_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_harq_chase_harq_sequence_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_harq_chase_flush_unnamed, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_harq_chase_reserved, tvb, offset, 1, ENC_NA);
offset += 1;
break;
case 0x64: /* MIMO chase combining */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_sub_burst_mimo_chase, NULL, "MIMO Chase Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_mimo_chase_harq_channel_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_mimo_chase_harq_sequence_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_mimo_chase_flush_unnamed, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_mimo_chase_layer_index, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
break;
default:
/* do nothing */
break;
}
return offset - start_offset;
}
static guint dissect_wimaxmacphy_dl_burst_descriptor(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree)
{
guint start_offset = offset;
guint8 burst_type, burst_type_extension, sub_burst_descriptor_count, sub_burst;
proto_item *item;
proto_tree *subtree, *opt_tree;
burst_type = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_dl_burst_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
burst_type_extension = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_burst_type_extension, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_modulation_fec_code_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_data_length, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_ofdma_symbol_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_subchannel_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_boosting, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_repetition_coding_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
/* burst-specific parts */
switch (burst_type)
{
case 0x40: /* map */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_burst_map, NULL, "MAP Data Burst Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_dl_burst_map_number_of_slots, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(subtree, hf_wimaxmacphy_dl_burst_map_reserved, tvb, offset, 2, ENC_NA);
offset += 2;
break;
case 0x41: /* normal */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_burst_normal, NULL, "Normal Data Burst Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_dl_burst_normal_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_dl_burst_normal_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_dl_burst_normal_aas_handle, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* extensions */
switch (burst_type_extension)
{
case 0x01: /* AAS v1 */
opt_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_burst_opt_aas, NULL, "Optional AAS Specific");
proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_preamble_modifier_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_preamble_shift_index, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_reserved, tvb, offset, 2, ENC_NA);
offset += 2;
/* ??? Algorithm specific Information (per Burst Type extension) */
break;
case 0x02: /* MIMO v1 */
opt_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_burst_opt_mimo, NULL, "Optional MIMO Specific");
proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_mimo_matrix_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_mimo_layer_index, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_dl_burst_opt_mimo_reserved, tvb, offset, 2, ENC_NA);
offset += 2;
/* ??? Algorithm specific Information (per Burst Type extension) */
break;
default:
/* do nothing */
break;
}
break;
case 0x43: /* PAPR */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_burst_papr, NULL, "PAPR Allocation Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_reserved, tvb, offset, 2, ENC_NA);
offset += 2;
break;
default:
/* do nothing */
break;
}
/* sub-burst portion */
sub_burst_descriptor_count = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_number_of_sub_burst_descriptors, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_padding, tvb, offset, 3, ENC_NA);
offset += 3;
/* sub-burst descriptors */
for (sub_burst = 0; sub_burst < sub_burst_descriptor_count; ++sub_burst)
{
proto_tree *sub_burst_descriptor_tree;
guint sub_burst_descriptor_length;
sub_burst_descriptor_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1,
ett_wimaxmacphy_dl_sub_burst_descriptor, &item, "Sub-Burst Descriptor %u", sub_burst);
sub_burst_descriptor_length = dissect_wimaxmacphy_dl_sub_burst_descriptor(tvb, offset,
pinfo, sub_burst_descriptor_tree);
proto_item_set_len(item, sub_burst_descriptor_length);
offset += sub_burst_descriptor_length;
}
return offset - start_offset;
}
static guint dissect_wimaxmacphy_dl_zone_descriptor(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree)
{
guint start_offset = offset;
guint8 zone_type, burst_descriptor_count, burst;
proto_item *item;
proto_tree *subtree;
zone_type = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_dl_zone_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_start_symbol_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_end_symbol_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_dl_zone_permutation_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_dl_zone_use_all_subchannels_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_dl_perm_base, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_prbs_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_dedicated_pilots, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_reserved, tvb, offset, 3, ENC_NA);
offset += 3;
/* zone-specific parts */
switch (zone_type)
{
case 0x21: /* STC */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_zone_stc, NULL, "STC Zone Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_zone_stc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_zone_matrix_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_zone_midamble_presence, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_zone_midamble_boosting, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
break;
case 0x22: /* AAS */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_dl_zone_aas, NULL, "AAS Zone Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_zone_preamble_configuration, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_zone_sdma_supported_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_dl_zone_aas_reserved, tvb, offset, 2, ENC_NA);
offset += 2;
/* ??? Algorithm Specific Information (per Zone Type) */
break;
default:
/* do nothing */
break;
}
/* burst portion */
burst_descriptor_count = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_number_of_burst_descriptors, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_padding, tvb, offset, 3, ENC_NA);
offset += 3;
/* burst descriptors */
for (burst = 0; burst < burst_descriptor_count; ++burst)
{
proto_tree *burst_descriptor_tree;
guint burst_descriptor_length;
/* note: we'll adjust the length later */
burst_descriptor_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1,
ett_wimaxmacphy_dl_burst_descriptor, &item, "Burst Descriptor %u", burst);
burst_descriptor_length = dissect_wimaxmacphy_dl_burst_descriptor(
tvb, offset, pinfo, burst_descriptor_tree);
proto_item_set_len(item, burst_descriptor_length);
offset += burst_descriptor_length;
}
return offset - start_offset;
}
static guint dissect_wimaxmacphy_dl_subframe_descriptor(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree)
{
guint start_offset = offset;
guint8 zone_descriptor_count;
guint8 zone;
proto_tree_add_item(tree, hf_wimaxmacphy_subframe_subframe_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_subframe_frame_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_subframe_downlink_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_subframe_phy_sap_version_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_subframe_downlink_reserved2, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
/* zone portion */
zone_descriptor_count = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_number_of_zone_descriptors, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_number_of_zone_descriptors, tvb, offset, 3, ENC_BIG_ENDIAN);
offset += 3;
/* zone descriptors */
for (zone = 0; zone < zone_descriptor_count; ++zone)
{
proto_item *item;
proto_tree *zone_descriptor_tree;
guint zone_descriptor_length;
zone_descriptor_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1, ett_wimaxmacphy_dl_zone_descriptor, &item, "Zone Descriptor %u", zone);
zone_descriptor_length = dissect_wimaxmacphy_dl_zone_descriptor(
tvb, offset, pinfo, zone_descriptor_tree);
proto_item_set_len(item, zone_descriptor_length);
offset += zone_descriptor_length;
}
return offset - start_offset;
}
static gint dissect_wimaxmacphy_ul_sub_burst_sub_allocation_specific_part(tvbuff_t *tvb, guint offset,
packet_info *pinfo _U_, proto_tree *tree, guint8 sub_burst_type)
{
guint start_offset = offset;
proto_item *item, *opt_item;
proto_tree *subtree, *opt_tree;
subtree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_wimaxmacphy_ul_sub_burst_sub_allocation_specific, &item, "Sub-Allocation Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_symbol_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_subchannel_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_number_of_slots, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_data_length, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_repetition_coding_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_modulation_fec_code_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_sub_burst_reserved1, tvb, offset, 2, ENC_NA);
offset += 2;
/* HARQ chase and MIMO chase specific parts */
switch (sub_burst_type)
{
case 0x61: /* HARQ chase combining */
opt_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_sub_burst_harq_chase, &opt_item, "HARQ Chase Specific");
proto_tree_add_item(opt_tree, hf_wimaxmacphy_sub_burst_harq_chase_harq_channel_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_sub_burst_harq_chase_harq_sequence_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_sub_burst_harq_chase_flush_unnamed, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_sub_burst_harq_chase_reserved, tvb, offset, 1, ENC_NA);
offset += 1;
break;
case 0x64: /* MIMO chase combining */
opt_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_sub_burst_mimo_chase, NULL, "MIMO Chase Specific");
proto_tree_add_item(opt_tree, hf_wimaxmacphy_sub_burst_mimo_chase_harq_channel_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_sub_burst_mimo_chase_harq_sequence_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_sub_burst_mimo_chase_flush_unnamed, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_ul_sub_burst_mimo_chase_matrix, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
break;
default:
/* do nothing */
break;
}
proto_item_set_len(item, offset - start_offset);
return offset - start_offset;
}
static gint dissect_wimaxmacphy_ul_sub_burst_descriptor(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree)
{
guint8 sub_burst_type;
proto_item *feedback_item;
proto_tree *subtree, *feedback_tree;
guint start_offset = offset;
sub_burst_type = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_ul_sub_burst_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_issid, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_aas_handle, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_reserved1, tvb, offset, 2, ENC_NA);
offset += 2;
/* sub-burst-specific parts */
switch (sub_burst_type)
{
case 0x68: /* mini-subchannel */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_sub_burst_mini_subchannel, NULL, "Mini-Subchannel Allocation Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_ctype, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_mini_subchannel_index, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_mini_reserved, tvb, offset, 2, ENC_NA);
offset += 2;
break;
case 0x69: /* fast feedback */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_sub_burst_fast_feedback, NULL, "Fast Feedback Allocation Specific");
feedback_item = proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_feedback_type_coding, tvb, offset, 1, ENC_BIG_ENDIAN);
feedback_tree = proto_item_add_subtree(feedback_item, ett_wimaxmacphy_ul_feedback_type_coding);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit0, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit1, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit3, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit4, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit5, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit6, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit7, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_feedback_reserved1, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_feedback_sub_type, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_feedback_cqich_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_feedback_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_feedback_slot_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
break;
case 0x6a: /* HARQ ACK */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_sub_burst_harq_ack, NULL, "HARQ ACK Subchannel Allocation Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_harq_ack_acid, tvb, offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_harq_ack_reserved, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
break;
case 0x6b: /* sounding signal */
subtree = proto_tree_add_subtree(tree, tvb, offset, 11, ett_wimaxmacphy_ul_sub_burst_sounding_signal, NULL, "Sounding Signal Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_symbol_index, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_power_assignment, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_power_boost, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_allocation_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_start_freq_band, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_num_freq_bands, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_band_bit_map, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_cyclic_time_shift, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_decimation_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_sub_burst_sounding_reserved, tvb, offset, 1, ENC_NA);
offset += 1;
break;
default:
offset += dissect_wimaxmacphy_ul_sub_burst_sub_allocation_specific_part(
tvb, offset, pinfo, tree, sub_burst_type);
break;
}
return offset - start_offset;
}
static guint dissect_wimaxmacphy_ul_burst_descriptor(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree)
{
guint8 burst_type, burst_type_extension;
guint8 sub_burst_descriptor_count, sub_burst;
proto_item *item, *pilot_patterns_item;
proto_tree *subtree, *opt_tree, *pilot_patterns_tree;
guint start_offset = offset;
burst_type = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_ul_burst_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
burst_type_extension = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_burst_type_extension, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_modulation_fec_code_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_data_length, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_ofdma_symbol_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_subchannel_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_reserved, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_repetition_coding_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_issid, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_aas_handle, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* burst-specific parts */
switch (burst_type)
{
case 0x40: /* HARQ ACK channel */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_harq_ack, NULL, "HARQ ACK Channel Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_harq_ack_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_harq_ack_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_harq_ack_reserved, tvb, offset, 2, ENC_NA);
offset += 2;
break;
case 0x41: /* fast feedback channel */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_fast_feedback, NULL, "Fast Feedback Channel Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_fast_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_fast_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_fast_reserved, tvb, offset, 2, ENC_NA);
offset += 2;
break;
case 0x42: /* initial ranging/handover ranging */
subtree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_wimaxmacphy_ul_burst_initial_ranging, NULL, "Initial Ranging/Handover Ranging Allocation Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_ranging_method, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_reserved1, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_zone_xid, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_initial_reserved2, tvb, offset, 2, ENC_NA);
offset += 2;
break;
case 0x43: /* periodic ranging/bandwidth request */
subtree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_wimaxmacphy_ul_burst_periodic_ranging, NULL, "Periodic Ranging/Bandwidth Request Allocation Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_ranging_method, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_reserved1, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_zone_xid, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_periodic_reserved2, tvb, offset, 2, ENC_NA);
offset += 2;
break;
case 0x44: /* PAPR/safety zone */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_papr_safety_zone, NULL, "PAPR/Safety Zone Channel Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_papr_unnamed, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_burst_papr_reserved, tvb, offset, 1, ENC_NA);
offset += 1;
break;
case 0x45: /* sounding zone */
subtree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_wimaxmacphy_ul_burst_sounding_zone, NULL, "Sounding Zone Allocation Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_sounding_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_sounding_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_sounding_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_sounding_separability_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_sounding_max_cyclic_shift_indx, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_sounding_decimation_value, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_sounding_decimation_offset_rand, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_sounding_reserved, tvb, offset, 1, ENC_NA);
offset += 1;
break;
case 0x46: /* noise floor calculation */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_noise_floor, NULL, "Noise Floor Calculation Allocation Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_noise_number_of_symbols, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_noise_number_of_subchannels, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_noise_reserved, tvb, offset, 2, ENC_NA);
offset += 2;
break;
case 0x47: /* normal data */
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_normal_data, NULL, "Normal Data Burst Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_normal_number_of_slots, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_burst_normal_reserved, tvb, offset, 2, ENC_NA);
offset += 2;
/* extensions */
switch (burst_type_extension)
{
case 0x01: /* AAS v1 */
opt_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_opt_aas, NULL, "Optional AAS Specific");
proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_preamble_modifier_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_reserved, tvb, offset, 2, ENC_NA);
offset += 2;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_aas_preamble_shift_index, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
/* ??? Algorithm specific Information (per Burst Type extension) */
break;
case 0x02: /* MIMO v1 */
opt_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_burst_opt_mimo, NULL, "Optional MIMO Specific");
proto_tree_add_item(opt_tree, hf_wimaxmacphy_ul_burst_opt_mimo_matrix_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
/* optional MIMO-specific - pilot patterns */
pilot_patterns_item = proto_tree_add_item(opt_tree, hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns, tvb, offset, 1, ENC_BIG_ENDIAN);
pilot_patterns_tree = proto_item_add_subtree(pilot_patterns_item, ett_wimaxmacphy_ul_pilot_patterns);
proto_tree_add_item(pilot_patterns_tree, hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns_bit0, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(pilot_patterns_tree, hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns_bit1, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(pilot_patterns_tree, hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns_bit2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(pilot_patterns_tree, hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns_bit3, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_ul_burst_opt_mimo_collaborative, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(opt_tree, hf_wimaxmacphy_ul_burst_opt_mimo_antenna_unnamed, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(opt_tree, hf_wimaxmacphy_burst_opt_mimo_layer_index, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
/* ??? Algorithm specific Information (per Burst Type extension) */
break;
default:
/* do nothing */
break;
}
break;
default:
/* do nothing */
break;
}
/* sub-burst portion */
sub_burst_descriptor_count = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_number_of_sub_burst_descriptors, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_sub_burst_padding, tvb, offset, 3, ENC_NA);
offset += 3;
/* sub-burst descriptors */
for (sub_burst = 0; sub_burst < sub_burst_descriptor_count; ++sub_burst)
{
proto_tree *sub_burst_descriptor_tree;
guint sub_burst_descriptor_length;
sub_burst_descriptor_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1, ett_wimaxmacphy_ul_sub_burst_descriptor, &item, "Sub-Burst Descriptor %u", sub_burst);
sub_burst_descriptor_length = dissect_wimaxmacphy_ul_sub_burst_descriptor(tvb, offset,
pinfo, sub_burst_descriptor_tree);
proto_item_set_len(item, sub_burst_descriptor_length);
offset += sub_burst_descriptor_length;
}
return offset - start_offset;
}
static guint dissect_wimaxmacphy_ul_zone_descriptor(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree)
{
guint start_offset = offset;
guint8 zone_type, burst_descriptor_count, burst;
proto_item *item;
zone_type = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_ul_zone_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_start_symbol_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_end_symbol_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_ul_zone_permutation_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_ul_zone_use_all_subchannels_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_ul_zone_disable_pusc_subchannel_rotation, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_ul_perm_base, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_agc_range_extension, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
/* zone-specific parts */
switch (zone_type)
{
case 0x22: /* AAS */
{
proto_tree *subtree;
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_ul_zone_aas, NULL, "AAS Zone Specific");
proto_tree_add_item(subtree, hf_wimaxmacphy_zone_preamble_configuration, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_zone_preamble_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_zone_sdma_supported_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_ul_zone_aas_reserved, tvb, offset, 1, ENC_NA);
offset += 1;
/* ??? Algorithm Specific Information (per Zone Type) */
break;
}
default:
/* do nothing */
break;
}
/* burst portion */
burst_descriptor_count = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_number_of_burst_descriptors, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_burst_padding, tvb, offset, 3, ENC_NA);
offset += 3;
/* burst descriptors */
for (burst = 0; burst < burst_descriptor_count; ++burst)
{
proto_tree *burst_descriptor_tree;
guint burst_descriptor_length;
burst_descriptor_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1, ett_wimaxmacphy_ul_burst_descriptor, &item, "Burst Descriptor %u", burst);
burst_descriptor_length = dissect_wimaxmacphy_ul_burst_descriptor(
tvb, offset, pinfo, burst_descriptor_tree);
proto_item_set_len(item, burst_descriptor_length);
offset += burst_descriptor_length;
}
return offset - start_offset;
}
static guint dissect_wimaxmacphy_ul_subframe_descriptor(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree)
{
guint start_offset = offset;
guint8 zone_descriptor_count;
guint8 zone;
proto_tree_add_item(tree, hf_wimaxmacphy_subframe_subframe_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_subframe_frame_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_subframe_downlink_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_subframe_phy_sap_version_number, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_subframe_allocation_start_time, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
zone_descriptor_count = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_number_of_zone_descriptors, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_zone_padding, tvb, offset, 3, ENC_NA);
offset += 3;
/* -----------------------------------------------------------------------
* zone descriptors
* -----------------------------------------------------------------------
*/
for (zone = 0; zone < zone_descriptor_count; ++zone)
{
proto_item *item;
proto_tree *zone_descriptor_tree;
guint zone_descriptor_length;
zone_descriptor_tree = proto_tree_add_subtree_format(tree, tvb, offset, 1, ett_wimaxmacphy_ul_zone_descriptor, &item, "Zone Descriptor %u", zone);
zone_descriptor_length = dissect_wimaxmacphy_ul_zone_descriptor(
tvb, offset, pinfo, zone_descriptor_tree);
proto_item_set_len(item, zone_descriptor_length);
offset += zone_descriptor_length;
}
return offset - start_offset;
}
static guint dissect_wimaxmacphy_phy_txstart_request(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree)
{
guint16 txvector_length;
guint subframe_descriptor_length;
txvector_length = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_length_of_txvector, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
subframe_descriptor_length = dissect_wimaxmacphy_dl_subframe_descriptor(
tvb, offset, pinfo, tree);
offset += subframe_descriptor_length;
if (subframe_descriptor_length < txvector_length)
proto_tree_add_item(tree, hf_wimaxmacphy_unknown, tvb, offset, txvector_length - subframe_descriptor_length, ENC_NA);
return txvector_length + 2;
}
static guint dissect_wimaxmacphy_phy_txstart_confirmation(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree)
{
proto_tree_add_item(tree, hf_wimaxmacphy_prim_status, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_next_frame_number, tvb, offset, 1, ENC_BIG_ENDIAN);
/* offset += 1; */
return 2;
}
static guint dissect_wimaxmacphy_phy_txstart_indication(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree)
{
proto_tree_add_item(tree, hf_wimaxmacphy_prim_txstart_indication_status, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_extended_frame_number, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_current_frame_number_lsn, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_initial_frame_number, tvb, offset, 3, ENC_BIG_ENDIAN);
/* offset += 3; */
return 6;
}
static guint dissect_wimaxmacphy_phy_txsdu_request(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree)
{
guint length;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_dl_zone_number, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_sub_burst_burst_split_point, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_dl_sub_burst_burst_number, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
length = tvb_reported_length_remaining(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_phy_sdu, tvb, offset, length, ENC_NA);
return length + 2;
}
static guint dissect_wimaxmacphy_phy_txsdu_confirmation(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree)
{
proto_tree_add_item(tree, hf_wimaxmacphy_prim_dl_zone_number, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_sub_burst_burst_split_point, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_dl_sub_burst_burst_number, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved5, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_status, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_next_frame_number, tvb, offset, 1, ENC_BIG_ENDIAN);
/* offset += 1; */
return 6;
}
static guint dissect_wimaxmacphy_phy_txend_indication(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree)
{
proto_tree_add_item(tree, hf_wimaxmacphy_prim_status, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_phy_request, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_current_frame_number_lsn, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_requested_aas_calibration_zone_size, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_requested_aas_calibration_zone_alloc, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_number_of_consecutive_frames_with_aas, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved5, tvb, offset, 2, ENC_BIG_ENDIAN);
/* offset += 2; */
return 6;
}
static guint dissect_wimaxmacphy_phy_rxstart_request(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree)
{
guint16 rxvector_length;
guint subframe_descriptor_length;
rxvector_length = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_length_of_rxvector, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
subframe_descriptor_length = dissect_wimaxmacphy_ul_subframe_descriptor(
tvb, offset, pinfo, tree);
offset += subframe_descriptor_length;
/* check for unprocessed bytes */
if (subframe_descriptor_length < rxvector_length)
proto_tree_add_item(tree, hf_wimaxmacphy_unknown, tvb, offset, rxvector_length - subframe_descriptor_length, ENC_NA);
return rxvector_length + 2;
}
static guint dissect_wimaxmacphy_phy_rxstart_confirmation(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree)
{
proto_tree_add_item(tree, hf_wimaxmacphy_prim_status, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_frame_number, tvb, offset, 1, ENC_BIG_ENDIAN);
/* offset += 1; */
return 2;
}
static guint dissect_wimaxmacphy_phy_rxstart_indication(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree)
{
proto_tree_add_item(tree, hf_wimaxmacphy_prim_status, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_current_frame_number_lsn, tvb, offset, 1, ENC_BIG_ENDIAN);
/* offset += 1; */
return 2;
}
static guint dissect_wimaxmacphy_phy_rxsdu_indication(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree)
{
guint8 indication_type;
proto_item *feedback_item;
proto_tree *subtree, *feedback_tree;
guint length, start_offset = offset;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_issid, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_integrity, tvb, offset, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_number_of_bytes_received, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_rssi_per_subcarrier_level, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_cinr, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_power_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_current_frame_number_msn, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_acid_for_harq_data_bursts, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
indication_type = (tvb_get_guint8(tvb, offset) >> 4) & 0x0F;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_indication_type, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_zone_permutation_type, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_update_aas_handle_in_mac, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_aas_handle, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_time_deviation, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_frequency_deviation, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
switch (indication_type)
{
case 0: /* data burst */
{
length = tvb_reported_length_remaining(tvb, offset);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_phy_sdu, tvb, offset, length, ENC_NA);
offset += length;
break;
}
case 1: /* HARQ ACK */
{
subtree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_wimaxmacphy_prim_harq_ack, NULL, "HARQ ACK channel data format");
proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_issid, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_acid, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_ack_valid, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_unnamed, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_prim_harq_ack_reserved2, tvb, offset, 1, ENC_NA);
offset += 1;
break;
}
case 2: /* fast feedback */
{
subtree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_wimaxmacphy_prim_harq_ack, NULL, "Fast Feedback channel data format");
proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_issid, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_cqich_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
feedback_item = proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_feedback_type_coding, tvb, offset, 1, ENC_BIG_ENDIAN);
feedback_tree = proto_item_add_subtree(feedback_item, ett_wimaxmacphy_prim_fast_feedback_type_coding);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_prim_fast_feedback_type_coding_bit0, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_prim_fast_feedback_type_coding_bit1, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_prim_fast_feedback_type_coding_bit2, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_prim_fast_feedback_type_coding_bit3, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_prim_fast_feedback_type_coding_bit4, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_prim_fast_feedback_type_coding_bit5, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_prim_fast_feedback_type_coding_bit6, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(feedback_tree, hf_wimaxmacphy_prim_fast_feedback_type_coding_bit7, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_feedback_valid, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_feedback_sub_type, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_reserved, tvb, offset, 2, ENC_NA);
offset += 2;
proto_tree_add_item(subtree, hf_wimaxmacphy_prim_fast_feedback_value, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
break;
}
default:
break;
}
return offset - start_offset;
}
static guint dissect_wimaxmacphy_phy_rxend_indication(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree)
{
guint start_offset = offset;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_status, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_phy_aas_report_present, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_current_frame_number_lsn, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_number_of_affected_ss, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
do
{
/* list of ISSIDs (at least one required) */
proto_tree_add_item(tree, hf_wimaxmacphy_prim_issid, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
while (tvb_reported_length_remaining(tvb, offset));
return offset - start_offset;
}
static guint dissect_wimaxmacphy_phy_rxcdma_indication(tvbuff_t *tvb, guint offset, packet_info *pinfo _U_, proto_tree *tree)
{
guint start_offset = offset;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_zonexid, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_cdma_code, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_cdma_symbol, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved1, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_cdma_subchannel, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_rssi_per_subcarrier_level, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_cinr, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved3, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_power_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_current_frame_number_msn, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_wimaxmacphy_prim_reserved4, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_aas_handle, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_time_deviation, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(tree, hf_wimaxmacphy_prim_frequency_deviation, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
return offset - start_offset;
}
static int
dissect_wimaxmacphy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
/* Set up structures needed to add the protocol subtree and manage it */
proto_tree *wimaxmacphy_tree, *primitive_tree;
proto_item *item;
guint offset = 0;
guint8 message_type;
/* Ensure minimum size */
if (tvb_reported_length(tvb) < WIMAXMACPHY_HEADER_SIZE)
return 0;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "wimaxmacphy");
col_clear(pinfo->cinfo, COL_INFO);
item = proto_tree_add_item(tree, proto_wimaxmacphy, tvb, 0, -1, ENC_NA);
wimaxmacphy_tree = proto_item_add_subtree(item, ett_wimaxmacphy);
proto_tree_add_item(wimaxmacphy_tree, hf_wimaxmacphy_hdr_phy_entity_id,
tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(wimaxmacphy_tree, hf_wimaxmacphy_hdr_message_segmentation,
tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
message_type = tvb_get_guint8(tvb, offset);
item = proto_tree_add_item(wimaxmacphy_tree, hf_wimaxmacphy_hdr_message_type,
tvb, offset, 1, ENC_BIG_ENDIAN);
primitive_tree = proto_item_add_subtree(item, ett_wimaxmacphy_primitive);
#if 0
col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(message_type, &wimaxmacphy_message_type_vals_ext, "Unknown"));
#endif
col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(message_type, wimaxmacphy_message_type_vals, "Unknown"));
offset += 1;
switch(message_type)
{
case WIMAXMACPHY_PHY_TXSTART_REQUEST:
offset += dissect_wimaxmacphy_phy_txstart_request(
tvb, offset, pinfo, primitive_tree);
break;
case WIMAXMACPHY_PHY_TXSTART_CONFIRMATION:
offset += dissect_wimaxmacphy_phy_txstart_confirmation(
tvb, offset, pinfo, primitive_tree);
break;
case WIMAXMACPHY_PHY_TXSTART_INDICATION:
offset += dissect_wimaxmacphy_phy_txstart_indication(
tvb, offset, pinfo, primitive_tree);
break;
case WIMAXMACPHY_PHY_TXSDU_REQUEST:
offset += dissect_wimaxmacphy_phy_txsdu_request(
tvb, offset, pinfo, primitive_tree);
break;
case WIMAXMACPHY_PHY_TXSDU_CONFIRMATION:
offset += dissect_wimaxmacphy_phy_txsdu_confirmation(
tvb, offset, pinfo, primitive_tree);
break;
case WIMAXMACPHY_PHY_TXEND_INDICATION:
offset += dissect_wimaxmacphy_phy_txend_indication(
tvb, offset, pinfo, primitive_tree);
break;
case WIMAXMACPHY_PHY_RXSTART_REQUEST:
offset += dissect_wimaxmacphy_phy_rxstart_request(
tvb, offset, pinfo, primitive_tree);
break;
case WIMAXMACPHY_PHY_RXSTART_CONFIRMATION:
offset += dissect_wimaxmacphy_phy_rxstart_confirmation(
tvb, offset, pinfo, primitive_tree);
break;
case WIMAXMACPHY_PHY_RXSTART_INDICATION:
offset += dissect_wimaxmacphy_phy_rxstart_indication(
tvb, offset, pinfo, primitive_tree);
break;
case WIMAXMACPHY_PHY_RXSDU_INDICATION:
offset += dissect_wimaxmacphy_phy_rxsdu_indication(
tvb, offset, pinfo, primitive_tree);
break;
case WIMAXMACPHY_PHY_RXEND_INDICATION:
offset += dissect_wimaxmacphy_phy_rxend_indication(
tvb, offset, pinfo, primitive_tree);
break;
case WIMAXMACPHY_PHY_RXCDMA_INDICATION:
offset += dissect_wimaxmacphy_phy_rxcdma_indication(
tvb, offset, pinfo, primitive_tree);
break;
default:
proto_tree_add_item(primitive_tree, hf_wimaxmacphy_unknown,
tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_NA);
offset += tvb_reported_length_remaining(tvb, offset);
break;
}
if (tvb_reported_length_remaining(tvb, offset) > 0)
{
/* Incorporate any "extra" bytes */
item = proto_tree_add_item(wimaxmacphy_tree, hf_wimaxmacphy_unknown,
tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_NA);
expert_add_info(pinfo, item, &ei_wimaxmacphy_unknown);
}
return tvb_captured_length(tvb);
}
void
proto_register_wimaxmacphy(void)
{
static hf_register_info hf[] = {
{
&hf_wimaxmacphy_hdr_phy_entity_id,
{
"PHY entity ID",
"wimaxmacphy.hdr_phy_entity_id",
FT_UINT8,
BASE_DEC,
NULL,
0xfc,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_hdr_message_segmentation,
{
"Message Segmentation",
"wimaxmacphy.hdr_message_segmentation",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_message_segmentation_vals),
0x03,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_hdr_message_type,
{
"Message Type",
"wimaxmacphy.hdr_message_type",
FT_UINT8,
#if 0
BASE_HEX | BASE_EXT_STRING,
&wimaxmacphy_message_type_vals_ext,
#endif
BASE_HEX,
VALS(wimaxmacphy_message_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_unknown,
{
"Unknown(!)",
"wimaxmacphy.unknown_primitive",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_length_of_txvector,
{
"Length of TXVECTOR",
"wimaxmacphy.prim_length_of_txvector",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_length_of_rxvector,
{
"Length of RXVECTOR",
"wimaxmacphy.prim_length_of_rxvector",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_status,
{
"Status",
"wimaxmacphy.prim_status",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_prim_status_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_txstart_indication_status,
{
"Status",
"wimaxmacphy.prim_status",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_prim_txstart_indication_status_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_reserved1,
{
"Reserved",
"wimaxmacphy.prim_reserved1",
FT_UINT8,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_reserved2,
{
"Reserved",
"wimaxmacphy.prim_reserved2",
FT_UINT8,
BASE_HEX,
NULL,
0xF0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_reserved3,
{
"Reserved",
"wimaxmacphy.prim_reserved3",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_reserved4,
{
"Reserved",
"wimaxmacphy.prim_reserved4",
FT_UINT16,
BASE_HEX,
NULL,
0x0FFF,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_reserved5,
{
"Reserved",
"wimaxmacphy.prim_reserved5",
FT_UINT16,
BASE_HEX,
NULL,
0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_next_frame_number,
{
"Next Frame Number (lsb)",
"wimaxmacphy.prim_next_frame_number",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_extended_frame_number,
{
"Extended frame number",
"wimaxmacphy.prim_extended_frame_number",
FT_UINT8,
BASE_DEC,
NULL,
0xf0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_current_frame_number_lsn,
{
"Current Frame Number (lsb)",
"wimaxmacphy.prim_current_frame_number",
FT_UINT8,
BASE_DEC,
NULL,
0x0f,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_initial_frame_number,
{
"Initial Frame Number (from PHY)",
"wimaxmacphy.prim_initial_frame_number",
FT_UINT24,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_dl_zone_number,
{
"DL zone number",
"wimaxmacphy.prim_dl_zone_number",
FT_UINT16,
BASE_DEC,
NULL,
0xe000,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_sub_burst_burst_split_point,
{
"Sub-burst/burst split point",
"wimaxmacphy.prim_sub_burst_burst_split_point",
FT_UINT16,
BASE_DEC,
NULL,
0x1c00,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_dl_sub_burst_burst_number,
{
"DL sub-burst/burst number in this zone",
"wimaxmacphy.prim_dl_sub_burst_burst_number",
FT_UINT16,
BASE_DEC,
NULL,
0x03ff,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_phy_sdu,
{
"PHY SDU",
"wimaxmacphy.prim_phy_sdu",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_phy_request,
{
"PHY request (LW 1)",
"wimaxmacphy.prim_phy_request",
FT_UINT8,
BASE_HEX,
NULL,
0xf0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_requested_aas_calibration_zone_size,
{
"Requested AAS Calibration Zone size",
"wimaxmacphy.prim_requested_aas_calibration_zone_size",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_requested_aas_calibration_zone_alloc,
{
"Requested AAS Calibration Zone allocation deadline",
"wimaxmacphy.prim_requested_aas_calibration_zone_alloc",
FT_UINT8,
BASE_DEC,
NULL,
0xf0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_number_of_consecutive_frames_with_aas,
{
"Number of consecutive frames with AAS Calibration Zone allocation",
"wimaxmacphy.prim_number_of_consecutive_frames_with_aas",
FT_UINT8,
BASE_DEC,
NULL,
0x0f,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_frame_number,
{
"Frame Number (lsb)",
"wimaxmacphy.prim_frame_number",
FT_UINT8,
BASE_DEC,
NULL,
0x0f,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_issid,
{
"ISSID",
"wimaxmacphy.prim_issid",
FT_INT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_integrity,
{
"Integrity",
"wimaxmacphy.prim_integrity",
FT_UINT32,
BASE_DEC,
VALS(wimaxmacphy_prim_integrity_vals),
0x80000000,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_number_of_bytes_received,
{
"Number of bytes received",
"wimaxmacphy.prim_number_of_bytes_received",
FT_UINT32,
BASE_DEC,
NULL,
0x7fffffff,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_rssi_per_subcarrier_level,
{
"RSSI per subcarrier level",
"wimaxmacphy.prim_rssi_per_subcarrier_level",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_cinr,
{
"CINR",
"wimaxmacphy.prim_cinr",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_power_offset,
{
"Power Offset",
"wimaxmacphy.prim_power_offset",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_current_frame_number_msn,
{
"Current Frame Number (lsb)",
"wimaxmacphy.prim_current_frame_number",
FT_UINT16,
BASE_DEC,
NULL,
0x00f0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_acid_for_harq_data_bursts,
{
"ACID for HARQ data bursts",
"wimaxmacphy.prim_acid_for_harq_data_bursts",
FT_UINT16,
BASE_DEC,
NULL,
0x000f,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_indication_type,
{
"Indication Type",
"wimaxmacphy.prim_indication_type",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_prim_indication_type_vals),
0xf0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_zone_permutation_type,
{
"Zone Permutation Type",
"wimaxmacphy.prim_zone_permutation_type",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_prim_zone_permutation_type_vals),
0x0e,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_update_aas_handle_in_mac,
{
"Update AAS handle in MAC",
"wimaxmacphy.prim_update_aas_handle_in_mac",
FT_UINT8,
BASE_HEX,
NULL,
0x1,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_aas_handle,
{
"AAS Handle",
"wimaxmacphy.prim_aas_handle",
FT_UINT16,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_time_deviation,
{
"Time deviation in units of 1/Fs",
"wimaxmacphy.prim_time_deviation",
FT_INT32,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_frequency_deviation,
{
"Frequency deviation in Hz",
"wimaxmacphy.prim_frequency_deviation",
FT_INT32,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_harq_ack_issid,
{
"ISSID",
"wimaxmacphy.prim_harq_ack_issid",
FT_INT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_harq_ack_acid,
{
"ACID",
"wimaxmacphy.prim_harq_ack_acid",
FT_UINT8,
BASE_DEC,
NULL,
0xf0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_harq_ack_reserved1,
{
"Reserved",
"wimaxmacphy.prim_harq_ack_reserved1",
FT_UINT8,
BASE_HEX,
NULL,
0x0c,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_harq_ack_ack_valid,
{
"ACK Valid",
"wimaxmacphy.prim_harq_ack_ack_valid",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_prim_harq_ack_ack_valid_vals),
0x2,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_harq_ack_unnamed,
{
"Unnamed",
"wimaxmacphy.prim_harq_ack_unnamed",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_prim_harq_ack_unnamed_vals),
0x1,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_harq_ack_reserved2,
{
"Reserved",
"wimaxmacphy.prim_harq_ack_reserved2",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_issid,
{
"ISSID",
"wimaxmacphy.prim_fast_issid",
FT_INT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_cqich_id,
{
"CQICH_ID",
"wimaxmacphy.prim_fast_cqich_id",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_feedback_type_coding,
{
"Feedback type coding",
"wimaxmacphy.prim_fast_type_coding",
FT_UINT8,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_feedback_type_coding_bit0,
{
"3 bit-MIMO Fast-feedback",
"wimaxmacphy.prim_fast_type_coding.bit0",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x01,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_feedback_type_coding_bit1,
{
"Enhanced FAST_FEEDBACK",
"wimaxmacphy.prim_fast_type_coding.bit1",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x02,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_feedback_type_coding_bit2,
{
"Reserved",
"wimaxmacphy.prim_fast_type_coding.bit2",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x04,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_feedback_type_coding_bit3,
{
"Reserved",
"wimaxmacphy.prim_fast_type_coding.bit3",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x08,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_feedback_type_coding_bit4,
{
"UEP fast-feedback",
"wimaxmacphy.prim_fast_type_coding.bit4",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x10,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_feedback_type_coding_bit5,
{
"A measurement report performed on the last DL burst",
"wimaxmacphy.prim_fast_type_coding.bit5",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x20,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_feedback_type_coding_bit6,
{
"Primary/Secondary FAST_FEEDBACK",
"wimaxmacphy.prim_fast_type_coding.bit6",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x40,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_feedback_type_coding_bit7,
{
"DIUC-CQI Fast-feedback",
"wimaxmacphy.prim_fast_type_coding.bit7",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x80,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_feedback_valid,
{
"Feedback Valid",
"wimaxmacphy.prim_fast_feedback_valid",
FT_UINT16,
BASE_DEC,
VALS(wimaxmacphy_prim_fast_feedback_valid_vals),
0x8000,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_feedback_sub_type,
{
"Feedback sub-type",
"wimaxmacphy.prim_fast_feedback_sub_type",
FT_UINT16,
BASE_DEC,
VALS(wimaxmacphy_prim_fast_feedback_sub_type_vals),
0x7000,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_reserved,
{
"Reserved",
"wimaxmacphy.prim_fast_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_fast_feedback_value,
{
"Feedback value",
"wimaxmacphy.prim_fast_feedback_value",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_phy_aas_report_present,
{
"PHY AAS report present",
"wimaxmacphy.prim_phy_aas_report_present",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_prim_phy_aas_report_present_vals),
0xf0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_number_of_affected_ss,
{
"Number of affected SS",
"wimaxmacphy.prim_number_of_affected_ss",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_zonexid,
{
"ZoneXID",
"wimaxmacphy.prim_zonexid",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_cdma_code,
{
"CDMA code",
"wimaxmacphy.prim_cdma_code",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_cdma_symbol,
{
"CDMA symbol",
"wimaxmacphy.prim_cdma_symbol",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_prim_cdma_subchannel,
{
"CDMA subchannel",
"wimaxmacphy.prim_cdma_subchannel",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_subframe_subframe_type,
{
"Subframe Type",
"wimaxmacphy.subframe_subframe_type",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_subframe_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_subframe_frame_number,
{
"Frame Number",
"wimaxmacphy.subframe_frame_number",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_subframe_downlink_reserved1,
{
"Reserved",
"wimaxmacphy.subframe_downlink_reserved1",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_subframe_phy_sap_version_number,
{
"PHY SAP version number",
"wimaxmacphy.subframe_phy_sap_version_number",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_subframe_downlink_reserved2,
{
"Downlink reserved",
"wimaxmacphy.subframe_downlink_reserved2",
FT_UINT32,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_subframe_allocation_start_time,
{
"Allocation start time",
"wimaxmacphy.subframe_allocation_start_time",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_number_of_zone_descriptors,
{
"Number of Zone Descriptors",
"wimaxmacphy.number_of_zone_descriptors",
FT_UINT24,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_padding,
{
"Padding",
"wimaxmacphy.zone_padding",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_dl_zone_type,
{
"Zone Type",
"wimaxmacphy.zone_type",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_dl_zone_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_zone_type,
{
"Zone Type",
"wimaxmacphy.zone_type",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_ul_zone_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_number,
{
"Zone Number",
"wimaxmacphy.zone_number",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_start_symbol_offset,
{
"Start Symbol Offset",
"wimaxmacphy.zone_start_symbol_offset",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_end_symbol_offset,
{
"End Symbol Offset",
"wimaxmacphy.zone_end_symbol_offset",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_dl_zone_permutation_type,
{
"Permutation Type",
"wimaxmacphy.zone_permutation_type",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_dl_zone_permutation_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_zone_permutation_type,
{
"Permutation Type",
"wimaxmacphy.zone_permutation_type",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_ul_zone_permutation_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_dl_zone_use_all_subchannels_indicator,
{
"Use all subchannels indicator",
"wimaxmacphy.zone_use_all_subchannels_indicator",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_zone_use_all_subchannels_indicator_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_zone_use_all_subchannels_indicator,
{
"Use all subchannels indicator",
"wimaxmacphy.zone_use_all_subchannels_indicator",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_zone_use_all_subchannels_indicator_vals),
0xf0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_zone_disable_pusc_subchannel_rotation,
{
"Disable PUSC subchannel rotation",
"wimaxmacphy.zone_disable_pusc_subchannel_rotation",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_zone_disable_pusc_subchannel_rotation_vals),
0x0f,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_dl_perm_base,
{
"DL_PermBase",
"wimaxmacphy.zone_dl_perm_base",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_ul_perm_base,
{
"UL_PermBase",
"wimaxmacphy.zone_ul_perm_base",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_prbs_id,
{
"PRBS_ID",
"wimaxmacphy.zone_prbs_id",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_dedicated_pilots,
{
"Dedicated pilots",
"wimaxmacphy.zone_dedicated_pilots",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_zone_dedicated_pilots_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_agc_range_extension,
{
"Rx AGC range extension",
"wimaxmacphy.zone_agc_range_extension",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_zone_agc_range_extension_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_reserved,
{
"Reserved",
"wimaxmacphy.zone_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_stc_type,
{
"STC type",
"wimaxmacphy.zone_stc_type",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_zone_stc_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_matrix_indicator,
{
"Matrix Indicator",
"wimaxmacphy.zone_matrix_indicator",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_matrix_indicator_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_midamble_presence,
{
"Midamble presence",
"wimaxmacphy.zone_midamble_presence",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_zone_midamble_presence_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_midamble_boosting,
{
"Midamble boosting",
"wimaxmacphy.zone_midamble_boosting",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_zone_midamble_boosting_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_preamble_configuration,
{
"Preamble configuration",
"wimaxmacphy.zone_preamble_configuration",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_zone_preamble_configuration_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_sdma_supported_indication,
{
"SDMA supported indication",
"wimaxmacphy.zone_sdma_supported_indication",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_zone_sdma_supported_indication_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_zone_preamble_type,
{
"Preamble type",
"wimaxmacphy.zone_preamble_type",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_zone_preamble_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_dl_zone_aas_reserved,
{
"Reserved",
"wimaxmacphy.zone_aas_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_zone_aas_reserved,
{
"Reserved",
"wimaxmacphy.zone_aas_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_number_of_burst_descriptors,
{
"Number of Burst Descriptors",
"wimaxmacphy.number_of_burst_descriptors",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_padding,
{
"Padding",
"wimaxmacphy.burst_padding",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_dl_burst_type,
{
"Burst Type",
"wimaxmacphy.burst_type",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_dl_burst_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_type,
{
"Burst Type",
"wimaxmacphy.dl_burst_type",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_ul_burst_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_type_extension,
{
"Burst Type extension",
"wimaxmacphy.burst_type_extension",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_burst_type_extension_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_number,
{
"Burst Number",
"wimaxmacphy.burst_number",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_modulation_fec_code_type,
{
"Modulation/FEC Code Type",
"wimaxmacphy.burst_modulation_fec_code_type",
FT_UINT8,
#if 0
BASE_DEC | BASE_EXT_STRING,
&wimaxmacphy_modulation_fec_code_type_vals_ext,
#endif
BASE_DEC,
VALS(wimaxmacphy_modulation_fec_code_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_data_length,
{
"Burst Data Length",
"wimaxmacphy.burst_data_length",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_ofdma_symbol_offset,
{
"OFDMA Symbol offset",
"wimaxmacphy.burst_ofdma_symbol_offset",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_subchannel_offset,
{
"Subchannel offset",
"wimaxmacphy.burst_subchannel_offset",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_boosting,
{
"Boosting",
"wimaxmacphy.burst_boosting",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_burst_boosting_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_reserved,
{
"Reserved",
"wimaxmacphy.burst_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_repetition_coding_indication,
{
"Repetition coding indication",
"wimaxmacphy.burst_repetition_coding_indication",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_burst_repetition_coding_indication_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_issid,
{
"ISSID",
"wimaxmacphy.burst_issid",
FT_INT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_aas_handle,
{
"AAS Handle",
"wimaxmacphy.burst_aas_handle",
FT_UINT16,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_dl_burst_map_number_of_slots,
{
"Number of slots (duration) after repetition code is applied",
"wimaxmacphy.burst_map_number_of_slots",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_dl_burst_map_reserved,
{
"Reserved",
"wimaxmacphy.burst_map_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_dl_burst_normal_number_of_symbols,
{
"Number of Symbols",
"wimaxmacphy.burst_normal_number_of_symbols",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_dl_burst_normal_number_of_subchannels,
{
"Number of Subchannels",
"wimaxmacphy.burst_normal_number_of_subchannels",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_dl_burst_normal_aas_handle,
{
"AAS Handle",
"wimaxmacphy.burst_normal_aas_handle",
FT_UINT16,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_normal_number_of_slots,
{
"Number of slots",
"wimaxmacphy.burst_normal_number_of_slots",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_normal_reserved,
{
"Reserved",
"wimaxmacphy.burst_normal_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_papr_number_of_symbols,
{
"Number of Symbols",
"wimaxmacphy.burst_papr_number_of_symbols",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_papr_number_of_subchannels,
{
"Number of Subchannels",
"wimaxmacphy.burst_papr_number_of_subchannels",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_papr_reserved,
{
"Reserved",
"wimaxmacphy.burst_papr_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_papr_unnamed,
{
"Unnamed",
"wimaxmacphy.burst_papr_unnamed",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_burst_papr_unnamed_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_harq_ack_number_of_symbols,
{
"Number of Symbols",
"wimaxmacphy.burst_harq_ack_number_of_symbols",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_harq_ack_number_of_subchannels,
{
"Number of Subchannels",
"wimaxmacphy.burst_harq_ack_number_of_subchannels",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_harq_ack_reserved,
{
"Reserved",
"wimaxmacphy.burst_harq_ack_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_fast_number_of_symbols,
{
"Number of Symbols",
"wimaxmacphy.burst_fast_number_of_symbols",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_fast_number_of_subchannels,
{
"Number of Subchannels",
"wimaxmacphy.burst_fast_number_of_subchannels",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_fast_reserved,
{
"Reserved",
"wimaxmacphy.burst_fast_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_initial_number_of_symbols,
{
"Number of Symbols",
"wimaxmacphy.burst_initial_number_of_symbols",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_initial_number_of_subchannels,
{
"Number of Subchannels",
"wimaxmacphy.burst_initial_number_of_subchannels",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_initial_ranging_method,
{
"Ranging method",
"wimaxmacphy.burst_initial_ranging_method",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_burst_ranging_method_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_initial_reserved1,
{
"Reserved",
"wimaxmacphy.burst_initial_reserved1",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_initial_zone_xid,
{
"Zone XID",
"wimaxmacphy.burst_initial_zone_xid",
FT_UINT16,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_initial_reserved2,
{
"Reserved",
"wimaxmacphy.burst_initial_reserved2",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_periodic_number_of_symbols,
{
"Number of Symbols",
"wimaxmacphy.burst_periodic_number_of_symbols",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_periodic_number_of_subchannels,
{
"Number of Subchannels",
"wimaxmacphy.burst_periodic_number_of_subchannels",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_periodic_ranging_method,
{
"Ranging method",
"wimaxmacphy.burst_periodic_ranging_method",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_burst_ranging_method_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_periodic_reserved1,
{
"Reserved",
"wimaxmacphy.burst_periodic_reserved1",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_periodic_zone_xid,
{
"Zone XID",
"wimaxmacphy.burst_periodic_zone_xid",
FT_UINT16,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_periodic_reserved2,
{
"Reserved",
"wimaxmacphy.burst_periodic_reserved2",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_noise_number_of_symbols,
{
"Number of Symbols",
"wimaxmacphy.burst_noise_number_of_symbols",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_noise_number_of_subchannels,
{
"Number of Subchannels",
"wimaxmacphy.burst_noise_number_of_subchannels",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_noise_reserved,
{
"Reserved",
"wimaxmacphy.burst_noise_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_sounding_number_of_symbols,
{
"Number of Symbols",
"wimaxmacphy.burst_sounding_number_of_symbols",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_sounding_number_of_subchannels,
{
"Number of Subchannels",
"wimaxmacphy.burst_sounding_number_of_subchannels",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_sounding_type,
{
"Sounding type",
"wimaxmacphy.burst_sounding_type",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_burst_sounding_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_sounding_separability_type,
{
"Separability type",
"wimaxmacphy.burst_sounding_separability_type",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_burst_sounding_separability_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_sounding_max_cyclic_shift_indx,
{
"Max Cyclic Shift Indx",
"wimaxmacphy.burst_sounding_max_cyclic_shift_indx",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_burst_sounding_max_cyclic_shift_indx_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_sounding_decimation_value,
{
"Decimation value",
"wimaxmacphy.burst_sounding_decimation_value",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_sounding_decimation_offset_rand,
{
"Decimation offset randomization",
"wimaxmacphy.burst_sounding_decimation_offset_rand",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_burst_sounding_decimation_offset_rand_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_sounding_reserved,
{
"Reserved",
"wimaxmacphy.burst_sounding_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_opt_aas_preamble_modifier_type,
{
"Preamble Modifier Type",
"wimaxmacphy.burst_opt_aas_preamble_modifier_type",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_opt_aas_preamble_shift_index,
{
"Preamble Shift index",
"wimaxmacphy.burst_opt_aas_preamble_shift_index",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_opt_aas_reserved,
{
"Reserved",
"wimaxmacphy.burst_opt_aas_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_opt_mimo_matrix_indicator,
{
"Matrix indicator",
"wimaxmacphy.burst_opt_mimo_matrix_indicator",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_matrix_indicator_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_burst_opt_mimo_layer_index,
{
"Layer index",
"wimaxmacphy.burst_opt_mimo_layer_index",
FT_UINT8,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_dl_burst_opt_mimo_reserved,
{
"Reserved",
"wimaxmacphy.burst_opt_mimo_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_opt_mimo_matrix_indicator,
{
"Matrix indicator (dual antenna SS)",
"wimaxmacphy.burst_opt_mimo_matrix_indicator",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_ul_burst_opt_mimo_matrix_indicator_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns,
{
"Pilot patterns",
"wimaxmacphy.burst_opt_mimo_pilot_patterns",
FT_UINT8,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns_bit0,
{
"Pattern A",
"wimaxmacphy.burst_opt_mimo_pilot_patterns.A",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x01,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns_bit1,
{
"Pattern B",
"wimaxmacphy.burst_opt_mimo_pilot_patterns.B",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x02,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns_bit2,
{
"Pattern C",
"wimaxmacphy.burst_opt_mimo_pilot_patterns.C",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x04,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_opt_mimo_pilot_patterns_bit3,
{
"Pattern D",
"wimaxmacphy.burst_opt_mimo_pilot_patterns.D",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x08,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_opt_mimo_collaborative,
{
"Collaborative MIMO control",
"wimaxmacphy.burst_opt_mimo_collaborative",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_burst_opt_mimo_collaborative_vals),
0xf0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_burst_opt_mimo_antenna_unnamed,
{
"Antenna(?)",
"wimaxmacphy.burst_opt_mimo_antenna_unnamed",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_burst_opt_mimo_antenna_unnamed_vals),
0x0f,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_number_of_sub_burst_descriptors,
{
"Number of Sub-Burst Descriptors",
"wimaxmacphy.number_of_sub_burst_descriptors",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_padding,
{
"Padding",
"wimaxmacphy.sub_burst_padding",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_dl_sub_burst_type,
{
"Sub-Burst Type",
"wimaxmacphy.sub_burst_type",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_dl_sub_burst_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_type,
{
"Sub-Burst Type",
"wimaxmacphy.sub_burst_type",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_ul_sub_burst_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_number,
{
"Sub-Burst number",
"wimaxmacphy.sub_burst_number",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_symbol_offset,
{
"Symbol Offset",
"wimaxmacphy.sub_burst_symbol_offset",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_subchannel_offset,
{
"Subchannel Offset",
"wimaxmacphy.sub_burst_subchannel_offset",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_number_of_slots,
{
"Number of slots in this sub-burst",
"wimaxmacphy.sub_burst_number_of_slots",
FT_UINT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_reserved1,
{
"Reserved",
"wimaxmacphy.sub_burst_reserved1",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_reserved2,
{
"Reserved",
"wimaxmacphy.sub_burst_reserved2",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_modulation_fec_code_type,
{
"Modulation/FEC Code Type",
"wimaxmacphy.sub_burst_modulation_fec_code_type",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_modulation_fec_code_type_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_issid,
{
"ISSID",
"wimaxmacphy.sub_burst_issid",
FT_INT16,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_aas_handle,
{
"AAS Handle",
"wimaxmacphy.sub_burst_aas_handle",
FT_UINT16,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_boosting,
{
"Boosting",
"wimaxmacphy.sub_burst_boosting",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_burst_boosting_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_repetition_coding_indication,
{
"Repetition coding indication",
"wimaxmacphy.sub_burst_repetition_coding_indication",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_burst_repetition_coding_indication_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_data_length,
{
"Sub-Burst Data Length",
"wimaxmacphy.sub_burst_data_length",
FT_UINT32,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_harq_chase_harq_channel_id,
{
"HARQ channel id (ACID)",
"wimaxmacphy.sub_burst_harq_chase_harq_channel_id",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_harq_chase_harq_sequence_number,
{
"HARQ sequence number (AI_SN)",
"wimaxmacphy.sub_burst_harq_chase_harq_sequence_number",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_harq_chase_flush_unnamed,
{
"Flush(?)",
"wimaxmacphy.sub_burst_harq_chase_flush_unnamed",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_sub_burst_flush_unnamed_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_harq_chase_reserved,
{
"Reserved",
"wimaxmacphy.sub_burst_harq_chase_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_mimo_chase_harq_channel_id,
{
"HARQ channel id (ACID)",
"wimaxmacphy.sub_burst_mimo_chase_harq_channel_id",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_mimo_chase_harq_sequence_number,
{
"HARQ sequence number (AI_SN)",
"wimaxmacphy.sub_burst_mimo_chase_harq_sequence_number",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_mimo_chase_flush_unnamed,
{
"Flush(?)",
"wimaxmacphy.sub_burst_mimo_chase_flush_unnamed",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_sub_burst_flush_unnamed_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_sub_burst_mimo_chase_layer_index,
{
"Layer index",
"wimaxmacphy.sub_burst_mimo_chase_layer_index",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_ctype,
{
"CType",
"wimaxmacphy.sub_burst_ctype",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_ul_sub_burst_ctype_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_mini_subchannel_index,
{
"Mini-subchannel Index",
"wimaxmacphy.sub_burst_mini_subchannel_index",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_mini_reserved,
{
"Reserved",
"wimaxmacphy.sub_burst_mini_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_type_coding,
{
"Feedback type coding",
"wimaxmacphy.sub_burst_feedback_type_coding",
FT_UINT8,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit0,
{
"3 bit-MIMO Fast-feedback",
"wimaxmacphy.sub_burst_feedback_type_coding.bit0",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x01,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit1,
{
"Enhanced FAST_FEEDBACK",
"wimaxmacphy.sub_burst_feedback_type_coding.bit1",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x02,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit2,
{
"Reserved",
"wimaxmacphy.sub_burst_feedback_type_coding.bit2",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x04,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit3,
{
"Reserved",
"wimaxmacphy.sub_burst_feedback_type_coding.bit3",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x08,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit4,
{
"UEP fast-feedback",
"wimaxmacphy.sub_burst_feedback_type_coding.bit4",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x10,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit5,
{
"A measurement report performed on the last DL burst",
"wimaxmacphy.sub_burst_feedback_type_coding.bit5",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x20,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit6,
{
"Primary/Secondary FAST_FEEDBACK",
"wimaxmacphy.sub_burst_feedback_type_coding.bit6",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x40,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_type_coding_bit7,
{
"DIUC-CQI Fast-feedback",
"wimaxmacphy.sub_burst_feedback_type_coding.bit7",
FT_BOOLEAN,
8,
TFS(&set_notset),
0x80,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_reserved1,
{
"Reserved",
"wimaxmacphy.sub_burst_feedback_reserved1",
FT_UINT16,
BASE_DEC,
NULL,
0x8000,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_sub_type,
{
"Feedback sub-type",
"wimaxmacphy.sub_burst_feedback_sub_type",
FT_UINT16,
BASE_DEC,
NULL,
0x7000,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_cqich_id,
{
"CQICH_ID",
"wimaxmacphy.sub_burst_feedback_cqich_id",
FT_UINT16,
BASE_DEC,
NULL,
0x0fff,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_reserved2,
{
"Reserved",
"wimaxmacphy.sub_burst_feedback_reserved2",
FT_UINT8,
BASE_DEC,
NULL,
0xc0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_feedback_slot_offset,
{
"Slot offset",
"wimaxmacphy.sub_burst_feedback_slot_offset",
FT_UINT8,
BASE_DEC,
NULL,
0x3f,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_harq_ack_acid,
{
"ACID",
"wimaxmacphy.sub_burst_harq_ack_acid",
FT_UINT32,
BASE_DEC,
NULL,
0x000000f0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_harq_ack_reserved,
{
"Reserved",
"wimaxmacphy.sub_burst_harq_ack_reserved",
FT_UINT32,
BASE_HEX,
NULL,
0x00000fff,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_sounding_symbol_index,
{
"Sounding symbol index within Sounding zone",
"wimaxmacphy.sub_burst_sounding_symbol_index",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_sounding_power_assignment,
{
"Power assignment method",
"wimaxmacphy.sub_burst_sounding_power_assignment_method",
FT_UINT8,
BASE_HEX,
VALS(wimaxmacphy_ul_sub_burst_sounding_power_assignment_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_sounding_power_boost,
{
"Power boost",
"wimaxmacphy.sub_burst_sounding_power_boost",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_sub_burst_sounding_power_boost_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_sounding_allocation_mode,
{
"Allocation mode",
"wimaxmacphy.sub_burst_sounding_allocation_mode",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_sub_burst_sounding_allocation_mode_vals),
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_sounding_start_freq_band,
{
"Start frequency band",
"wimaxmacphy.sub_burst_sounding_start_freq_band",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_sounding_num_freq_bands,
{
"Number of frequency bands",
"wimaxmacphy.ub_burst_sounding_num_freq_bands",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_sounding_band_bit_map,
{
"Band bit map",
"wimaxmacphy.sub_burst_sounding_band_bit_map",
FT_UINT16,
BASE_HEX,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_sounding_cyclic_time_shift,
{
"Cyclic time shift index",
"wimaxmacphy.sub_burst_sounding_cyclic_time_shift_index",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_sounding_decimation_offset,
{
"Decimation offset",
"wimaxmacphy.sub_burst_sounding_decimation_offset",
FT_UINT8,
BASE_DEC,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_sounding_reserved,
{
"Reserved",
"wimaxmacphy.sub_burst_sounding_reserved",
FT_BYTES,
BASE_NONE,
NULL,
0x0,
NULL,
HFILL
}
},
{
&hf_wimaxmacphy_ul_sub_burst_mimo_chase_matrix,
{
"Matrix (dual antenna SS)",
"wimaxmacphy.sub_burst_mimo_chase_matrix",
FT_UINT8,
BASE_DEC,
VALS(wimaxmacphy_ul_sub_burst_mimo_chase_matrix_vals),
0x0,
NULL,
HFILL
}
}
};
/* Protocol subtree array */
static gint *ett[] = {
&ett_wimaxmacphy,
&ett_wimaxmacphy_primitive,
&ett_wimaxmacphy_prim_harq_ack,
&ett_wimaxmacphy_prim_fast_feedback,
&ett_wimaxmacphy_prim_fast_feedback_type_coding,
&ett_wimaxmacphy_dl_zone_descriptor,
&ett_wimaxmacphy_dl_zone_stc,
&ett_wimaxmacphy_dl_zone_aas,
&ett_wimaxmacphy_dl_burst_descriptor,
&ett_wimaxmacphy_dl_burst_map,
&ett_wimaxmacphy_dl_burst_normal,
&ett_wimaxmacphy_dl_burst_papr,
&ett_wimaxmacphy_dl_burst_opt_aas,
&ett_wimaxmacphy_dl_burst_opt_mimo,
&ett_wimaxmacphy_dl_sub_burst_descriptor,
&ett_wimaxmacphy_dl_sub_burst_harq_chase,
&ett_wimaxmacphy_dl_sub_burst_mimo_chase,
&ett_wimaxmacphy_ul_zone_descriptor,
&ett_wimaxmacphy_ul_zone_aas,
&ett_wimaxmacphy_ul_burst_descriptor,
&ett_wimaxmacphy_ul_burst_harq_ack,
&ett_wimaxmacphy_ul_burst_fast_feedback,
&ett_wimaxmacphy_ul_burst_initial_ranging,
&ett_wimaxmacphy_ul_burst_periodic_ranging,
&ett_wimaxmacphy_ul_burst_papr_safety_zone,
&ett_wimaxmacphy_ul_burst_sounding_zone,
&ett_wimaxmacphy_ul_burst_noise_floor,
&ett_wimaxmacphy_ul_burst_normal_data,
&ett_wimaxmacphy_ul_burst_opt_aas,
&ett_wimaxmacphy_ul_burst_opt_mimo,
&ett_wimaxmacphy_ul_sub_burst_descriptor,
&ett_wimaxmacphy_ul_sub_burst_mini_subchannel,
&ett_wimaxmacphy_ul_sub_burst_fast_feedback,
&ett_wimaxmacphy_ul_sub_burst_harq_ack,
&ett_wimaxmacphy_ul_sub_burst_sounding_signal,
&ett_wimaxmacphy_ul_sub_burst_harq_chase,
&ett_wimaxmacphy_ul_sub_burst_mimo_chase,
&ett_wimaxmacphy_ul_pilot_patterns,
&ett_wimaxmacphy_ul_feedback_type_coding,
&ett_wimaxmacphy_ul_sub_burst_sub_allocation_specific
};
static ei_register_info ei[] = {
{ &ei_wimaxmacphy_unknown, { "wimaxmacphy.unexpected_bytes", PI_MALFORMED, PI_ERROR, "Unexpected bytes", EXPFILL }},
};
expert_module_t* expert_wimaxmacphy;
/* Register the protocol name and description */
proto_wimaxmacphy = proto_register_protocol(
"WiMAX MAC-PHY over Ethernet",
"WiMAX MAC-PHY",
"wimaxmacphy");
wimaxmacphy_handle = register_dissector("wimaxmacphy", dissect_wimaxmacphy, proto_wimaxmacphy);
/* Required function calls to register the header fields and subtrees
* used */
proto_register_field_array(proto_wimaxmacphy, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_wimaxmacphy = expert_register_protocol(proto_wimaxmacphy);
expert_register_field_array(expert_wimaxmacphy, ei, array_length(ei));
}
void
proto_reg_handoff_wimaxmacphy(void)
{
dissector_add_for_decode_as_with_preference("udp.port", wimaxmacphy_handle);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/ |
C/C++ | wireshark/plugins/epan/wimaxmacphy/packet-wimaxmacphy.h | /*
* Routines for wimaxmacphy (WiMAX MAX SHY over Ethernet) packet dissection
* Copyright 2008, Mobile Metrics - http://mobilemetrics.net/
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef __PACKET_WIMAXASNCP_H__
#define __PACKET_WIMAXASNCP_H__
void proto_register_wimaxmacphy (void);
void proto_reg_handoff_wimaxmacphy(void);
#endif /* __PACKET_WIMAXASNCP_H__ */ |
Text | wireshark/plugins/wiretap/usbdump/CMakeLists.txt | # CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <[email protected]>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
include(WiresharkPlugin)
# Plugin name and version info (major minor micro extra)
set_module_info(usbdump 0 0 1 0)
set(WIRETAP_SRC
usbdump.c
)
set(PLUGIN_FILES
plugin.c
${WIRETAP_SRC}
)
set_source_files_properties(
${PLUGIN_FILES}
PROPERTIES
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
)
register_plugin_files(plugin.c
plugin_wtap
${WIRETAP_SRC}
)
add_wireshark_plugin_library(usbdump wiretap)
target_include_directories(usbdump PRIVATE ${CMAKE_SOURCE_DIR}/wiretap)
target_link_libraries(usbdump wiretap)
install_plugin(usbdump wiretap)
file(GLOB WIRETAP_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
usbdump
SWITCHES
SOURCES
${WIRETAP_SRC}
${WIRETAP_HEADERS}
)
#
# Editor modelines - https://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
# |
wireshark/plugins/wiretap/usbdump/README | This wiretap plugin serves a dual purpose. One is to add usbdump file
reading capability to wiretap and therefore Wireshark and Tshark.
Second it is an illustration of a basic wiretap plugin module. |
|
C | wireshark/plugins/wiretap/usbdump/usbdump.c | /* usbdump.c
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <[email protected]>
*
* File format support for usbdump file format
* Copyright (c) 2017 by Jaap Keuter <[email protected]>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
/*
* This wiretap is for an usbdump file format reader. The format is
* reverse engineered from FreeBSD source code.
*
* File format is little endian!
*
* Header
* ---------------------------------
* 0E 00 90 9A header magic
* 00 version major
* 03 version minor
* 00 00 00 00 00 00 00 00 reserved
* 00 00 00 00 00 00 00 00
* 00 00 00 00 00 00 00 00
* 00 00
*
* Frames
* ---------------------------------
* F0 26 00 00 length of multiframe read from bpf (9968 octets)
*
* Frame, bpf header (little endian)
* ---------------------------------
* DE 3F 0E 59 ts sec
* 6A 77 01 00 ts usec
* 98 00 00 00 capture length (152)
* 98 00 00 00 data length (152)
* 1C header length (28)
* 04 bpf word alignment size
* 00 00 00 00 00 00 00 00 padding
* 00 00
*
* Frame, captured data
* ---------------------------------
* 98 00 00 00 00 00 00 00 length, ....
*
*/
#include "config.h"
#include "wtap-int.h"
#include "file_wrappers.h"
#include "string.h"
void wtap_register_usbdump(void);
#define USBDUMP_MAGIC 0x9a90000e
/* Private data needed to read the file initially. */
typedef struct {
guint16 version;
guint32 multiframe_size;
gboolean multiframe_overrun;
} usbdump_info_t;
static gboolean usbdump_read(wtap *wth, wtap_rec *rec, Buffer *buf,
int *err, gchar **err_info,
gint64 *data_offset);
static gboolean usbdump_seek_read(wtap *wth, gint64 seek_off,
wtap_rec *rec, Buffer *buf,
int *err, gchar **err_info);
static gboolean usbdump_read_packet(wtap *wth, FILE_T fh,
wtap_rec *rec, Buffer *buf,
int *err, gchar **err_info);
static int usbdump_file_type_subtype;
/*
* Try to interpret a file as a usbdump formatted file.
* Read relevant parts of the given file and collect information needed to
* read the individual frames. Return value indicates whether or not this is
* recognized as an usbdump file.
*/
static wtap_open_return_val
usbdump_open(wtap *wth, int *err, char **err_info)
{
guint32 magic;
guint16 version;
guint32 multiframe_size;
usbdump_info_t *usbdump_info;
/* Read in the number that should be at the start of a "usbdump" file */
if (!wtap_read_bytes(wth->fh, &magic, sizeof magic, err, err_info)) {
if (*err != WTAP_ERR_SHORT_READ)
return WTAP_OPEN_ERROR;
return WTAP_OPEN_NOT_MINE;
}
/* Check the file magic */
if (GUINT32_FROM_LE(magic) != USBDUMP_MAGIC)
{
return WTAP_OPEN_NOT_MINE;
}
/* Read the version of the header */
if (!wtap_read_bytes(wth->fh, &version, sizeof version, err, err_info)) {
if (*err != WTAP_ERR_SHORT_READ)
return WTAP_OPEN_ERROR;
return WTAP_OPEN_NOT_MINE;
}
/* Check for the supported version number */
if (GUINT16_FROM_BE(version) != 3) {
/* We only support version 0.3 */
*err = WTAP_ERR_UNSUPPORTED;
*err_info = ws_strdup_printf("usbdump: version %u.%u unsupported",
version >> 8, version & 0xff);
return WTAP_OPEN_NOT_MINE;
}
/* Read the reserved field of the header */
if (!wtap_read_bytes(wth->fh, NULL, 26, err, err_info)) {
if (*err != WTAP_ERR_SHORT_READ)
return WTAP_OPEN_ERROR;
return WTAP_OPEN_NOT_MINE;
}
/* Read the initial multiframe size field */
if (!wtap_read_bytes(wth->fh, &multiframe_size, sizeof multiframe_size,
err, err_info)) {
if (*err != WTAP_ERR_SHORT_READ)
return WTAP_OPEN_ERROR;
return WTAP_OPEN_NOT_MINE;
}
/* Create a private structure to track the multiframe */
usbdump_info = g_new(usbdump_info_t, 1);
usbdump_info->version = GUINT16_FROM_BE(version);
usbdump_info->multiframe_size = GUINT32_FROM_LE(multiframe_size);
usbdump_info->multiframe_overrun = FALSE;
/*
* We are convinced this is a usbdump format file.
* Setup the wiretap structure and fill it with info of this format.
*/
wth->priv = (void *)usbdump_info;
wth->subtype_read = usbdump_read;
wth->subtype_seek_read = usbdump_seek_read;
wth->file_type_subtype = usbdump_file_type_subtype;
wth->file_encap = WTAP_ENCAP_USB_FREEBSD;
wth->file_tsprec = WTAP_TSPREC_USEC;
return WTAP_OPEN_MINE;
}
/*
* Sequential read with offset reporting.
* Read the next frame in the file and adjust for the multiframe size
* indication. Report back where reading of this frame started to
* support subsequent random access read.
*/
static gboolean
usbdump_read(wtap *wth, wtap_rec *rec, Buffer *buf, int *err, gchar **err_info,
gint64 *data_offset)
{
usbdump_info_t *usbdump_info = (usbdump_info_t *)wth->priv;
/* Report the current file location */
*data_offset = file_tell(wth->fh);
/* Try to read a packet worth of data */
if (!usbdump_read_packet(wth, wth->fh, rec, buf, err, err_info))
return FALSE;
/* Check if we overrun the multiframe during the last read */
if (usbdump_info->multiframe_overrun)
{
*err = WTAP_ERR_BAD_FILE;
*err_info = ws_strdup_printf("Multiframe overrun");
return FALSE;
}
/* See if we reached the end of the multiframe */
if (usbdump_info->multiframe_size == 0)
{
/*
* Try to read the subsequent multiframe size field.
* This will fail at end of file, but that is accepted.
*/
wtap_read_bytes_or_eof(wth->fh, &usbdump_info->multiframe_size,
sizeof usbdump_info->multiframe_size,
err, err_info);
}
return TRUE;
}
/*
* Random access read.
* Read the frame at the given offset in the file. Store the frame data
* in a buffer and fill in the packet header info.
*/
static gboolean
usbdump_seek_read(wtap *wth, gint64 seek_off, wtap_rec *rec,
Buffer *buf, int *err, gchar **err_info)
{
/* Seek to the desired file position at the start of the frame */
if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1)
return FALSE;
/* Try to read a packet worth of data */
if (!usbdump_read_packet(wth, wth->random_fh, rec, buf, err, err_info)) {
if (*err == 0)
*err = WTAP_ERR_SHORT_READ;
return FALSE;
}
return TRUE;
}
/*
* Read the actual frame data from the file.
* This requires reading the header, determine the size, read frame size worth
* of data into the buffer and setting the packet header fields to the values
* of the frame header.
*
* Also, for the sequential read, keep track of the position in the multiframe
* so that we can find the next multiframe size field.
*/
static gboolean
usbdump_read_packet(wtap *wth, FILE_T fh, wtap_rec *rec, Buffer *buf,
int *err, gchar **err_info)
{
usbdump_info_t *usbdump_info = (usbdump_info_t *)wth->priv;
guint8 bpf_hdr[18];
guint8 bpf_hdr_len, alignment;
/* Read the packet header */
if (!wtap_read_bytes_or_eof(fh, bpf_hdr, 18, err, err_info))
return FALSE;
/* Get sizes */
bpf_hdr_len = bpf_hdr[16];
alignment = bpf_hdr[17];
/* Check header length */
if (bpf_hdr_len > 18)
{
/* Read packet header padding */
if (!wtap_read_bytes_or_eof(fh, NULL, bpf_hdr_len - 18, err, err_info))
return FALSE;
}
/* Keep track of multiframe_size and detect overrun */
if (usbdump_info->multiframe_size < bpf_hdr_len) {
usbdump_info->multiframe_overrun = TRUE;
} else {
usbdump_info->multiframe_size -= bpf_hdr_len;
}
/* Setup the per packet structure and fill it with info from this frame */
rec->rec_type = REC_TYPE_PACKET;
rec->block = wtap_block_create(WTAP_BLOCK_PACKET);
rec->presence_flags = WTAP_HAS_TS | WTAP_HAS_CAP_LEN;
rec->ts.secs = (guint32)bpf_hdr[3] << 24 | (guint32)bpf_hdr[2] << 16 |
(guint32)bpf_hdr[1] << 8 | (guint32)bpf_hdr[0];
rec->ts.nsecs = ((guint32)bpf_hdr[7] << 24 | (guint32)bpf_hdr[6] << 16 |
(guint32)bpf_hdr[5] << 8 | (guint32)bpf_hdr[4]) * 1000;
rec->rec_header.packet_header.caplen = (guint32)bpf_hdr[11] << 24 | (guint32)bpf_hdr[10] << 16 |
(guint32)bpf_hdr[9] << 8 | (guint32)bpf_hdr[8];
rec->rec_header.packet_header.len = (guint32)bpf_hdr[15] << 24 | (guint32)bpf_hdr[14] << 16 |
(guint32)bpf_hdr[13] << 8 | (guint32)bpf_hdr[12];
/* Read the packet data */
if (!wtap_read_packet_bytes(fh, buf, rec->rec_header.packet_header.caplen, err, err_info))
return FALSE;
/* Keep track of multiframe_size and detect overrun */
if (usbdump_info->multiframe_size < rec->rec_header.packet_header.caplen) {
usbdump_info->multiframe_overrun = TRUE;
} else {
usbdump_info->multiframe_size -= rec->rec_header.packet_header.caplen;
}
/* Check for and apply alignment as defined in the frame header */
guint8 pad_len = (guint32)alignment -
(((guint32)bpf_hdr_len + rec->rec_header.packet_header.caplen) &
((guint32)alignment - 1));
if (pad_len < alignment) {
/* Read alignment from the file */
if (!wtap_read_bytes(fh, NULL, pad_len, err, err_info))
return FALSE;
/* Keep track of multiframe_size and detect overrun */
if (usbdump_info->multiframe_size < pad_len) {
usbdump_info->multiframe_overrun = TRUE;
} else {
usbdump_info->multiframe_size -= pad_len;
}
}
return TRUE;
}
/*
* Register with wiretap.
* Register how we can handle an unknown file to see if this is a valid
* usbdump file and register information about this file format.
*/
static const struct supported_block_type usbdump_blocks_supported[] = {
/* We support packet blocks, with no comments or other options. */
{ WTAP_BLOCK_PACKET, MULTIPLE_BLOCKS_SUPPORTED, NO_OPTIONS_SUPPORTED }
};
static const struct file_type_subtype_info fi = {
"FreeBSD USBDUMP",
"usbdump",
NULL,
NULL,
FALSE,
BLOCKS_SUPPORTED(usbdump_blocks_supported),
NULL,
NULL,
NULL
};
void
wtap_register_usbdump(void)
{
struct open_info oi = {
"FreeBSD usbdump",
OPEN_INFO_MAGIC,
usbdump_open,
NULL,
NULL,
NULL
};
wtap_register_open_info(&oi, FALSE);
usbdump_file_type_subtype = wtap_register_file_type_subtype(&fi);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/ |
Text | wireshark/randpkt_core/CMakeLists.txt | # CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <[email protected]>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
set(RANDPKT_CORE_SRC
randpkt_core.c
)
set_source_files_properties(
${RANDPKT_CORE_SRC}
PROPERTIES
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
)
file(GLOB RANDPKT_CORE_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" randpkt_core.h)
add_library(randpkt_core STATIC
${RANDPKT_CORE_SRC}
)
set_target_properties(randpkt_core PROPERTIES
LINK_FLAGS "${WS_LINK_FLAGS}"
FOLDER "Libs")
if(MSVC)
set_target_properties(randpkt_core PROPERTIES LINK_FLAGS_DEBUG "${WS_MSVC_DEBUG_LINK_FLAGS}")
endif()
target_link_libraries(randpkt_core PUBLIC ui)
CHECKAPI(
NAME
randpkt_core-base
SWITCHES
SOURCES
${RANDPKT_CORE_SRC}
${RANDPKT_CORE_HEADERS}
)
CHECKAPI(
NAME
randpkt_core-todo
SWITCHES
-M
SOURCES
${RANDPKT_CORE_SRC}
${RANDPKT_CORE_HEADERS}
)
#
# Editor modelines - https://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
# |
C | wireshark/randpkt_core/randpkt_core.c | /*
* randpkt_core.c
* ---------
* Creates random packet traces. Useful for debugging sniffers by testing
* assumptions about the veracity of the data found in the packet.
*
* Copyright (C) 1999 by Gilbert Ramirez <[email protected]>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <config.h>
#define WS_LOG_DOMAIN "randpkt"
#include "randpkt_core.h"
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <wsutil/file_util.h>
#include <wsutil/wslog.h>
#include <wiretap/wtap_opttypes.h>
#include "ui/failure_message.h"
#define array_length(x) (sizeof x / sizeof x[0])
#define INVALID_LEN 1
#define WRITE_ERROR 2
GRand *pkt_rand = NULL;
/* Types of produceable packets */
enum {
PKT_ARP,
PKT_BGP,
PKT_BVLC,
PKT_DNS,
PKT_ETHERNET,
PKT_FDDI,
PKT_GIOP,
PKT_ICMP,
PKT_IEEE802154,
PKT_IP,
PKT_IPv6,
PKT_LLC,
PKT_M2M,
PKT_MEGACO,
PKT_NBNS,
PKT_NCP2222,
PKT_SCTP,
PKT_SYSLOG,
PKT_TCP,
PKT_TDS,
PKT_TR,
PKT_UDP,
PKT_USB,
PKT_USB_LINUX
};
/* Ethernet, indicating ARP */
guint8 pkt_arp[] = {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00,
0x32, 0x25, 0x0f, 0xff,
0x08, 0x06
};
/* Ethernet+IP+UDP, indicating DNS */
guint8 pkt_dns[] = {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01,
0x08, 0x00,
0x45, 0x00, 0x00, 0x3c,
0xc5, 0x9e, 0x40, 0x00,
0xff, 0x11, 0xd7, 0xe0,
0xd0, 0x15, 0x02, 0xb8,
0x0a, 0x01, 0x01, 0x63,
0x05, 0xe8, 0x00, 0x35,
0xff, 0xff, 0x2a, 0xb9,
0x30
};
/* Ethernet+IP, indicating ICMP */
guint8 pkt_icmp[] = {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01,
0x08, 0x00,
0x45, 0x00, 0x00, 0x54,
0x8f, 0xb3, 0x40, 0x00,
0xfd, 0x01, 0x8a, 0x99,
0xcc, 0xfc, 0x66, 0x0b,
0xce, 0x41, 0x62, 0x12
};
/* Ethernet, indicating IP */
guint8 pkt_ip[] = {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01,
0x08, 0x00
};
/* Ethernet, indicating IPv6 */
guint8 pkt_ipv6[] = {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01,
0x86, 0xdd, 0x60
};
/* TR, indicating LLC */
guint8 pkt_llc[] = {
0x10, 0x40, 0x68, 0x00,
0x19, 0x69, 0x95, 0x8b,
0x00, 0x01, 0xfa, 0x68,
0xc4, 0x67
};
/* Ethernet, indicating WiMAX M2M */
guint8 pkt_m2m[] = {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00,
0x32, 0x25, 0x0f, 0xff,
0x08, 0xf0
};
/* Ethernet+IP+UDP, indicating NBNS */
guint8 pkt_nbns[] = {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01,
0x08, 0x00,
0x45, 0x00, 0x00, 0x3c,
0xc5, 0x9e, 0x40, 0x00,
0xff, 0x11, 0xd7, 0xe0,
0xd0, 0x15, 0x02, 0xb8,
0x0a, 0x01, 0x01, 0x63,
0x00, 0x89, 0x00, 0x89,
0x00, 0x00, 0x2a, 0xb9,
0x30
};
/* Ethernet+IP+UDP, indicating syslog */
guint8 pkt_syslog[] = {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01,
0x08, 0x00,
0x45, 0x00, 0x00, 0x64,
0x20, 0x48, 0x00, 0x00,
0xfc, 0x11, 0xf8, 0x03,
0xd0, 0x15, 0x02, 0xb8,
0x0a, 0x01, 0x01, 0x63,
0x05, 0xe8, 0x02, 0x02,
0x00, 0x50, 0x51, 0xe1,
0x3c
};
/* TR+LLC+IP, indicating TCP */
guint8 pkt_tcp[] = {
0x10, 0x40, 0x68, 0x00,
0x19, 0x69, 0x95, 0x8b,
0x00, 0x01, 0xfa, 0x68,
0xc4, 0x67,
0xaa, 0xaa, 0x03, 0x00,
0x00, 0x00, 0x08, 0x00,
0x45, 0x00, 0x00, 0x28,
0x0b, 0x0b, 0x40, 0x00,
0x20, 0x06, 0x85, 0x37,
0xc0, 0xa8, 0x27, 0x01,
0xc0, 0xa8, 0x22, 0x3c
};
/* Ethernet+IP, indicating UDP */
guint8 pkt_udp[] = {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01,
0x08, 0x00,
0x45, 0x00, 0x00, 0x3c,
0xc5, 0x9e, 0x40, 0x00,
0xff, 0x11, 0xd7, 0xe0,
0xd0, 0x15, 0x02, 0xb8,
0x0a, 0x01, 0x01, 0x63
};
/* Ethernet+IP+UDP, indicating BVLC */
guint8 pkt_bvlc[] = {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01,
0x08, 0x00,
0x45, 0x00, 0x00, 0x3c,
0xc5, 0x9e, 0x40, 0x00,
0xff, 0x11, 0x01, 0xaa,
0xc1, 0xff, 0x19, 0x1e,
0xc1, 0xff, 0x19, 0xff,
0xba, 0xc0, 0xba, 0xc0,
0x00, 0xff, 0x2d, 0x5e,
0x81
};
/* TR+LLC+IPX, indicating NCP, with NCP Type == 0x2222 */
guint8 pkt_ncp2222[] = {
0x10, 0x40, 0x00, 0x00,
0xf6, 0x7c, 0x9b, 0x70,
0x68, 0x00, 0x19, 0x69,
0x95, 0x8b, 0xe0, 0xe0,
0x03, 0xff, 0xff, 0x00,
0x25, 0x02, 0x11, 0x00,
0x00, 0x74, 0x14, 0x00,
0x00, 0x00, 0x00, 0x00,
0x01, 0x04, 0x51, 0x00,
0x00, 0x00, 0x04, 0x00,
0x02, 0x16, 0x19, 0x7a,
0x84, 0x40, 0x01, 0x22,
0x22
};
/* Ethernet+IP+TCP, indicating GIOP */
guint8 pkt_giop[] = {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01,
0x08, 0x00,
0x45, 0x00, 0x00, 0xa6,
0x00, 0x2f, 0x40, 0x00,
0x40, 0x06, 0x3c, 0x21,
0x7f, 0x00, 0x00, 0x01,
0x7f, 0x00, 0x00, 0x01,
0x30, 0x39, 0x04, 0x05,
0xac, 0x02, 0x1e, 0x69,
0xab, 0x74, 0xab, 0x64,
0x80, 0x18, 0x79, 0x60,
0xc4, 0xb8, 0x00, 0x00,
0x01, 0x01, 0x08, 0x0a,
0x00, 0x00, 0x48, 0xf5,
0x00, 0x00, 0x48, 0xf5,
0x47, 0x49, 0x4f, 0x50,
0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x30,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01,
0x01
};
/* Ethernet+IP+TCP, indicating BGP */
guint8 pkt_bgp[] = {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01,
0x08, 0x00,
0x45, 0x00, 0x00, 0xa6,
0x00, 0x2f, 0x40, 0x00,
0x40, 0x06, 0x3c, 0x21,
0x7f, 0x00, 0x00, 0x01,
0x7f, 0x00, 0x00, 0x01,
0x30, 0x39, 0x00, 0xb3,
0xac, 0x02, 0x1e, 0x69,
0xab, 0x74, 0xab, 0x64,
0x80, 0x18, 0x79, 0x60,
0xc4, 0xb8, 0x00, 0x00,
0x01, 0x01, 0x08, 0x0a,
0x00, 0x00, 0x48, 0xf5,
0x00, 0x00, 0x48, 0xf5,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
};
/* Ethernet+IP+TCP, indicating TDS NetLib */
guint8 pkt_tds[] = {
0x00, 0x50, 0x8b, 0x0d,
0x7a, 0xed, 0x00, 0x08,
0xa3, 0x98, 0x39, 0x81,
0x08, 0x00,
0x45, 0x00, 0x03, 0x8d,
0x90, 0xd4, 0x40, 0x00,
0x7c, 0x06, 0xc3, 0x1b,
0xac, 0x14, 0x02, 0x22,
0x0a, 0xc2, 0xee, 0x82,
0x05, 0x99, 0x08, 0xf8,
0xff, 0x4e, 0x85, 0x46,
0xa2, 0xb4, 0x42, 0xaa,
0x50, 0x18, 0x3c, 0x28,
0x0f, 0xda, 0x00, 0x00,
};
/* Ethernet+IP, indicating SCTP */
guint8 pkt_sctp[] = {
0x00, 0xa0, 0x80, 0x00,
0x5e, 0x46, 0x08, 0x00,
0x03, 0x4a, 0x00, 0x35,
0x08, 0x00,
0x45, 0x00, 0x00, 0x7c,
0x14, 0x1c, 0x00, 0x00,
0x3b, 0x84, 0x4a, 0x54,
0x0a, 0x1c, 0x06, 0x2b,
0x0a, 0x1c, 0x06, 0x2c,
};
/* Ethernet+IP+SCTP, indicating MEGACO */
guint8 pkt_megaco[] = {
0x00, 0xa0, 0x80, 0x00,
0x5e, 0x46, 0x08, 0x00,
0x03, 0x4a, 0x00, 0x35,
0x08, 0x00,
0x45, 0x00, 0x00, 0x7c,
0x14, 0x1c, 0x00, 0x00,
0x3b, 0x84, 0x4a, 0x54,
0x0a, 0x1c, 0x06, 0x2b,
0x0a, 0x1c, 0x06, 0x2c,
0x40, 0x00, 0x0b, 0x80,
0x00, 0x01, 0x6f, 0x0a,
0x6d, 0xb0, 0x18, 0x82,
0x00, 0x03, 0x00, 0x5b,
0x28, 0x02, 0x43, 0x45,
0x00, 0x00, 0xa0, 0xbd,
0x00, 0x00, 0x00, 0x07,
};
/* This little data table drives the whole program */
static randpkt_example examples[] = {
{ "arp", "Address Resolution Protocol",
PKT_ARP, WTAP_ENCAP_ETHERNET,
pkt_arp, array_length(pkt_arp),
NULL, 0,
NULL, NULL,
1000,
},
{ "bgp", "Border Gateway Protocol",
PKT_BGP, WTAP_ENCAP_ETHERNET,
pkt_bgp, array_length(pkt_bgp),
NULL, 0,
NULL, NULL,
1000,
},
{ "bvlc", "BACnet Virtual Link Control",
PKT_BVLC, WTAP_ENCAP_ETHERNET,
pkt_bvlc, array_length(pkt_bvlc),
NULL, 0,
NULL, NULL,
1000,
},
{ "dns", "Domain Name Service",
PKT_DNS, WTAP_ENCAP_ETHERNET,
pkt_dns, array_length(pkt_dns),
NULL, 0,
NULL, NULL,
1000,
},
{ "eth", "Ethernet",
PKT_ETHERNET, WTAP_ENCAP_ETHERNET,
NULL, 0,
NULL, 0,
NULL, NULL,
1000,
},
{ "fddi", "Fiber Distributed Data Interface",
PKT_FDDI, WTAP_ENCAP_FDDI,
NULL, 0,
NULL, 0,
NULL, NULL,
1000,
},
{ "giop", "General Inter-ORB Protocol",
PKT_GIOP, WTAP_ENCAP_ETHERNET,
pkt_giop, array_length(pkt_giop),
NULL, 0,
NULL, NULL,
1000,
},
{ "icmp", "Internet Control Message Protocol",
PKT_ICMP, WTAP_ENCAP_ETHERNET,
pkt_icmp, array_length(pkt_icmp),
NULL, 0,
NULL, NULL,
1000,
},
{ "ieee802.15.4", "IEEE 802.15.4",
PKT_IEEE802154, WTAP_ENCAP_IEEE802_15_4,
NULL, 0,
NULL, 0,
NULL, NULL,
127,
},
{ "ip", "Internet Protocol",
PKT_IP, WTAP_ENCAP_ETHERNET,
pkt_ip, array_length(pkt_ip),
NULL, 0,
NULL, NULL,
1000,
},
{ "ipv6", "Internet Protocol Version 6",
PKT_IPv6, WTAP_ENCAP_ETHERNET,
pkt_ipv6, array_length(pkt_ipv6),
NULL, 0,
NULL, NULL,
1000,
},
{ "llc", "Logical Link Control",
PKT_LLC, WTAP_ENCAP_TOKEN_RING,
pkt_llc, array_length(pkt_llc),
NULL, 0,
NULL, NULL,
1000,
},
{ "m2m", "WiMAX M2M Encapsulation Protocol",
PKT_M2M, WTAP_ENCAP_ETHERNET,
pkt_m2m, array_length(pkt_m2m),
NULL, 0,
NULL, NULL,
1000,
},
{ "megaco", "MEGACO",
PKT_MEGACO, WTAP_ENCAP_ETHERNET,
pkt_megaco, array_length(pkt_megaco),
NULL, 0,
NULL, NULL,
1000,
},
{ "nbns", "NetBIOS-over-TCP Name Service",
PKT_NBNS, WTAP_ENCAP_ETHERNET,
pkt_nbns, array_length(pkt_nbns),
NULL, 0,
NULL, NULL,
1000,
},
{ "ncp2222", "NetWare Core Protocol",
PKT_NCP2222, WTAP_ENCAP_TOKEN_RING,
pkt_ncp2222, array_length(pkt_ncp2222),
NULL, 0,
NULL, NULL,
1000,
},
{ "sctp", "Stream Control Transmission Protocol",
PKT_SCTP, WTAP_ENCAP_ETHERNET,
pkt_sctp, array_length(pkt_sctp),
NULL, 0,
NULL, NULL,
1000,
},
{ "syslog", "Syslog message",
PKT_SYSLOG, WTAP_ENCAP_ETHERNET,
pkt_syslog, array_length(pkt_syslog),
NULL, 0,
NULL, NULL,
1000,
},
{ "tds", "TDS NetLib",
PKT_TDS, WTAP_ENCAP_ETHERNET,
pkt_tds, array_length(pkt_tds),
NULL, 0,
NULL, NULL,
1000,
},
{ "tcp", "Transmission Control Protocol",
PKT_TCP, WTAP_ENCAP_TOKEN_RING,
pkt_tcp, array_length(pkt_tcp),
NULL, 0,
NULL, NULL,
1000,
},
{ "tr", "Token-Ring",
PKT_TR, WTAP_ENCAP_TOKEN_RING,
NULL, 0,
NULL, 0,
NULL, NULL,
1000,
},
{ "udp", "User Datagram Protocol",
PKT_UDP, WTAP_ENCAP_ETHERNET,
pkt_udp, array_length(pkt_udp),
NULL, 0,
NULL, NULL,
1000,
},
{ "usb-linux", "Universal Serial Bus with Linux specific header",
PKT_USB_LINUX, WTAP_ENCAP_USB_LINUX,
NULL, 0,
NULL, 0,
NULL, NULL,
1000,
},
};
guint randpkt_example_count(void)
{
return array_length(examples);
}
/* Find pkt_example record and return pointer to it */
randpkt_example* randpkt_find_example(int type)
{
int num_entries = array_length(examples);
int i;
for (i = 0; i < num_entries; i++) {
if (examples[i].produceable_type == type) {
return &examples[i];
}
}
fprintf(stderr, "randpkt: Internal error. Type %d has no entry in examples table.\n",
type);
return NULL;
}
void randpkt_loop(randpkt_example* example, guint64 produce_count, guint64 packet_delay_ms)
{
guint i, j;
int err;
guint len_random;
guint len_this_pkt;
gchar* err_info;
union wtap_pseudo_header* ps_header;
guint8* buffer;
wtap_rec* rec;
rec = g_new0(wtap_rec, 1);
buffer = (guint8*)g_malloc0(65536);
rec->rec_type = REC_TYPE_PACKET;
rec->presence_flags = WTAP_HAS_TS;
rec->rec_header.packet_header.pkt_encap = example->sample_wtap_encap;
ps_header = &rec->rec_header.packet_header.pseudo_header;
/* Load the sample pseudoheader into our pseudoheader buffer */
if (example->pseudo_buffer)
memcpy(ps_header, example->pseudo_buffer, example->pseudo_length);
/* Load the sample into our buffer */
if (example->sample_buffer)
memcpy(buffer, example->sample_buffer, example->sample_length);
/* Produce random packets */
for (i = 0; i < produce_count; i++) {
if (example->produce_max_bytes > 0) {
len_random = g_rand_int_range(pkt_rand, 0, example->produce_max_bytes + 1);
}
else {
len_random = 0;
}
len_this_pkt = example->sample_length + len_random;
if (len_this_pkt > WTAP_MAX_PACKET_SIZE_STANDARD) {
/*
* Wiretap will fail when trying to read packets
* bigger than WTAP_MAX_PACKET_SIZE_STANDARD.
*/
len_this_pkt = WTAP_MAX_PACKET_SIZE_STANDARD;
}
rec->rec_header.packet_header.caplen = len_this_pkt;
rec->rec_header.packet_header.len = len_this_pkt;
rec->ts.secs = i; /* just for variety */
for (j = example->pseudo_length; j < (int) sizeof(*ps_header); j++) {
((guint8*)ps_header)[j] = g_rand_int_range(pkt_rand, 0, 0x100);
}
for (j = example->sample_length; j < len_this_pkt; j++) {
/* Add format strings here and there */
if ((int) (100.0*g_rand_double(pkt_rand)) < 3 && j < (len_random - 3)) {
memcpy(&buffer[j], "%s", 3);
j += 2;
} else {
buffer[j] = g_rand_int_range(pkt_rand, 0, 0x100);
}
}
if (!wtap_dump(example->dump, rec, buffer, &err, &err_info)) {
cfile_write_failure_message(NULL,
example->filename, err, err_info, 0,
wtap_dump_file_type_subtype(example->dump));
}
if (packet_delay_ms) {
g_usleep(1000 * (gulong)packet_delay_ms);
if (!wtap_dump_flush(example->dump, &err)) {
cfile_write_failure_message(NULL,
example->filename, err, NULL, 0,
wtap_dump_file_type_subtype(example->dump));
}
}
}
g_free(rec);
g_free(buffer);
}
gboolean randpkt_example_close(randpkt_example* example)
{
int err;
gchar *err_info;
gboolean ok = TRUE;
if (!wtap_dump_close(example->dump, NULL, &err, &err_info)) {
cfile_close_failure_message(example->filename, err, err_info);
ok = FALSE;
}
if (pkt_rand != NULL) {
g_rand_free(pkt_rand);
pkt_rand = NULL;
}
return ok;
}
int randpkt_example_init(randpkt_example* example, char* produce_filename, int produce_max_bytes, int file_type_subtype)
{
int err;
gchar *err_info;
if (pkt_rand == NULL) {
pkt_rand = g_rand_new();
}
const wtap_dump_params params = {
.encap = example->sample_wtap_encap,
.snaplen = produce_max_bytes,
};
if (strcmp(produce_filename, "-") == 0) {
/* Write to the standard output. */
example->dump = wtap_dump_open_stdout(file_type_subtype,
WTAP_UNCOMPRESSED, ¶ms, &err, &err_info);
example->filename = "the standard output";
} else {
example->dump = wtap_dump_open(produce_filename, file_type_subtype,
WTAP_UNCOMPRESSED, ¶ms, &err, &err_info);
example->filename = produce_filename;
}
if (!example->dump) {
cfile_dump_open_failure_message(produce_filename,
err, err_info, file_type_subtype);
return WRITE_ERROR;
}
/* reduce max_bytes by # of bytes already in sample */
if (produce_max_bytes <= example->sample_length) {
fprintf(stderr, "randpkt: Sample packet length is %d, which is greater than "
"or equal to\n", example->sample_length);
fprintf(stderr, "your requested max_bytes value of %d\n", produce_max_bytes);
return INVALID_LEN;
} else {
example->produce_max_bytes = produce_max_bytes - example->sample_length;
}
return EXIT_SUCCESS;
}
/* Parse command-line option "type" and return enum type */
int randpkt_parse_type(char *string)
{
int num_entries = array_length(examples);
int i;
/* If called with NULL, or empty string, choose a random packet */
if (!string || !g_strcmp0(string, "")) {
return examples[g_random_int_range(0, num_entries)].produceable_type;
}
for (i = 0; i < num_entries; i++) {
if (g_strcmp0(examples[i].abbrev, string) == 0) {
return examples[i].produceable_type;
}
}
/* Complain */
ws_error("randpkt: Type %s not known.\n", string);
return -1;
}
void randpkt_example_list(char*** abbrev_list, char*** longname_list)
{
unsigned i;
unsigned list_num;
list_num = randpkt_example_count();
*abbrev_list = g_new0(char*, list_num + 1);
*longname_list = g_new0(char*, list_num + 1);
for (i = 0; i < list_num; i++) {
(*abbrev_list)[i] = g_strdup(examples[i].abbrev);
(*longname_list)[i] = g_strdup(examples[i].longname);
}
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
C/C++ | wireshark/randpkt_core/randpkt_core.h | /** @file
*
* randpkt_core.h
* ---------
* Creates random packet traces. Useful for debugging sniffers by testing
* assumptions about the veracity of the data found in the packet.
*
* Copyright (C) 1999 by Gilbert Ramirez <[email protected]>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef __RANDPKT_CORE_H__
#define __RANDPKT_CORE_H__
#include <glib.h>
#include "wiretap/wtap.h"
typedef struct {
const char* abbrev;
const char* longname;
int produceable_type;
int sample_wtap_encap;
guint8* sample_buffer;
int sample_length;
guint8* pseudo_buffer;
guint pseudo_length;
wtap_dumper* dump;
const char* filename;
guint produce_max_bytes;
} randpkt_example;
/* Return the number of active examples */
guint randpkt_example_count(void);
/* Return the list of the active examples */
void randpkt_example_list(char*** abbrev_list, char*** longname_list);
/* Parse command-line option "type" and return enum type */
int randpkt_parse_type(char *string);
/* Find pkt_example record and return pointer to it */
randpkt_example* randpkt_find_example(int type);
/* Init a new example */
int randpkt_example_init(randpkt_example* example, char* produce_filename, int produce_max_bytes, int file_type_subtype);
/* Loop the packet generation */
void randpkt_loop(randpkt_example* example, guint64 produce_count, guint64 packet_delay_ms);
/* Close the current example */
gboolean randpkt_example_close(randpkt_example* example);
#endif
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/ |
wireshark/resources/about.qrc | <RCC>
<qresource prefix="/about">
<file>Acknowledgements.md</file>
<file>gpl-2.0-standalone.html</file>
<file>wssplash.png</file>
<file>wssplash_dev.png</file>
</qresource>
</RCC> |
|
Markdown | wireshark/resources/Acknowledgements.md | Dan Lasley <dlasley[AT]promus.com> gave permission for his `dumpit()` hex-dump routine to be used.
We use the exception module from [Kazlib](https://www.kylheku.com/~kaz/kazlib.html), a C library written by Kaz Kylheku <kaz[AT]kylheku.com>. Thanks go to him for his well-written library.
We use [Lua](https://www.lua.org/about.html) to extend Wireshark APIs with scripting capabilities. Lua is a powerful, efficient, lightweight, embeddable scripting language developed and maintained by a team at PUC-Rio.
We use [Lua BitOp](https://bitop.luajit.org), written by Mike Pall, for bitwise operations on numbers in Lua.
Snax <snax[AT]shmoo.com> gave permission to use the weak key detection code from [Airsnort](http://airsnort.shmoo.com).
IANA gave permission for their port-numbers file to be used.
We use the natural order string comparison algorithm, written by Martin Pool <mbp[AT]sourcefrog.net>.
Emanuel Eichhammer <support[AT]qcustomplot.com> granted permission to use [QCustomPlot](https://www.qcustomplot.com).
Some icons made by [Freepik](https://www.freepik.com) from <https://www.flaticon.com>.
Insecure.Com LLC ("The Nmap Project") has granted the Wireshark Foundation permission to distribute [Npcap](https://npcap.com) with our Windows installers.
We use the overflow-safe math functions from the [portable snippets](https://github.com/nemequ/portable-snippets) repository.
We use the [Lrexlib](https://github.com/rrthomas/lrexlib) Lua library, specifically the PCRE2 flavour, to provide a regular expression API for Lua. |
Inno Setup Script | wireshark/resources/cli_template.rc.in | #include "winver.h"
#pragma code_page(65001)
WIRESHARK_ICON ICON "@[email protected]"
VS_VERSION_INFO VERSIONINFO
FILEVERSION @RC_VERSION@
PRODUCTVERSION @RC_VERSION@
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "The Wireshark developer community\0"
VALUE "FileDescription", "@PROGRAM_NAME@\0"
VALUE "FileVersion", "@PROJECT_VERSION@\0"
VALUE "InternalName", "@PROGRAM_NAME@ @PROJECT_VERSION@\0"
VALUE "LegalCopyright", "Copyright © @COPYRIGHT_INFO@\0"
VALUE "OriginalFilename", "@[email protected]\0"
VALUE "ProductName", "@PROGRAM_NAME@\0"
VALUE "ProductVersion", "@PROJECT_VERSION@\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#define MANIFEST_RESOURCE_ID 1
#define RT_MANIFEST 24
MANIFEST_RESOURCE_ID RT_MANIFEST "wireshark.exe.manifest" |
Inno Setup Script | wireshark/resources/dumpcap.rc.in | #include "winver.h"
#pragma code_page(65001)
WIRESHARK_ICON ICON "@[email protected]"
VS_VERSION_INFO VERSIONINFO
FILEVERSION @RC_VERSION@
PRODUCTVERSION @RC_VERSION@
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "The Wireshark developer community\0"
VALUE "FileDescription", "Dumpcap\0"
VALUE "FileVersion", "@PROJECT_VERSION@\0"
VALUE "InternalName", "Dumpcap @PROJECT_VERSION@\0"
VALUE "LegalCopyright", "Copyright © 2000 Gerald Combs <[email protected]>, Gilbert Ramirez <[email protected]> and others\0"
VALUE "OriginalFilename", "Dumpcap.exe\0"
VALUE "ProductName", "Dumpcap\0"
VALUE "ProductVersion", "@PROJECT_VERSION@\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#define MANIFEST_RESOURCE_ID 1
#define RT_MANIFEST 24
MANIFEST_RESOURCE_ID RT_MANIFEST "wireshark.exe.manifest" |
wireshark/resources/file_dlg_win32.rc | #include <windows.h>
#include "richedit.h"
#include "../ui/win32/file_dlg_win32.h"
// We should probably ensure that we're meeting the MS layout guidelines:
// https://docs.microsoft.com/en-us/windows/win32/uxguide/vis-layout
// Outer margin: 11px
WIRESHARK_OPENFILENAME_TEMPLATE DIALOGEX 0, 0, 425, 47
STYLE WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | DS_3DLOOK | DS_CONTROL
FONT 8, "MS Shell Dlg"
{
// Filter button/entry
// PUSHBUTTON "Filter:", EWFD_FILTER_BTN, 7, 4, 35, 14
LTEXT "Read filter:", EWFD_FILTER_LBL, 67, 2, 49, 14
CONTROL "", EWFD_FILTER_EDIT, RICHEDIT_CLASS, ES_AUTOHSCROLL, 112, 0, 88, 12, WS_EX_CLIENTEDGE
COMBOBOX EWFD_FORMAT_TYPE, 67, 17, 135, 8, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
// CHECKBOX "MAC name resolution", EWFD_MAC_NR_CB, 67, 30, 100, 8, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
// CHECKBOX "Transport name resolution", EWFD_TRANS_NR_CB, 67, 45, 100, 8, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
// CHECKBOX "Network name resolution", EWFD_NET_NR_CB, 67, 60, 100, 8, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
// CHECKBOX "Use external network name resolver", EWFD_EXTERNAL_NR_CB, 67, 75, 135, 8, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
LTEXT "Format:", EWFD_PT_FORMAT, 224, 2, 60, 8
LTEXT "-", EWFD_PTX_FORMAT, 275, 2, 150, 8
LTEXT "Size:", EWFD_PT_SIZE, 224, 17, 60, 8
LTEXT "-", EWFD_PTX_SIZE, 275, 17, 150, 8
// LTEXT "Packets:", EWFD_PT_PACKETS, 224, 32, 60, 8
// LTEXT "-", EWFD_PTX_PACKETS, 275, 32, 150, 8
LTEXT "Start / elapsed:", EWFD_PT_START_ELAPSED, 224, 32, 60, 8
LTEXT "-", EWFD_PTX_START_ELAPSED, 275, 32, 150, 8
// 164/211, 79, 40/150, 8
}
WIRESHARK_SAVEASFILENAME_TEMPLATE DIALOGEX 0, 0, 167, 15
STYLE WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | DS_3DLOOK | DS_CONTROL
FONT 8, "MS Shell Dlg"
{
CHECKBOX "Compress with gzip", EWFD_GZIP_CB, 67, 0, 100, 8, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
}
WIRESHARK_SAVEASSTATSTREENAME_TEMPLATE DIALOGEX 0, 0, 167, 0
STYLE WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | DS_3DLOOK | DS_CONTROL
FONT 8, "MS Shell Dlg"
{
}
WIRESHARK_EXPORT_SPECIFIED_PACKETS_FILENAME_TEMPLATE DIALOGEX 0, 0, 453, 124
STYLE WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | DS_3DLOOK | DS_CONTROL
FONT 8, "MS Shell Dlg"
{
CHECKBOX "Compress with gzip", EWFD_GZIP_CB, 67, 0, 100, 8, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
GROUPBOX "Packet Range", -1, 67, 15, 270, 102
CONTROL "Captured", EWFD_CAPTURED_BTN, "Button", BS_AUTORADIOBUTTON | WS_GROUP, 232, 26, 45, 10
CONTROL "Displayed", EWFD_DISPLAYED_BTN, "Button", BS_AUTORADIOBUTTON, 282, 26, 47, 10
CONTROL "All packets", EWFD_ALL_PKTS_BTN, "Button", BS_AUTORADIOBUTTON | WS_GROUP, 73, 38, 51, 10
CONTROL "Selected packets only", EWFD_SEL_PKT_BTN, "Button", BS_AUTORADIOBUTTON, 73, 50, 80, 10
CONTROL "Marked packets only", EWFD_MARKED_BTN, "Button", BS_AUTORADIOBUTTON, 73, 62, 78, 10
CONTROL "First to last marked", EWFD_FIRST_LAST_BTN, "Button", BS_AUTORADIOBUTTON, 73, 74, 75, 10
CONTROL "Range:", EWFD_RANGE_BTN, "Button", BS_AUTORADIOBUTTON, 73, 86, 35, 10
CONTROL "", EWFD_RANGE_EDIT, RICHEDIT_CLASS, ES_AUTOHSCROLL, 112, 85, 110, 12, WS_EX_CLIENTEDGE
CONTROL "Remove Ignored packets", EWFD_REMOVE_IGN_CB, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 73, 98, 100, 10
LTEXT "0", EWFD_ALL_PKTS_CAP, 232, 39, 39, 8, SS_RIGHT
LTEXT "0", EWFD_SEL_PKT_CAP, 232, 51, 39, 8, SS_RIGHT
LTEXT "0", EWFD_MARKED_CAP, 232, 63, 39, 8, SS_RIGHT
LTEXT "0", EWFD_FIRST_LAST_CAP, 232, 75, 39, 8, SS_RIGHT
LTEXT "0", EWFD_RANGE_CAP, 232, 87, 39, 8, SS_RIGHT
LTEXT "0", EWFD_IGNORED_CAP, 232, 99, 39, 8, SS_RIGHT
LTEXT "0", EWFD_ALL_PKTS_DISP, 282, 39, 41, 8, SS_RIGHT
LTEXT "0", EWFD_SEL_PKT_DISP, 282, 51, 41, 8, SS_RIGHT
LTEXT "0", EWFD_MARKED_DISP, 282, 63, 41, 8, SS_RIGHT
LTEXT "0", EWFD_FIRST_LAST_DISP, 282, 75, 41, 8, SS_RIGHT
LTEXT "0", EWFD_RANGE_DISP, 282, 87, 41, 8, SS_RIGHT
LTEXT "0", EWFD_IGNORED_DISP, 282, 99, 41, 8, SS_RIGHT
}
WIRESHARK_MERGEFILENAME_TEMPLATE DIALOGEX 0, 0, 450, 80
STYLE WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | DS_3DLOOK | DS_CONTROL
FONT 8, "MS Shell Dlg"
{
// Filter button/entry
// PUSHBUTTON "Filter:", EWFD_FILTER_BTN, 7, 4, 35, 14
LTEXT "Read filter:", EWFD_FILTER_LBL, 67, 2, 49, 14
CONTROL "", EWFD_FILTER_EDIT, RICHEDIT_CLASS, ES_AUTOHSCROLL, 112, 0, 88, 12, WS_EX_CLIENTEDGE
CONTROL "Prepend packets to existing file", EWFD_MERGE_PREPEND_BTN, "Button", BS_AUTORADIOBUTTON | WS_GROUP, 67, 30, 120, 8
CONTROL "Merge packets chronologically", EWFD_MERGE_CHRONO_BTN, "Button", BS_AUTORADIOBUTTON, 67, 45, 120, 8
CONTROL "Append packets to existing file", EWFD_MERGE_APPEND_BTN, "Button", BS_AUTORADIOBUTTON, 67, 60, 120, 8
LTEXT "Format:", EWFD_PT_FORMAT, 224, 2, 60, 8
LTEXT "-", EWFD_PTX_FORMAT, 275, 2, 150, 8
LTEXT "Size:", EWFD_PT_SIZE, 224, 17, 60, 8
LTEXT "-", EWFD_PTX_SIZE, 275, 17, 150, 8
// LTEXT "Packets:", EWFD_PT_PACKETS, 224, 32, 60, 8
// LTEXT "-", EWFD_PTX_PACKETS, 275, 32, 150, 8
LTEXT "Start / elapsed:", EWFD_PT_START_ELAPSED, 224, 32, 60, 8
LTEXT "-", EWFD_PTX_START_ELAPSED, 275, 32, 150, 8
// 164/211, 79, 40/150, 8
}
WIRESHARK_EXPORTFILENAME_TEMPLATE DIALOGEX 0, 0, 469, 109
STYLE WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | DS_3DLOOK | DS_CONTROL
FONT 8, "MS Shell Dlg"
{
GROUPBOX "Packet Range", -1, 67, 0, 270, 106
CONTROL "Captured", EWFD_CAPTURED_BTN, "Button", BS_AUTORADIOBUTTON | WS_GROUP, 232, 11, 45, 10
CONTROL "Displayed", EWFD_DISPLAYED_BTN, "Button", BS_AUTORADIOBUTTON, 282, 11, 47, 10
CONTROL "All packets", EWFD_ALL_PKTS_BTN, "Button", BS_AUTORADIOBUTTON | WS_GROUP, 73, 23, 51, 10
CONTROL "Selected packet", EWFD_SEL_PKT_BTN, "Button", BS_AUTORADIOBUTTON, 73, 35, 68, 10
CONTROL "Marked packets", EWFD_MARKED_BTN, "Button", BS_AUTORADIOBUTTON, 73, 47, 67, 10
CONTROL "First to last marked", EWFD_FIRST_LAST_BTN, "Button", BS_AUTORADIOBUTTON, 73, 59, 75, 10
CONTROL "Range:", EWFD_RANGE_BTN, "Button", BS_AUTORADIOBUTTON, 73, 71, 35, 10
CONTROL "", EWFD_RANGE_EDIT, RICHEDIT_CLASS, ES_AUTOHSCROLL, 112, 70, 110, 12, WS_EX_CLIENTEDGE
CONTROL "Remove Ignored packets", EWFD_REMOVE_IGN_CB, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 73, 83, 100, 10
LTEXT "0", EWFD_ALL_PKTS_CAP, 232, 24, 39, 8, SS_RIGHT
LTEXT "0", EWFD_SEL_PKT_CAP, 232, 36, 39, 8, SS_RIGHT
LTEXT "0", EWFD_MARKED_CAP, 232, 48, 39, 8, SS_RIGHT
LTEXT "0", EWFD_FIRST_LAST_CAP, 232, 60, 39, 8, SS_RIGHT
LTEXT "0", EWFD_RANGE_CAP, 232, 72, 39, 8, SS_RIGHT
LTEXT "0", EWFD_IGNORED_CAP, 232, 84, 39, 8, SS_RIGHT
LTEXT "0", EWFD_ALL_PKTS_DISP, 282, 24, 41, 8, SS_RIGHT
LTEXT "0", EWFD_SEL_PKT_DISP, 282, 36, 41, 8, SS_RIGHT
LTEXT "0", EWFD_MARKED_DISP, 282, 48, 41, 8, SS_RIGHT
LTEXT "0", EWFD_FIRST_LAST_DISP, 282, 60, 41, 8, SS_RIGHT
LTEXT "0", EWFD_RANGE_DISP, 282, 72, 41, 8, SS_RIGHT
LTEXT "0", EWFD_IGNORED_DISP, 282, 84, 41, 8, SS_RIGHT
GROUPBOX "Packet Format", EWFD_PKT_FORMAT_GB, 344, 0, 134, 106
CONTROL "Packet summary line", EWFD_PKT_SUMMARY_CB, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 350, 15, 84, 10
CONTROL "Include column headings", EWFD_COL_HEADINGS_CB, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 362, 27, 94, 10
CONTROL "Packet details:", EWFD_PKT_DETAIL_CB, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 350, 39, 95, 10
COMBOBOX EWFD_PKT_DETAIL_COMBO, 362, 51, 74, 45, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Packet Bytes", EWFD_PKT_BYTES_CB, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 350, 68, 80, 10
CONTROL "Include secondary data sources", EWFD_DATA_SOURCES_CB, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 362, 80, 112, 10
CONTROL "Each packet on a new page", EWFD_PKT_NEW_PAGE_CB, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 350, 92, 106, 10
} |
|
HTML | wireshark/resources/gpl-2.0-standalone.html | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GNU General Public License v2.0 - GNU Project - Free Software Foundation (FSF)</title>
<link rel="alternate" type="application/rdf+xml" href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.rdf">
</head>
<body>
<h3 id="SEC1">GNU GENERAL PUBLIC LICENSE</h3>
<p>
Version 2, June 1991
</p>
<pre>Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</pre>
<span id="SEC2"></span>
<h4 id="preamble">Preamble</h4>
<p>
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
</p>
<p>
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
</p>
<p>
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
</p>
<p>
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
</p>
<p>
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
</p>
<p>
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
</p>
<p>
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
</p>
<p>
The precise terms and conditions for copying, distribution and
modification follow.
</p>
<span id="SEC3"></span>
<h4 id="terms">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</h4>
<p id="section0">
<strong>0.</strong>
This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
</p>
<p>
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
</p>
<p id="section1">
<strong>1.</strong>
You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
</p>
<p>
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
</p>
<p id="section2">
<strong>2.</strong>
You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
</p>
<dl>
<dt></dt>
<dd>
<strong>a)</strong>
You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
</dd>
<dt></dt>
<dd>
<strong>b)</strong>
You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
</dd>
<dt></dt>
<dd>
<strong>c)</strong>
If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
</dd>
</dl>
<p>
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
</p>
<p>
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
</p>
<p>
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
</p>
<p id="section3">
<strong>3.</strong>
You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
</p>
<!-- we use this doubled UL to get the sub-sections indented, -->
<!-- while making the bullets as unobvious as possible. -->
<dl>
<dt></dt>
<dd>
<strong>a)</strong>
Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
</dd>
<dt></dt>
<dd>
<strong>b)</strong>
Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
</dd>
<dt></dt>
<dd>
<strong>c)</strong>
Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
</dd>
</dl>
<p>
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
</p>
<p>
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
</p>
<p id="section4">
<strong>4.</strong>
You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
</p>
<p id="section5">
<strong>5.</strong>
You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
</p>
<p id="section6">
<strong>6.</strong>
Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
</p>
<p id="section7">
<strong>7.</strong>
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
</p>
<p>
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
</p>
<p>
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
</p>
<p>
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
</p>
<p id="section8">
<strong>8.</strong>
If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
</p>
<p id="section9">
<strong>9.</strong>
The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
</p>
<p>
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
</p>
<p id="section10">
<strong>10.</strong>
If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
</p>
<p id="section11"><strong>NO WARRANTY</strong></p>
<p>
<strong>11.</strong>
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
</p>
<p id="section12">
<strong>12.</strong>
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
</p>
<h4>END OF TERMS AND CONDITIONS</h4>
<span id="SEC4"></span>
<h4 id="howto">How to Apply These Terms to Your New Programs</h4>
<p>
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
</p>
<p>
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
</p>
<pre><var>one line to give the program's name and an idea of what it does.</var>
Copyright (C) <var>yyyy</var> <var>name of author</var>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
</pre>
<p>
Also add information on how to contact you by electronic and paper mail.
</p>
<p>
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
</p>
<pre>Gnomovision version 69, Copyright (C) <var>year</var> <var>name of author</var>
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
type `show w'. This is free software, and you are welcome
to redistribute it under certain conditions; type `show c'
for details.
</pre>
<p>
The hypothetical commands <samp>`show w'</samp> and <samp>`show c'</samp> should show
the appropriate parts of the General Public License. Of course, the
commands you use may be called something other than <samp>`show w'</samp> and
<samp>`show c'</samp>; they could even be mouse-clicks or menu items--whatever
suits your program.
</p>
<p>
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
</p>
<pre>Yoyodyne, Inc., hereby disclaims all copyright
interest in the program `Gnomovision'
(which makes passes at compilers) written
by James Hacker.
<var>signature of Ty Coon</var>, 1 April 1989
Ty Coon, President of Vice
</pre>
<p>
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the
<a href="https://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a>
instead of this License.
</p>
</body></html> |
wireshark/resources/layout.qrc | <RCC>
<qresource prefix="/layout">
<file>layout_1.png</file>
<file>[email protected]</file>
<file>layout_2.png</file>
<file>[email protected]</file>
<file>layout_3.png</file>
<file>[email protected]</file>
<file>layout_4.png</file>
<file>[email protected]</file>
<file>layout_5.png</file>
<file>[email protected]</file>
<file>layout_6.png</file>
<file>[email protected]</file>
</qresource>
</RCC> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.