2007-05-25 23:40:42 +00:00
|
|
|
/* packet-m2m.c
|
|
|
|
* Routines for WiMax MAC to MAC TLV packet disassembly
|
|
|
|
*
|
|
|
|
* Copyright (c) 2007 by Intel Corporation.
|
|
|
|
*
|
|
|
|
* Author: Lu Pan <lu.pan@intel.com>
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1999 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2007-05-25 23:40:42 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* Include files */
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2007-05-27 18:33:13 +00:00
|
|
|
#include <glib.h>
|
2007-05-25 23:40:42 +00:00
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/reassemble.h>
|
2007-08-01 17:42:43 +00:00
|
|
|
#include <epan/etypes.h>
|
2009-08-08 22:20:08 +00:00
|
|
|
#include <epan/expert.h>
|
2007-05-25 23:40:42 +00:00
|
|
|
#include <plugins/wimax/wimax_tlv.h>
|
|
|
|
|
|
|
|
/* forward reference */
|
|
|
|
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);
|
2013-03-18 21:16:23 +00:00
|
|
|
void proto_tree_add_tlv(tlv_info_t *self, tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree, gint hf, guint encoding);
|
2007-05-25 23:40:42 +00:00
|
|
|
|
|
|
|
/* Global variables */
|
2009-08-03 22:09:08 +00:00
|
|
|
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;
|
2007-05-25 23:40:42 +00:00
|
|
|
|
2013-03-22 23:59:54 +00:00
|
|
|
static reassembly_table pdu_reassembly_table;
|
2009-08-03 22:09:08 +00:00
|
|
|
|
|
|
|
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;
|
2007-05-25 23:40:42 +00:00
|
|
|
|
|
|
|
/* 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;
|
2013-02-10 20:52:21 +00:00
|
|
|
/* static gint hf_m2m_value_bytes = -1; */
|
2007-05-25 23:40:42 +00:00
|
|
|
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;
|
|
|
|
|
2013-05-29 23:41:33 +00:00
|
|
|
static expert_field ei_m2m_unexpected_length = EI_INIT;
|
|
|
|
|
2009-06-24 02:12:13 +00:00
|
|
|
/* Register M2M defrag table init routine. */
|
|
|
|
static void
|
|
|
|
m2m_defragment_init(void)
|
|
|
|
{
|
2013-03-22 23:59:54 +00:00
|
|
|
reassembly_table_init(&pdu_reassembly_table,
|
|
|
|
&addresses_reassembly_table_functions);
|
2009-06-24 02:12:13 +00:00
|
|
|
}
|
|
|
|
|
2007-05-25 23:40:42 +00:00
|
|
|
|
|
|
|
/* WiMax MAC to MAC protocol dissector */
|
|
|
|
static void dissect_m2m(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
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;
|
2009-08-08 22:20:08 +00:00
|
|
|
gint hf;
|
2012-05-11 19:08:31 +00:00
|
|
|
guint encoding;
|
2009-08-03 22:09:08 +00:00
|
|
|
guint frame_number;
|
2009-08-08 22:20:08 +00:00
|
|
|
int expected_len;
|
2007-05-25 23:40:42 +00:00
|
|
|
|
|
|
|
/* display the M2M protocol name */
|
2009-08-09 07:59:51 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "WiMax");
|
2007-05-25 23:40:42 +00:00
|
|
|
|
|
|
|
/* Clear out stuff in the info column */
|
2009-08-09 08:14:59 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2007-05-25 23:40:42 +00:00
|
|
|
|
2007-08-01 17:42:43 +00:00
|
|
|
|
2007-05-25 23:40:42 +00:00
|
|
|
{ /* we are being asked for details */
|
2011-10-21 02:10:19 +00:00
|
|
|
m2m_item = proto_tree_add_item(tree, proto_m2m, tvb, 0, -1, ENC_NA);
|
2007-05-25 23:40:42 +00:00
|
|
|
m2m_tree = proto_item_add_subtree(m2m_item, ett_m2m);
|
2007-05-27 18:33:13 +00:00
|
|
|
/* get the tvb reported length */
|
|
|
|
length = tvb_reported_length(tvb);
|
2007-05-25 23:40:42 +00:00
|
|
|
/* 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 */
|
2011-10-06 14:46:34 +00:00
|
|
|
proto_tree_add_item(m2m_tree, hf_m2m_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2007-05-25 23:40:42 +00:00
|
|
|
offset += 2;
|
|
|
|
/* display the TLV count */
|
2011-10-06 14:46:34 +00:00
|
|
|
proto_tree_add_item(m2m_tree, hf_m2m_tlv_count, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2007-05-25 23:40:42 +00:00
|
|
|
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 */
|
2010-04-05 20:04:52 +00:00
|
|
|
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "M2M TLV error");
|
2007-05-25 23:40:42 +00:00
|
|
|
/* display the invalid TLV in HEX */
|
2011-10-05 01:00:06 +00:00
|
|
|
proto_tree_add_item(m2m_tree, hf_wimax_invalid_tlv, tvb, offset, (length - offset), ENC_NA);
|
2007-05-25 23:40:42 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* get the TLV value offset */
|
|
|
|
tlv_offset = get_tlv_value_offset(&m2m_tlv_info);
|
|
|
|
/* display TLV type */
|
2008-10-31 17:27:51 +00:00
|
|
|
ti = proto_tree_add_protocol_format(m2m_tree, proto_m2m, tvb, offset, (tlv_len + tlv_offset), "%s", val_to_str(tlv_type, tlv_name, "Unknown TLV"));
|
2007-05-25 23:40:42 +00:00
|
|
|
/* 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) */
|
2009-08-08 22:20:08 +00:00
|
|
|
expected_len = 0;
|
|
|
|
hf = 0;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_NA;
|
2007-05-25 23:40:42 +00:00
|
|
|
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;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_BIG_ENDIAN;
|
2009-08-08 22:20:08 +00:00
|
|
|
expected_len = 1;
|
2007-05-25 23:40:42 +00:00
|
|
|
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;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_BIG_ENDIAN;
|
2009-08-08 22:20:08 +00:00
|
|
|
expected_len = 1;
|
2007-05-25 23:40:42 +00:00
|
|
|
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(tlv_frag_type, tlv_frag_type_name, "Unknown"));
|
|
|
|
hf = hf_m2m_value_frag_type_uint8;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_BIG_ENDIAN;
|
2009-08-08 22:20:08 +00:00
|
|
|
expected_len = 1;
|
2007-05-25 23:40:42 +00:00
|
|
|
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;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_BIG_ENDIAN;
|
2009-08-08 22:20:08 +00:00
|
|
|
expected_len = 1;
|
2007-05-25 23:40:42 +00:00
|
|
|
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;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_NA;
|
2007-05-25 23:40:42 +00:00
|
|
|
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;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_NA;
|
2007-05-25 23:40:42 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TLV_FRAME_NUM:
|
|
|
|
/* get the frame number */
|
2009-08-03 22:09:08 +00:00
|
|
|
frame_number = tvb_get_ntoh24( tvb, offset );
|
2007-05-25 23:40:42 +00:00
|
|
|
/* add the description */
|
2011-10-06 14:46:34 +00:00
|
|
|
proto_tree_add_item(tlv_tree, hf_m2m_frame_number, tvb, offset, 3, ENC_BIG_ENDIAN);
|
2009-08-03 22:09:08 +00:00
|
|
|
proto_item_append_text(ti, ": %d", frame_number);
|
2007-05-25 23:40:42 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TLV_FCH_BURST:
|
|
|
|
/* add the description */
|
|
|
|
tlv_value = tvb_get_ntoh24( tvb, offset );
|
|
|
|
proto_item_append_text(ti, ": 0x%X", tlv_value);
|
2009-08-08 22:20:08 +00:00
|
|
|
/* decode and display the TLV FCH burst */
|
2007-05-25 23:40:42 +00:00
|
|
|
fch_burst_decoder(tree, tvb, offset, tlv_len, pinfo);
|
|
|
|
hf = hf_m2m_value_fch_burst_uint24;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_BIG_ENDIAN;
|
2009-08-08 22:20:08 +00:00
|
|
|
expected_len = 3;
|
2007-05-25 23:40:42 +00:00
|
|
|
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;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_BIG_ENDIAN;
|
2009-08-08 22:20:08 +00:00
|
|
|
expected_len = 3;
|
2007-05-25 23:40:42 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case TLV_CRC16_STATUS:
|
|
|
|
/* add the description */
|
|
|
|
tlv_value = tvb_get_guint8( tvb, offset );
|
|
|
|
proto_item_append_text(ti, ": %s", val_to_str(tlv_value, tlv_crc16_status, "Unknown"));
|
|
|
|
hf = hf_m2m_value_crc16_status_uint8;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_BIG_ENDIAN;
|
2009-08-08 22:20:08 +00:00
|
|
|
expected_len = 1;
|
2007-05-25 23:40:42 +00:00
|
|
|
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;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_BIG_ENDIAN;
|
2009-08-08 22:20:08 +00:00
|
|
|
expected_len = 2;
|
2007-05-25 23:40:42 +00:00
|
|
|
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;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_BIG_ENDIAN;
|
2009-08-08 22:20:08 +00:00
|
|
|
expected_len = 2;
|
2007-05-25 23:40:42 +00:00
|
|
|
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;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_BIG_ENDIAN;
|
2009-08-08 22:20:08 +00:00
|
|
|
expected_len = 2;
|
2007-05-25 23:40:42 +00:00
|
|
|
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;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_NA;
|
2007-05-25 23:40:42 +00:00
|
|
|
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;
|
2012-05-11 19:08:31 +00:00
|
|
|
encoding = ENC_NA;
|
2007-05-25 23:40:42 +00:00
|
|
|
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 */
|
2009-08-08 22:20:08 +00:00
|
|
|
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "Unknown TLV Type");
|
2007-05-25 23:40:42 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* expand the TLV detail */
|
2009-08-08 22:20:08 +00:00
|
|
|
if (hf) {
|
|
|
|
if (offset - tlv_offset == expected_len) {
|
2012-05-11 19:08:31 +00:00
|
|
|
proto_tree_add_tlv(&m2m_tlv_info, tvb, offset - tlv_offset, pinfo, tlv_tree, hf, encoding);
|
2009-08-08 22:20:08 +00:00
|
|
|
} else {
|
2013-05-29 23:41:33 +00:00
|
|
|
expert_add_info_format_text(pinfo, NULL, &ei_m2m_unexpected_length, "Expected length %d, got %d.", expected_len, offset - tlv_offset);
|
2009-08-08 22:20:08 +00:00
|
|
|
}
|
|
|
|
}
|
2007-05-25 23:40:42 +00:00
|
|
|
offset += tlv_len;
|
|
|
|
/* update tlv_count */
|
|
|
|
tlv_count--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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(tvb, offset, length, length), pinfo, tree);
|
|
|
|
}
|
|
|
|
else /* display FCH info */
|
|
|
|
{ /* update the info column */
|
2009-09-24 20:00:21 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "FCH Burst: DL Frame Prefix");
|
2007-05-25 23:40:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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(tvb, offset, length, length), pinfo, tree);
|
|
|
|
}
|
|
|
|
else /* display CDMA Code Attribute info */
|
|
|
|
{ /* update the info column */
|
2009-09-24 20:00:21 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "CDMA Code Attribute");
|
2007-05-25 23:40:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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_data *pdu_frag;
|
|
|
|
tvbuff_t *pdu_tvb = NULL;
|
|
|
|
|
|
|
|
/* update the info column */
|
2010-04-05 20:04:52 +00:00
|
|
|
switch (frag_type)
|
2007-05-25 23:40:42 +00:00
|
|
|
{
|
2010-04-05 20:04:52 +00:00
|
|
|
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;
|
2007-05-25 23:40:42 +00:00
|
|
|
}
|
|
|
|
if(frag_type == TLV_NO_FRAG)
|
|
|
|
{ /* not fragmented PDU */
|
|
|
|
pdu_tvb = tvb_new_subset(tvb, offset, length, length);
|
|
|
|
}
|
|
|
|
else /* fragmented PDU */
|
|
|
|
{ /* add the frag */
|
2013-03-22 23:59:54 +00:00
|
|
|
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);
|
2007-05-25 23:40:42 +00:00
|
|
|
if(pdu_frag && frag_type == TLV_LAST_FRAG)
|
|
|
|
{
|
|
|
|
/* create the new tvb for defraged frame */
|
2012-03-27 06:57:39 +00:00
|
|
|
pdu_tvb = tvb_new_child_real_data(tvb, pdu_frag->data, pdu_frag->len, pdu_frag->len);
|
2007-05-25 23:40:42 +00:00
|
|
|
/* 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 */
|
2010-04-05 20:04:52 +00:00
|
|
|
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "Incomplete PDU frame");
|
2007-05-25 23:40:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* process the defragmented PDU burst */
|
|
|
|
if(pdu_tvb)
|
2009-08-03 22:09:08 +00:00
|
|
|
{
|
2007-05-25 23:40:42 +00:00
|
|
|
if(wimax_pdu_burst_handle)
|
2009-08-03 22:09:08 +00:00
|
|
|
{/* decode and display PDU Burst */
|
2007-05-25 23:40:42 +00:00
|
|
|
call_dissector(wimax_pdu_burst_handle, pdu_tvb, pinfo, tree);
|
2009-08-03 22:09:08 +00:00
|
|
|
}
|
2007-05-25 23:40:42 +00:00
|
|
|
else /* display PDU Burst info */
|
|
|
|
{ /* update the info column */
|
2009-09-24 20:00:21 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "PDU Burst");
|
2007-05-25 23:40:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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(tvb, offset, length, length), pinfo, tree);
|
|
|
|
}
|
|
|
|
else /* display the Fast Feedback Burst info */
|
|
|
|
{ /* update the info column */
|
2009-09-24 20:00:21 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "Fast Feedback Burst");
|
2007-05-25 23:40:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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(tvb, offset, length, length), pinfo, tree);
|
|
|
|
}
|
|
|
|
else /* display the TLV HARQ ACK Bursts info */
|
|
|
|
{ /* update the info column */
|
2009-09-24 20:00:21 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "HARQ ACK Bursts");
|
2007-05-25 23:40:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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(tvb, offset, length, length), pinfo, tree);
|
|
|
|
}
|
|
|
|
else /* display the TLV PDU Burst Physical Attributes info */
|
|
|
|
{ /* update the info column */
|
2009-09-24 20:00:21 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "PHY-attr");
|
2007-05-25 23:40:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void extended_tlv_decoder(packet_info *pinfo)
|
|
|
|
{
|
|
|
|
/* display the Extended TLV info */
|
|
|
|
/* update the info column */
|
2009-09-24 20:00:21 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "Extended TLV");
|
2007-05-25 23:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Display the raw WiMax TLV */
|
2013-03-18 21:16:23 +00:00
|
|
|
void proto_tree_add_tlv(tlv_info_t *self, tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree, gint hf, guint encoding)
|
2007-05-25 23:40:42 +00:00
|
|
|
{
|
|
|
|
guint tlv_offset;
|
|
|
|
gint tlv_type, tlv_len;
|
|
|
|
|
|
|
|
/* make sure the TLV information is valid */
|
2013-03-18 21:16:23 +00:00
|
|
|
if(!self->valid)
|
2007-05-25 23:40:42 +00:00
|
|
|
{ /* invalid TLV info */
|
2009-08-08 22:20:08 +00:00
|
|
|
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Invalid TLV");
|
2007-05-25 23:40:42 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
tlv_offset = offset;
|
|
|
|
/* display TLV type */
|
2011-10-06 14:46:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_m2m_type, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
|
2007-05-25 23:40:42 +00:00
|
|
|
tlv_offset++;
|
|
|
|
/* check the TLV length type */
|
2013-03-18 21:16:23 +00:00
|
|
|
if( self->length_type )
|
2007-05-25 23:40:42 +00:00
|
|
|
{ /* multiple bytes TLV length */
|
|
|
|
/* display the length of the TLV length with MSB */
|
2011-10-06 14:46:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_m2m_len_size, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
|
2007-05-25 23:40:42 +00:00
|
|
|
tlv_offset++;
|
2013-03-18 21:16:23 +00:00
|
|
|
if(self->size_of_length)
|
2007-05-25 23:40:42 +00:00
|
|
|
/* display the multiple byte TLV length */
|
2013-03-18 21:16:23 +00:00
|
|
|
proto_tree_add_item(tree, hf_m2m_len, tvb, tlv_offset, self->size_of_length, ENC_BIG_ENDIAN);
|
2007-05-25 23:40:42 +00:00
|
|
|
else
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else /* display the single byte TLV length */
|
2011-10-06 14:46:34 +00:00
|
|
|
proto_tree_add_item(tree, hf_m2m_len, tvb, tlv_offset, 1, ENC_BIG_ENDIAN);
|
2007-05-25 23:40:42 +00:00
|
|
|
|
2013-03-18 21:16:23 +00:00
|
|
|
tlv_type = get_tlv_type(self);
|
2007-05-25 23:40:42 +00:00
|
|
|
/* Display Frame Number as special case for filter */
|
|
|
|
if ( tlv_type == TLV_FRAME_NUM )
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* get the TLV length */
|
2013-03-18 21:16:23 +00:00
|
|
|
tlv_len = get_tlv_length(self);
|
|
|
|
proto_tree_add_item(tree, hf, tvb, (offset + self->value_offset), tlv_len, encoding);
|
2007-05-25 23:40:42 +00:00
|
|
|
}
|
2009-08-03 22:09:08 +00:00
|
|
|
|
|
|
|
/* 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
|
|
|
|
}
|
|
|
|
},
|
2013-02-10 20:52:21 +00:00
|
|
|
#if 0
|
2009-08-03 22:09:08 +00:00
|
|
|
{
|
|
|
|
&hf_m2m_value_bytes,
|
|
|
|
{
|
|
|
|
"Value (hex)", "m2m.multibyte_tlv_value",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL
|
|
|
|
}
|
|
|
|
},
|
2013-02-10 20:52:21 +00:00
|
|
|
#endif
|
2009-08-03 22:09:08 +00:00
|
|
|
{
|
|
|
|
&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",
|
2012-05-11 19:53:43 +00:00
|
|
|
FT_UINT24, BASE_DEC, NULL, 0x0,
|
2009-08-03 22:09:08 +00:00
|
|
|
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,
|
|
|
|
};
|
|
|
|
|
2013-05-29 23:41:33 +00:00
|
|
|
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 (
|
2009-08-03 22:09:08 +00:00
|
|
|
"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));
|
2013-05-29 23:41:33 +00:00
|
|
|
expert_m2m = expert_register_protocol(proto_m2m);
|
|
|
|
expert_register_field_array(expert_m2m, ei, array_length(ei));
|
2009-08-03 22:09:08 +00:00
|
|
|
|
|
|
|
/* Register the PDU fragment table init routine */
|
|
|
|
register_init_routine(m2m_defragment_init);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Register Wimax Mac to Mac Protocol handler */
|
|
|
|
void proto_reg_handoff_m2m(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t m2m_handle;
|
|
|
|
|
|
|
|
m2m_handle = create_dissector_handle(dissect_m2m, proto_m2m);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("ethertype", ETHERTYPE_WMX_M2M, m2m_handle);
|
2009-08-03 22:09:08 +00:00
|
|
|
|
|
|
|
/* 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");
|
|
|
|
}
|