2001-06-21 22:25:53 +00:00
|
|
|
/* packet-m2pa.c
|
|
|
|
* Routines for MTP2 Peer Adaptation Layer dissection
|
|
|
|
* It is hopefully (needs testing) compliant to
|
2002-09-20 06:35:15 +00:00
|
|
|
* http://www.ietf.org/internet-drafts/draft-ietf-sigtran-m2pa-06.txt
|
2001-06-21 22:25:53 +00:00
|
|
|
*
|
2002-08-28 21:04:11 +00:00
|
|
|
* Copyright 2001, 2002, Jeff Morriss <jeff.morriss[AT]ulticom.com>,
|
2002-08-27 19:28:23 +00:00
|
|
|
* updated by Michael Tuexen <michael.tuexen[AT]siemens.com>
|
2001-06-21 22:25:53 +00:00
|
|
|
*
|
2002-09-22 12:12:32 +00:00
|
|
|
* $Id: packet-m2pa.c,v 1.14 2002/09/22 12:12:32 tuexen Exp $
|
2001-06-21 22:25:53 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* Copied from packet-m3ua.c
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2001-06-21 22:25:53 +00:00
|
|
|
* 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2001-06-21 22:25:53 +00:00
|
|
|
* 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
2001-06-21 22:25:53 +00:00
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2002-04-08 19:18:11 +00:00
|
|
|
|
2001-06-21 22:25:53 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2001-06-21 22:25:53 +00:00
|
|
|
|
2002-08-27 19:28:23 +00:00
|
|
|
#define NETWORK_BYTE_ORDER FALSE
|
|
|
|
#define SCTP_PORT_M2PA 3565
|
|
|
|
#define M2PA_PAYLOAD_PROTOCOL_ID 5
|
|
|
|
|
|
|
|
static int proto_m2pa = -1;
|
|
|
|
static int hf_version = -1;
|
|
|
|
static int hf_spare = -1;
|
|
|
|
static int hf_type = -1;
|
|
|
|
static int hf_class = -1;
|
|
|
|
static int hf_length = -1;
|
|
|
|
static int hf_unused = -1;
|
|
|
|
static int hf_bsn = -1;
|
|
|
|
static int hf_fsn = -1;
|
|
|
|
static int hf_status = -1;
|
|
|
|
static int hf_li_spare = -1;
|
|
|
|
static int hf_li_prio = -1;
|
|
|
|
static int hf_filler = -1;
|
|
|
|
static int hf_unknown_data = -1;
|
|
|
|
|
|
|
|
static gint ett_m2pa = -1;
|
|
|
|
static gint ett_m2pa_li = -1;
|
|
|
|
|
|
|
|
static int mtp3_proto_id;
|
|
|
|
static dissector_handle_t mtp3_handle;
|
2001-06-21 22:25:53 +00:00
|
|
|
|
|
|
|
#define VERSION_LENGTH 1
|
|
|
|
#define SPARE_LENGTH 1
|
2001-12-03 20:35:14 +00:00
|
|
|
#define CLASS_LENGTH 1
|
|
|
|
#define TYPE_LENGTH 1
|
|
|
|
#define LENGTH_LENGTH 4
|
2002-08-27 19:28:23 +00:00
|
|
|
#define UNUSED_LENGTH 1
|
|
|
|
#define BSN_LENGTH 3
|
|
|
|
#define FSN_LENGTH 3
|
2002-03-28 21:41:30 +00:00
|
|
|
|
|
|
|
#define HEADER_LENGTH (VERSION_LENGTH + SPARE_LENGTH + \
|
|
|
|
CLASS_LENGTH + TYPE_LENGTH + LENGTH_LENGTH + \
|
2002-08-27 19:28:23 +00:00
|
|
|
UNUSED_LENGTH + BSN_LENGTH + UNUSED_LENGTH + FSN_LENGTH)
|
2001-06-21 22:25:53 +00:00
|
|
|
|
2002-08-27 19:28:23 +00:00
|
|
|
#define HEADER_OFFSET 0
|
|
|
|
#define VERSION_OFFSET HEADER_OFFSET
|
2001-06-21 22:25:53 +00:00
|
|
|
#define SPARE_OFFSET (VERSION_OFFSET + VERSION_LENGTH)
|
2001-12-03 20:35:14 +00:00
|
|
|
#define CLASS_OFFSET (SPARE_OFFSET + SPARE_LENGTH)
|
|
|
|
#define TYPE_OFFSET (CLASS_OFFSET + CLASS_LENGTH)
|
|
|
|
#define LENGTH_OFFSET (TYPE_OFFSET + TYPE_LENGTH)
|
2002-08-27 19:28:23 +00:00
|
|
|
#define FIRST_UNUSED_OFFSET (LENGTH_OFFSET + LENGTH_LENGTH)
|
|
|
|
#define BSN_OFFSET (FIRST_UNUSED_OFFSET + UNUSED_LENGTH)
|
|
|
|
#define SECOND_UNUSED_OFFSET (BSN_OFFSET + BSN_LENGTH)
|
|
|
|
#define FSN_OFFSET (SECOND_UNUSED_OFFSET + UNUSED_LENGTH)
|
2001-06-21 22:25:53 +00:00
|
|
|
|
|
|
|
#define PROTOCOL_VERSION_RELEASE_1 1
|
2002-08-27 19:28:23 +00:00
|
|
|
|
|
|
|
static const value_string protocol_version_values[] = {
|
2001-06-21 22:25:53 +00:00
|
|
|
{ PROTOCOL_VERSION_RELEASE_1, "Release 1" },
|
|
|
|
{ 0, NULL } };
|
|
|
|
|
2001-12-03 20:35:14 +00:00
|
|
|
#define MESSAGE_CLASS_M2PA 0xb
|
|
|
|
|
2002-08-27 19:28:23 +00:00
|
|
|
static const value_string message_class_values[] = {
|
2001-12-03 20:35:14 +00:00
|
|
|
{ MESSAGE_CLASS_M2PA, "M2PA" },
|
|
|
|
{ 0, NULL } };
|
|
|
|
|
|
|
|
#define MESSAGE_TYPE_USER_DATA 0x1
|
|
|
|
#define MESSAGE_TYPE_LINK_STATUS 0x2
|
|
|
|
|
2002-08-27 19:28:23 +00:00
|
|
|
static const value_string message_type_values[] = {
|
2001-06-21 22:25:53 +00:00
|
|
|
{ MESSAGE_TYPE_USER_DATA, "User Data" },
|
|
|
|
{ MESSAGE_TYPE_LINK_STATUS, "Link Status" },
|
|
|
|
{ 0, NULL } };
|
|
|
|
|
2002-08-27 19:28:23 +00:00
|
|
|
static void
|
|
|
|
dissect_m2pa_header(tvbuff_t *header_tvb, proto_tree *m2pa_tree)
|
|
|
|
{
|
|
|
|
if (m2pa_tree) {
|
|
|
|
proto_tree_add_item(m2pa_tree, hf_version, header_tvb, VERSION_OFFSET, VERSION_LENGTH, NETWORK_BYTE_ORDER);
|
|
|
|
proto_tree_add_item(m2pa_tree, hf_spare, header_tvb, SPARE_OFFSET, SPARE_LENGTH, NETWORK_BYTE_ORDER);
|
|
|
|
proto_tree_add_item(m2pa_tree, hf_class, header_tvb, CLASS_OFFSET, CLASS_LENGTH, NETWORK_BYTE_ORDER);
|
|
|
|
proto_tree_add_item(m2pa_tree, hf_type, header_tvb, TYPE_OFFSET, TYPE_LENGTH, NETWORK_BYTE_ORDER);
|
|
|
|
proto_tree_add_item(m2pa_tree, hf_length, header_tvb, LENGTH_OFFSET, LENGTH_LENGTH, NETWORK_BYTE_ORDER);
|
|
|
|
proto_tree_add_item(m2pa_tree, hf_unused, header_tvb, FIRST_UNUSED_OFFSET, UNUSED_LENGTH, NETWORK_BYTE_ORDER);
|
|
|
|
proto_tree_add_item(m2pa_tree, hf_bsn, header_tvb, BSN_OFFSET, BSN_LENGTH, NETWORK_BYTE_ORDER);
|
|
|
|
proto_tree_add_item(m2pa_tree, hf_unused, header_tvb, SECOND_UNUSED_OFFSET, UNUSED_LENGTH, NETWORK_BYTE_ORDER);
|
|
|
|
proto_tree_add_item(m2pa_tree, hf_fsn, header_tvb, FSN_OFFSET, FSN_LENGTH, NETWORK_BYTE_ORDER);
|
|
|
|
}
|
|
|
|
}
|
2001-06-21 22:25:53 +00:00
|
|
|
|
|
|
|
#define LI_OFFSET 0
|
|
|
|
#define LI_LENGTH 1
|
2001-12-03 20:35:14 +00:00
|
|
|
#define MTP3_OFFSET (LI_OFFSET + LI_LENGTH)
|
2002-08-27 19:28:23 +00:00
|
|
|
#define LI_SPARE_MASK 0x3f
|
|
|
|
#define LI_PRIORITY_MASK 0xc0
|
2001-06-21 22:25:53 +00:00
|
|
|
|
2002-08-27 19:28:23 +00:00
|
|
|
static void
|
|
|
|
dissect_m2pa_user_data_message(tvbuff_t *message_data_tvb, packet_info *pinfo, proto_item *m2pa_item, proto_tree *m2pa_tree, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *m2pa_li_item;
|
|
|
|
proto_tree *m2pa_li_tree;
|
|
|
|
tvbuff_t *payload_tvb;
|
2001-06-21 22:25:53 +00:00
|
|
|
|
2002-09-22 12:12:32 +00:00
|
|
|
if (tvb_length(message_data_tvb) > 0) {
|
|
|
|
if (m2pa_tree) {
|
|
|
|
m2pa_li_item = proto_tree_add_text(m2pa_tree, message_data_tvb, LI_OFFSET, LI_LENGTH, "Length Indicator");
|
|
|
|
m2pa_li_tree = proto_item_add_subtree(m2pa_li_item, ett_m2pa_li);
|
|
|
|
proto_tree_add_item(m2pa_li_tree, hf_li_prio, message_data_tvb, LI_OFFSET, LI_LENGTH, NETWORK_BYTE_ORDER);
|
|
|
|
proto_tree_add_item(m2pa_li_tree, hf_li_spare, message_data_tvb, LI_OFFSET, LI_LENGTH, NETWORK_BYTE_ORDER);
|
|
|
|
/* Re-adjust length of M2PA item since it will be dissected as MTP3 */
|
|
|
|
proto_item_set_len(m2pa_item, HEADER_LENGTH + LI_LENGTH);
|
|
|
|
}
|
|
|
|
|
|
|
|
payload_tvb = tvb_new_subset(message_data_tvb, MTP3_OFFSET, -1, -1);
|
|
|
|
call_dissector(mtp3_handle, payload_tvb, pinfo, tree);
|
|
|
|
if ((!(proto_is_protocol_enabled (mtp3_proto_id))) && (check_col(pinfo->cinfo, COL_INFO)))
|
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "User Data ");
|
|
|
|
} else {
|
2002-08-27 19:28:23 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2002-09-22 12:12:32 +00:00
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "User Data ");
|
|
|
|
}
|
2002-08-27 19:28:23 +00:00
|
|
|
}
|
2001-06-21 22:25:53 +00:00
|
|
|
|
|
|
|
#define STATUS_LENGTH 4
|
|
|
|
#define STATUS_OFFSET 0
|
2002-03-28 21:41:30 +00:00
|
|
|
#define FILLER_OFFSET (STATUS_OFFSET + STATUS_LENGTH)
|
2001-06-21 22:25:53 +00:00
|
|
|
|
2001-12-03 20:35:14 +00:00
|
|
|
#define STATUS_ALIGNMENT 1
|
|
|
|
#define STATUS_PROVING_NORMAL 2
|
|
|
|
#define STATUS_PROVING_EMERGENCY 3
|
|
|
|
#define STATUS_READY 4
|
|
|
|
#define STATUS_PROCESSOR_OUTAGE 5
|
|
|
|
#define STATUS_PROCESSOR_OUTAGE_ENDED 6
|
|
|
|
#define STATUS_BUSY 7
|
|
|
|
#define STATUS_BUSY_ENDED 8
|
2002-03-28 21:41:30 +00:00
|
|
|
#define STATUS_OUT_OF_SERVICE 9
|
2001-12-03 20:35:14 +00:00
|
|
|
|
2002-08-27 19:28:23 +00:00
|
|
|
static const value_string link_status_values[] = {
|
|
|
|
{ STATUS_ALIGNMENT, "Alignment" },
|
|
|
|
{ STATUS_PROVING_NORMAL, "Proving Normal" },
|
|
|
|
{ STATUS_PROVING_EMERGENCY, "Proving Emergency" },
|
2002-08-28 21:04:11 +00:00
|
|
|
{ STATUS_READY, "Ready" },
|
2002-08-27 19:28:23 +00:00
|
|
|
{ STATUS_PROCESSOR_OUTAGE, "Processor Outage" },
|
|
|
|
{ STATUS_PROCESSOR_OUTAGE_ENDED, "Processor Outage Ended" },
|
|
|
|
{ STATUS_BUSY, "Busy" },
|
|
|
|
{ STATUS_BUSY_ENDED, "Busy Ended" },
|
|
|
|
{ STATUS_OUT_OF_SERVICE, "Out of Service" },
|
|
|
|
{ 0, NULL } };
|
2001-06-21 22:25:53 +00:00
|
|
|
|
|
|
|
static void
|
2002-08-27 19:28:23 +00:00
|
|
|
dissect_m2pa_link_status_message(tvbuff_t *message_data_tvb, packet_info *pinfo, proto_tree *m2pa_tree)
|
2001-06-21 22:25:53 +00:00
|
|
|
{
|
2002-03-28 21:41:30 +00:00
|
|
|
guint16 filler_length;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-08-27 19:28:23 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "Link status ");
|
2001-06-21 22:25:53 +00:00
|
|
|
if (m2pa_tree) {
|
2002-03-28 21:41:30 +00:00
|
|
|
filler_length = tvb_length(message_data_tvb) - STATUS_LENGTH;
|
2002-08-27 19:28:23 +00:00
|
|
|
proto_tree_add_item(m2pa_tree, hf_status, message_data_tvb, STATUS_OFFSET, STATUS_LENGTH, NETWORK_BYTE_ORDER);
|
2002-05-18 22:25:40 +00:00
|
|
|
if (filler_length > 0)
|
2002-08-27 19:28:23 +00:00
|
|
|
proto_tree_add_item(m2pa_tree, hf_filler, message_data_tvb, FILLER_OFFSET, filler_length, NETWORK_BYTE_ORDER);
|
2002-03-28 21:41:30 +00:00
|
|
|
}
|
2001-12-03 20:35:14 +00:00
|
|
|
}
|
2001-06-21 22:25:53 +00:00
|
|
|
|
2001-12-03 20:35:14 +00:00
|
|
|
static void
|
2002-08-27 19:28:23 +00:00
|
|
|
dissect_m2pa_unknown_message(tvbuff_t *message_data_tvb, packet_info *pinfo, proto_tree *m2pa_tree)
|
2002-08-28 21:04:11 +00:00
|
|
|
{
|
2002-08-27 19:28:23 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, "Unknown ");
|
|
|
|
if (m2pa_tree)
|
|
|
|
proto_tree_add_item(m2pa_tree, hf_unknown_data, message_data_tvb, 0, tvb_length(message_data_tvb), NETWORK_BYTE_ORDER);
|
2001-12-03 20:35:14 +00:00
|
|
|
}
|
2001-06-21 22:25:53 +00:00
|
|
|
|
2002-08-27 19:28:23 +00:00
|
|
|
#define MESSAGE_DATA_OFFSET (HEADER_OFFSET + HEADER_LENGTH)
|
|
|
|
|
2001-12-03 20:35:14 +00:00
|
|
|
static void
|
|
|
|
dissect_m2pa_message_data(tvbuff_t *message_tvb, packet_info *pinfo, proto_item *m2pa_item, proto_tree *m2pa_tree, proto_tree *tree)
|
|
|
|
{
|
|
|
|
guint32 message_data_length;
|
|
|
|
guint8 type;
|
|
|
|
tvbuff_t *message_data_tvb;
|
|
|
|
|
2002-03-28 21:41:30 +00:00
|
|
|
message_data_length = tvb_get_ntohl(message_tvb, LENGTH_OFFSET) - HEADER_LENGTH;
|
2001-12-03 20:35:14 +00:00
|
|
|
message_data_tvb = tvb_new_subset(message_tvb, MESSAGE_DATA_OFFSET, message_data_length, message_data_length);
|
|
|
|
type = tvb_get_guint8(message_tvb, TYPE_OFFSET);
|
2001-06-21 22:25:53 +00:00
|
|
|
|
2001-12-03 20:35:14 +00:00
|
|
|
switch(type) {
|
2001-06-21 22:25:53 +00:00
|
|
|
case MESSAGE_TYPE_USER_DATA:
|
2001-12-03 20:35:14 +00:00
|
|
|
dissect_m2pa_user_data_message(message_data_tvb, pinfo, m2pa_item, m2pa_tree, tree);
|
|
|
|
break;
|
2001-06-21 22:25:53 +00:00
|
|
|
|
|
|
|
case MESSAGE_TYPE_LINK_STATUS:
|
2002-08-27 19:28:23 +00:00
|
|
|
dissect_m2pa_link_status_message(message_data_tvb, pinfo, m2pa_tree);
|
2001-06-21 22:25:53 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2002-08-27 19:28:23 +00:00
|
|
|
dissect_m2pa_unknown_message(message_data_tvb, pinfo, m2pa_tree);
|
2001-06-21 22:25:53 +00:00
|
|
|
}
|
|
|
|
|
2001-12-03 20:35:14 +00:00
|
|
|
}
|
|
|
|
static void
|
|
|
|
dissect_m2pa_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_item *m2pa_item, proto_tree *m2pa_tree, proto_tree *tree)
|
|
|
|
{
|
2002-03-28 21:41:30 +00:00
|
|
|
tvbuff_t *header_tvb;
|
2001-12-03 20:35:14 +00:00
|
|
|
|
2002-03-28 21:41:30 +00:00
|
|
|
header_tvb = tvb_new_subset(message_tvb, HEADER_OFFSET, HEADER_LENGTH, HEADER_LENGTH);
|
2002-08-27 19:28:23 +00:00
|
|
|
dissect_m2pa_header(header_tvb, m2pa_tree);
|
2001-12-03 20:35:14 +00:00
|
|
|
dissect_m2pa_message_data(message_tvb, pinfo, m2pa_item, m2pa_tree, tree);
|
2001-06-21 22:25:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_m2pa(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *m2pa_item;
|
|
|
|
proto_tree *m2pa_tree;
|
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "M2PA");
|
2001-06-21 22:25:53 +00:00
|
|
|
|
|
|
|
if (tree) {
|
Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOL
items to the protocol tree; it's interpreted as "the rest of the data in
the tvbuff". This can be used if
1) the item covers the entire packet or the remaining payload in
the packet
or
2) the item's length won't be known until it's dissected, and
will be then set with "proto_item_set_len()" - if an
exception is thrown in the dissection, it means the item ran
*past* the end of the tvbuff, so saying it runs to the end of
the tvbuff is reasonable.
Convert a number of "proto_tree_add_XXX()" calls using
"tvb_length_remaining()", values derived from the result of
"tvb_length()", or 0 (in the case of items whose length is unknown) to
use -1 instead (using 0 means that if an exception is thrown, selecting
the item highlights nothing; using -1 means it highlights all the data
for that item that's available).
In some places where "tvb_length()" or "tvb_length_remaining()" was used
to determine how large a packet is, use "tvb_reported_length()" or
"tvb_reported_length_remaining()", instead - the first two calls
indicate how much captured data was in the packet, the latter two calls
indicate how large the packet actually was (and the fact that using the
latter could cause BoundsError exceptions to be thrown is a feature - if
such an exception is thrown, the frame really *was* short, and it should
be tagged as such).
Replace some "proto_tree_add_XXX()" calls with equivalent
"proto_tree_add_item()" calls.
Fix some indentation.
svn path=/trunk/; revision=4578
2002-01-20 22:12:39 +00:00
|
|
|
m2pa_item = proto_tree_add_item(tree, proto_m2pa, tvb, 0, -1, FALSE);
|
2001-06-21 22:25:53 +00:00
|
|
|
m2pa_tree = proto_item_add_subtree(m2pa_item, ett_m2pa);
|
|
|
|
} else {
|
|
|
|
m2pa_item = NULL;
|
|
|
|
m2pa_tree = NULL;
|
|
|
|
};
|
|
|
|
|
|
|
|
dissect_m2pa_message(tvb, pinfo, m2pa_item, m2pa_tree, tree);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_m2pa(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
2002-08-27 19:28:23 +00:00
|
|
|
{ &hf_version, { "Version", "m2pa.version", FT_UINT8, BASE_DEC, VALS(protocol_version_values), 0x0, "", HFILL} },
|
|
|
|
{ &hf_spare, { "Spare", "m2pa.spare", FT_UINT8, BASE_HEX, NULL, 0x0, "", HFILL} },
|
|
|
|
{ &hf_type, { "Message Type", "m2pa.type", FT_UINT8, BASE_DEC, VALS(message_type_values), 0x0, "", HFILL} },
|
|
|
|
{ &hf_class, { "Message Class", "m2pa.class", FT_UINT8, BASE_DEC, VALS(message_class_values), 0x0, "", HFILL} },
|
|
|
|
{ &hf_length, { "Message length", "m2pa.length", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL} },
|
|
|
|
{ &hf_unused, { "Unused", "m2pa.unused", FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL} },
|
|
|
|
{ &hf_bsn, { "BSN", "m2pa.bsn", FT_UINT24, BASE_DEC, NULL, 0x0, "", HFILL} },
|
|
|
|
{ &hf_fsn, { "FSN", "m2pa.fsn", FT_UINT24, BASE_DEC, NULL, 0x0, "", HFILL} },
|
|
|
|
{ &hf_li_spare, { "Spare", "m2pa.li_spare", FT_UINT8, BASE_HEX, NULL, LI_SPARE_MASK, "", HFILL} },
|
|
|
|
{ &hf_li_prio, { "Priority", "m2pa.li_priority", FT_UINT8, BASE_HEX, NULL, LI_PRIORITY_MASK, "", HFILL} },
|
|
|
|
{ &hf_status, { "Link Status", "m2pa.status", FT_UINT32, BASE_DEC, VALS(link_status_values), 0x0, "", HFILL} },
|
|
|
|
{ &hf_filler, { "Filler", "m2pa.filler", FT_BYTES, BASE_NONE, NULL, 0x0, "", HFILL } },
|
|
|
|
{ &hf_unknown_data, { "Unknown Data", "m2pa.unknown_data", FT_BYTES, BASE_NONE, NULL, 0x0, "", HFILL } }
|
2001-06-21 22:25:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_m2pa,
|
2001-12-03 20:35:14 +00:00
|
|
|
&ett_m2pa_li
|
2001-06-21 22:25:53 +00:00
|
|
|
};
|
|
|
|
|
2002-09-20 06:35:15 +00:00
|
|
|
proto_m2pa = proto_register_protocol("MTP2 Peer Adaptation Layer", "M2PA", "m2pa");
|
2001-06-21 22:25:53 +00:00
|
|
|
|
|
|
|
proto_register_field_array(proto_m2pa, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2002-08-27 19:28:23 +00:00
|
|
|
}
|
2001-06-21 22:25:53 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_m2pa(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t m2pa_handle;
|
|
|
|
|
2002-08-27 19:28:23 +00:00
|
|
|
mtp3_handle = find_dissector("mtp3");
|
|
|
|
mtp3_proto_id = proto_get_id_by_filter_name("mtp3");
|
|
|
|
m2pa_handle = create_dissector_handle(dissect_m2pa, proto_m2pa);
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_add("sctp.ppi", M2PA_PAYLOAD_PROTOCOL_ID, m2pa_handle);
|
2002-08-27 19:28:23 +00:00
|
|
|
dissector_add("sctp.port", SCTP_PORT_M2PA, m2pa_handle);
|
2002-08-28 21:04:11 +00:00
|
|
|
}
|