2004-03-25 11:21:07 +00:00
|
|
|
/* packet-sm.c
|
|
|
|
* Routines for Cisco Session Management Protocol dissection
|
|
|
|
* Copyright 2004, Duncan Sargeant <dunc-ethereal@rcpt.to>
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2004-03-25 11:21:07 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-03-25 11:21:07 +00:00
|
|
|
* Copyright 1998 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.
|
2010-10-11 19:00:55 +00:00
|
|
|
*
|
2004-03-25 11:21:07 +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.
|
2010-10-11 19:00:55 +00:00
|
|
|
*
|
2004-03-25 11:21:07 +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
|
2012-06-28 23:18:38 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2004-03-25 11:21:07 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is basically a glue dissector for the Cisco SM protocol. It sits
|
|
|
|
* between the RUDP and MTP3 layers in conversations on port 7000 between
|
|
|
|
* SLTs and MGCs. A link to an overview of the technology :
|
2010-10-11 19:00:55 +00:00
|
|
|
*
|
2004-03-25 11:21:07 +00:00
|
|
|
* http://www.cisco.com/en/US/products/sw/netmgtsw/ps4883/products_installation_and_configuration_guide_chapter09186a008010950a.html
|
|
|
|
*
|
|
|
|
* Link showing debugs of the protocol:
|
|
|
|
* http://www.cisco.com/univercd/cc/td/doc/product/access/sc/rel7/omts/omts_apb.htm#30052
|
|
|
|
*
|
|
|
|
* I'm unable to get local debugs of this protocol, as the SLT's are
|
|
|
|
* slow cpu cisco 2600's, and they tend to drop the signalling links
|
|
|
|
* if you turn any debugging on! But there's not much interesting
|
|
|
|
* here, its just glue to get the ISUP/MTP3 data nicely.
|
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2004-03-25 11:21:07 +00:00
|
|
|
|
2012-05-15 19:23:35 +00:00
|
|
|
#include <glib.h>
|
2004-03-25 11:21:07 +00:00
|
|
|
|
|
|
|
#include <epan/packet.h>
|
|
|
|
|
2012-05-15 19:23:35 +00:00
|
|
|
#define MESSAGE_TYPE_START 0
|
|
|
|
#define MESSAGE_TYPE_STOP 1
|
|
|
|
#define MESSAGE_TYPE_ACTIVE 2
|
|
|
|
#define MESSAGE_TYPE_STANDBY 3
|
|
|
|
#define MESSAGE_TYPE_Q_HOLD_INVOKE 4
|
|
|
|
#define MESSAGE_TYPE_Q_HOLD_RESPONSE 5
|
|
|
|
#define MESSAGE_TYPE_Q_RESUME_INVOKE 6
|
|
|
|
#define MESSAGE_TYPE_Q_RESUME_RESPONSE 7
|
|
|
|
#define MESSAGE_TYPE_Q_RESET_INVOKE 8
|
|
|
|
#define MESSAGE_TYPE_Q_RESET_RESPONSE 9
|
|
|
|
#define MESSAGE_TYPE_PDU 0x8000
|
2005-04-04 07:40:07 +00:00
|
|
|
|
2010-10-11 19:00:55 +00:00
|
|
|
static const value_string sm_message_type_value[] = {
|
|
|
|
{ MESSAGE_TYPE_START, "Start Message" },
|
|
|
|
{ MESSAGE_TYPE_STOP, "Stop Message" },
|
|
|
|
{ MESSAGE_TYPE_ACTIVE, "Active Message" },
|
|
|
|
{ MESSAGE_TYPE_STANDBY, "Standby Message" },
|
|
|
|
{ MESSAGE_TYPE_Q_HOLD_INVOKE, "Q_HOLD Invoke Message" },
|
|
|
|
{ MESSAGE_TYPE_Q_HOLD_RESPONSE, "Q_HOLD Response Message" },
|
|
|
|
{ MESSAGE_TYPE_Q_RESUME_INVOKE, "Q_RESUME Invoke Message" },
|
2005-04-04 07:40:07 +00:00
|
|
|
{ MESSAGE_TYPE_Q_RESUME_RESPONSE, "Q_RESUME Response Message" },
|
|
|
|
{ MESSAGE_TYPE_Q_RESET_INVOKE, "Q_RESET Invoke Message" },
|
|
|
|
{ MESSAGE_TYPE_Q_RESET_RESPONSE, "Q_RESET Response Message" },
|
|
|
|
{ MESSAGE_TYPE_PDU, "PDU Message" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2010-10-11 19:00:55 +00:00
|
|
|
static const value_string sm_message_type_value_info[] = {
|
2005-04-04 07:40:07 +00:00
|
|
|
{ MESSAGE_TYPE_START, "Start" },
|
|
|
|
{ MESSAGE_TYPE_STOP, "Stop" },
|
|
|
|
{ MESSAGE_TYPE_ACTIVE, "Active" },
|
|
|
|
{ MESSAGE_TYPE_STANDBY, "Standby" },
|
|
|
|
{ MESSAGE_TYPE_Q_HOLD_INVOKE, "Q_HOLD Invoke" },
|
|
|
|
{ MESSAGE_TYPE_Q_HOLD_RESPONSE, "Q_HOLD Response" },
|
|
|
|
{ MESSAGE_TYPE_Q_RESUME_INVOKE, "Q_RESUME Invoke" },
|
|
|
|
{ MESSAGE_TYPE_Q_RESUME_RESPONSE, "Q_RESUME Response" },
|
|
|
|
{ MESSAGE_TYPE_Q_RESET_INVOKE, "Q_RESET Invoke" },
|
|
|
|
{ MESSAGE_TYPE_Q_RESET_RESPONSE, "Q_RESET Response" },
|
|
|
|
{ MESSAGE_TYPE_PDU, "PDU" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#define PDU_MTP3_TO_SLT 0x10
|
|
|
|
#define PDU_MTP3_FROM_SLT 0x11
|
|
|
|
|
2010-10-11 19:00:55 +00:00
|
|
|
#define PDU_SET_STATE 0x44
|
|
|
|
#define PDU_RETURN_STATE 0x45
|
2005-04-04 07:40:07 +00:00
|
|
|
|
2010-10-11 19:00:55 +00:00
|
|
|
static const value_string sm_pdu_type_value[] = {
|
|
|
|
{ PDU_MTP3_TO_SLT, "mtp3 to SLT"},
|
2007-10-13 21:59:33 +00:00
|
|
|
{ PDU_MTP3_FROM_SLT, "mtp3 from SLT"},
|
2010-10-11 19:00:55 +00:00
|
|
|
{ PDU_SET_STATE, "set session state"},
|
|
|
|
{ PDU_RETURN_STATE, "return session state"},
|
2007-10-13 21:59:33 +00:00
|
|
|
{ 0, NULL }
|
2005-04-04 07:40:07 +00:00
|
|
|
};
|
|
|
|
|
2007-10-13 21:59:33 +00:00
|
|
|
/* TODO: Change to useful name once known */
|
2012-04-24 08:52:18 +00:00
|
|
|
#define SM_PROTOCOL_X004 0x0004 /* https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7188 */
|
|
|
|
/* RUDP/SM stack called BSM V1 (version 1 versus Version 0 used for SS7). */
|
2008-10-13 12:55:16 +00:00
|
|
|
#define SM_PROTOCOL_X100 0x0100
|
2007-10-13 21:59:33 +00:00
|
|
|
#define SM_PROTOCOL_X101 0x0101
|
|
|
|
#define SM_PROTOCOL_X114 0x0114
|
2008-10-13 12:55:16 +00:00
|
|
|
#define SM_PROTOCOL_X122 0x0122
|
2005-04-04 07:40:07 +00:00
|
|
|
|
|
|
|
|
2004-03-25 11:21:07 +00:00
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
static int proto_sm = -1;
|
|
|
|
|
|
|
|
static int hf_sm_sm_msg_type = -1;
|
|
|
|
static int hf_sm_protocol = -1;
|
|
|
|
static int hf_sm_msg_id = -1;
|
|
|
|
static int hf_sm_msg_type = -1;
|
|
|
|
static int hf_sm_channel = -1;
|
|
|
|
static int hf_sm_bearer = -1;
|
|
|
|
static int hf_sm_len = -1;
|
2007-10-13 21:59:33 +00:00
|
|
|
static int hf_sm_ip_addr = -1;
|
2007-11-09 06:01:18 +00:00
|
|
|
static int hf_sm_context = -1;
|
|
|
|
static int hf_sm_eisup_msg_id = -1;
|
2007-10-13 21:59:33 +00:00
|
|
|
static int hf_sm_tag = -1;
|
2004-03-25 11:21:07 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
static gint ett_sm = -1;
|
|
|
|
|
2007-10-13 21:59:33 +00:00
|
|
|
static dissector_handle_t sdp_handle;
|
2009-01-05 20:37:04 +00:00
|
|
|
static dissector_handle_t mtp3_handle;
|
2012-04-24 08:52:18 +00:00
|
|
|
static dissector_handle_t q931_handle;
|
2008-10-13 12:55:16 +00:00
|
|
|
static dissector_handle_t data_handle;
|
2007-10-13 21:59:33 +00:00
|
|
|
|
2004-03-25 11:21:07 +00:00
|
|
|
/* Code to actually dissect the packets */
|
|
|
|
static void
|
|
|
|
dissect_sm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *sm_tree;
|
|
|
|
tvbuff_t *next_tvb = NULL;
|
2005-04-04 07:40:07 +00:00
|
|
|
guint32 sm_message_type;
|
2007-10-13 21:59:33 +00:00
|
|
|
guint16 protocol;
|
2007-10-14 00:56:53 +00:00
|
|
|
guint16 msg_type = 0;
|
2007-10-13 21:59:33 +00:00
|
|
|
guint16 length;
|
|
|
|
guint16 tag;
|
2009-01-05 20:37:04 +00:00
|
|
|
int offset = 0;
|
2005-04-04 07:40:07 +00:00
|
|
|
|
2007-10-13 21:59:33 +00:00
|
|
|
sm_message_type = tvb_get_ntohl(tvb,offset);
|
2004-03-25 11:21:07 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SM");
|
2004-03-25 11:21:07 +00:00
|
|
|
|
2011-09-26 09:01:17 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Cisco SM Packet (%s)",
|
2012-08-10 22:55:02 +00:00
|
|
|
val_to_str_const(sm_message_type, sm_message_type_value_info,"reserved"));
|
2004-03-25 11:21:07 +00:00
|
|
|
|
2011-10-21 02:10:19 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_sm, tvb, offset, 0, ENC_NA);
|
2009-01-05 20:37:04 +00:00
|
|
|
sm_tree = proto_item_add_subtree(ti, ett_sm);
|
2005-04-04 07:40:07 +00:00
|
|
|
|
2009-01-05 20:37:04 +00:00
|
|
|
proto_tree_add_uint_format(sm_tree, hf_sm_sm_msg_type, tvb, offset, 4, sm_message_type,
|
2012-08-10 22:55:02 +00:00
|
|
|
"SM Message type: %s (0x%0x)", val_to_str_const(sm_message_type, sm_message_type_value, "reserved"), sm_message_type);
|
2007-10-13 21:59:33 +00:00
|
|
|
|
2009-01-05 20:37:04 +00:00
|
|
|
offset = offset + 4;
|
|
|
|
if (sm_message_type == MESSAGE_TYPE_PDU) {
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_protocol, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
protocol = tvb_get_ntohs(tvb,offset);
|
|
|
|
offset = offset + 2;
|
|
|
|
switch(protocol){
|
2012-04-24 08:52:18 +00:00
|
|
|
/* start case RUDP BSM v.1 ---------------------------------------------------------- */
|
|
|
|
case SM_PROTOCOL_X004:
|
|
|
|
if (!tree)
|
|
|
|
return;
|
|
|
|
|
2012-05-07 18:14:08 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_msg_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2012-04-24 08:52:18 +00:00
|
|
|
offset = offset +2;
|
|
|
|
msg_type = tvb_get_ntohs(tvb,offset);
|
|
|
|
proto_tree_add_uint_format(sm_tree, hf_sm_msg_type, tvb, offset, 2, msg_type,
|
2012-08-10 22:55:02 +00:00
|
|
|
"Message type: %s (0x%0x)", val_to_str_const(msg_type, sm_pdu_type_value, "reserved"),
|
2012-04-24 08:52:18 +00:00
|
|
|
msg_type);
|
|
|
|
msg_type = tvb_get_ntohs(tvb,offset);
|
|
|
|
offset = offset + 2;
|
2012-05-07 18:14:08 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_channel, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2012-04-24 08:52:18 +00:00
|
|
|
offset = offset + 2;
|
2012-05-07 18:14:08 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_bearer, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2012-04-24 08:52:18 +00:00
|
|
|
offset = offset +2;
|
2012-05-07 18:14:08 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2012-04-24 08:52:18 +00:00
|
|
|
length = tvb_get_ntohs(tvb,offset);
|
|
|
|
offset = offset +2;
|
|
|
|
proto_item_set_len(ti, 16);
|
|
|
|
|
|
|
|
if (length > 0) {
|
|
|
|
next_tvb = tvb_new_subset(tvb, offset, length, length);
|
|
|
|
|
|
|
|
if ((msg_type == PDU_MTP3_TO_SLT || msg_type == PDU_MTP3_FROM_SLT)) {
|
|
|
|
call_dissector(q931_handle, next_tvb, pinfo, tree);
|
|
|
|
} else {
|
|
|
|
call_dissector(data_handle, next_tvb, pinfo, tree);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
/* end case RUDP BSM v.1 ---------------------------------------------------------- */
|
|
|
|
|
2009-01-05 20:37:04 +00:00
|
|
|
case SM_PROTOCOL_X100:
|
|
|
|
case SM_PROTOCOL_X122:
|
|
|
|
if (!tree)
|
|
|
|
return;
|
|
|
|
/* Protocol 0x100/0x122 only contains a length and then an EISUP packet */
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
length = tvb_get_ntohs(tvb,offset);
|
2007-10-13 21:59:33 +00:00
|
|
|
offset = offset + 2;
|
2009-01-05 20:37:04 +00:00
|
|
|
proto_item_set_len(ti, 8);
|
|
|
|
|
|
|
|
/* This should be the EISUP dissector but we havent got one
|
|
|
|
* right now - so decode it as data for now ... */
|
|
|
|
next_tvb = tvb_new_subset(tvb, offset, length, length);
|
|
|
|
call_dissector(data_handle, next_tvb, pinfo, sm_tree);
|
|
|
|
|
|
|
|
break;
|
|
|
|
case SM_PROTOCOL_X101:
|
|
|
|
if (!tree)
|
|
|
|
return;
|
2012-05-15 19:23:35 +00:00
|
|
|
/* XXX Reverse enginered so this may not be correct!!!
|
2010-10-11 19:00:55 +00:00
|
|
|
* EISUP - used between Cisco HSI and Cisco PGW devices,
|
|
|
|
* uses RUDP with default port number 8003.
|
|
|
|
* Protocol stack is RUDP->Cisco SM->SDP.
|
|
|
|
* This implementation is PROPRIETARY
|
2009-01-05 20:37:04 +00:00
|
|
|
*/
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
length = tvb_get_ntohs(tvb,offset);
|
|
|
|
offset = offset + 2;
|
|
|
|
proto_item_set_len(ti, length + offset);
|
|
|
|
/* The next stuff seems to be IP addr */
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_ip_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
offset = offset + 4;
|
|
|
|
/* This part looks to be the same per session */
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_context, tvb, offset, 4, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
offset = offset +4;
|
|
|
|
/* Some sort of message type? */
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_eisup_msg_id, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
offset = offset + 1;
|
|
|
|
/* XXX Problem are tags 1 or two bytes???*/
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_tag, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
|
|
|
|
tag = tvb_get_ntohs(tvb,offset);
|
|
|
|
offset = offset +2;
|
|
|
|
if (tag== 0x01ac) {
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2007-10-13 21:59:33 +00:00
|
|
|
length = tvb_get_ntohs(tvb,offset);
|
|
|
|
offset = offset +2;
|
2009-01-05 20:37:04 +00:00
|
|
|
next_tvb = tvb_new_subset(tvb, offset, length, length);
|
|
|
|
call_dissector(sdp_handle, next_tvb, pinfo, sm_tree);
|
|
|
|
offset = offset+length;
|
2007-10-13 21:59:33 +00:00
|
|
|
|
2009-01-05 20:37:04 +00:00
|
|
|
}
|
|
|
|
/*return;*/
|
|
|
|
break;
|
|
|
|
case SM_PROTOCOL_X114:
|
|
|
|
if (!tree)
|
|
|
|
return;
|
2012-05-15 19:23:35 +00:00
|
|
|
/* XXX Reverse enginered so this may not be correct!!! */
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
length = tvb_get_ntohs(tvb,offset);
|
|
|
|
offset = offset + 2;
|
|
|
|
proto_item_set_len(ti, length + offset);
|
|
|
|
/* The next stuff seems to be IP addr */
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_ip_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
offset = offset + 4;
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_context, tvb, offset, 4, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
offset = offset +4;
|
|
|
|
/* Some sort of message type? */
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_eisup_msg_id, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
offset = offset + 1;
|
|
|
|
/* XXX Problem are tags 1 or two bytes???*/
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_tag, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
|
|
|
|
tag = tvb_get_ntohs(tvb,offset);
|
|
|
|
offset = offset +2;
|
|
|
|
if (tag== 0x01ac) {
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2007-10-13 21:59:33 +00:00
|
|
|
length = tvb_get_ntohs(tvb,offset);
|
|
|
|
offset = offset +2;
|
2009-01-05 20:37:04 +00:00
|
|
|
next_tvb = tvb_new_subset(tvb, offset, length, length);
|
|
|
|
call_dissector(sdp_handle, next_tvb, pinfo, sm_tree);
|
|
|
|
offset = offset+length;
|
2007-10-13 21:59:33 +00:00
|
|
|
|
2009-01-05 20:37:04 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_msg_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
offset = offset +2;
|
|
|
|
msg_type = tvb_get_ntohs(tvb,offset);
|
|
|
|
proto_tree_add_uint_format(sm_tree, hf_sm_msg_type, tvb, offset, 2, msg_type,
|
2012-08-10 22:55:02 +00:00
|
|
|
"Message type: %s (0x%0x)", val_to_str_const(msg_type, sm_pdu_type_value, "reserved"),
|
2009-01-05 20:37:04 +00:00
|
|
|
msg_type);
|
|
|
|
msg_type = tvb_get_ntohs(tvb,offset);
|
|
|
|
offset = offset + 2;
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_channel, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
offset = offset + 2;
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_bearer, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
offset = offset +2;
|
2011-09-26 09:01:17 +00:00
|
|
|
proto_tree_add_item(sm_tree, hf_sm_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-01-05 20:37:04 +00:00
|
|
|
length = tvb_get_ntohs(tvb,offset);
|
|
|
|
offset = offset +2;
|
|
|
|
proto_item_set_len(ti, 16);
|
|
|
|
|
|
|
|
if (length > 0) {
|
|
|
|
next_tvb = tvb_new_subset(tvb, offset, length, length);
|
|
|
|
|
|
|
|
if ((msg_type == PDU_MTP3_TO_SLT || msg_type == PDU_MTP3_FROM_SLT)) {
|
|
|
|
call_dissector(mtp3_handle, next_tvb, pinfo, tree);
|
|
|
|
} else {
|
|
|
|
call_dissector(data_handle, next_tvb, pinfo, tree);
|
2007-10-13 21:59:33 +00:00
|
|
|
}
|
|
|
|
}
|
2005-04-04 07:40:07 +00:00
|
|
|
}
|
2004-03-25 11:21:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2004-04-25 11:14:01 +00:00
|
|
|
void
|
|
|
|
proto_register_sm(void)
|
2010-10-11 19:00:55 +00:00
|
|
|
{
|
2004-03-25 11:21:07 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_sm_sm_msg_type,
|
|
|
|
{ "SM Message Type", "sm.sm_msg_type",
|
2010-10-11 19:00:55 +00:00
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-03-25 11:21:07 +00:00
|
|
|
},
|
|
|
|
{ &hf_sm_protocol,
|
|
|
|
{ "Protocol Type", "sm.protocol",
|
2010-10-11 19:00:55 +00:00
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-03-25 11:21:07 +00:00
|
|
|
},
|
|
|
|
{ &hf_sm_msg_id,
|
|
|
|
{ "Message ID", "sm.msgid",
|
2010-10-11 19:00:55 +00:00
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-03-25 11:21:07 +00:00
|
|
|
},
|
|
|
|
{ &hf_sm_msg_type,
|
|
|
|
{ "Message Type", "sm.msg_type",
|
2010-10-11 19:00:55 +00:00
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-03-25 11:21:07 +00:00
|
|
|
},
|
|
|
|
{ &hf_sm_channel,
|
|
|
|
{ "Channel ID", "sm.channel",
|
2010-10-11 19:00:55 +00:00
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-03-25 11:21:07 +00:00
|
|
|
},
|
|
|
|
{ &hf_sm_bearer,
|
|
|
|
{ "Bearer ID", "sm.bearer",
|
2010-10-11 19:00:55 +00:00
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-03-25 11:21:07 +00:00
|
|
|
},
|
|
|
|
{ &hf_sm_len,
|
|
|
|
{ "Length", "sm.len",
|
2010-10-11 19:00:55 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-03-25 11:21:07 +00:00
|
|
|
},
|
2007-10-13 21:59:33 +00:00
|
|
|
{ &hf_sm_ip_addr,
|
|
|
|
{ "IPv4 address","sm.ip_addr",
|
2010-10-11 19:00:55 +00:00
|
|
|
FT_IPv4,BASE_NONE, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2007-10-13 21:59:33 +00:00
|
|
|
},
|
2007-11-09 06:01:18 +00:00
|
|
|
{ &hf_sm_context,
|
|
|
|
{ "Context","sm.context",
|
2010-10-11 19:00:55 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
2007-11-09 06:01:18 +00:00
|
|
|
"Context(guesswork!)", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_sm_eisup_msg_id,
|
|
|
|
{ "Message id","sm.eisup_message_id",
|
2010-10-11 19:00:55 +00:00
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
2007-11-09 06:01:18 +00:00
|
|
|
"Message id(guesswork!)", HFILL }
|
|
|
|
},
|
2007-10-13 21:59:33 +00:00
|
|
|
{ &hf_sm_tag,
|
|
|
|
{ "Tag","sm.tag",
|
2010-10-11 19:00:55 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2007-10-13 21:59:33 +00:00
|
|
|
"Tag(guesswork!)", HFILL }
|
|
|
|
},
|
2004-03-25 11:21:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Setup protocol subtree array */
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_sm,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Register the protocol name and description */
|
|
|
|
proto_sm = proto_register_protocol("Cisco Session Management",
|
|
|
|
"SM", "sm");
|
|
|
|
|
|
|
|
register_dissector("sm", dissect_sm, proto_sm);
|
|
|
|
|
|
|
|
/* Required function calls to register the header fields and subtrees used */
|
|
|
|
proto_register_field_array(proto_sm, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
2010-10-11 19:00:55 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_sm(void)
|
|
|
|
{
|
|
|
|
sdp_handle = find_dissector("sdp");
|
|
|
|
mtp3_handle = find_dissector("mtp3");
|
2012-04-24 08:52:18 +00:00
|
|
|
q931_handle = find_dissector("q931");
|
2010-10-11 19:00:55 +00:00
|
|
|
data_handle = find_dissector("data");
|
|
|
|
}
|
|
|
|
|