2004-11-24 02:59:49 +00:00
|
|
|
/* packet-sscf-nni.c
|
|
|
|
* Routines for SSCF-NNI (Q.2140) frame disassembly
|
2011-09-01 14:30:16 +00:00
|
|
|
* Jeff Morriss <jeff.morriss.ws [AT] gmail.com>
|
2004-11-24 02:59:49 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* $Id$
|
2004-11-24 02:59:49 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-11-24 02:59:49 +00:00
|
|
|
* Copyright 1998
|
|
|
|
*
|
|
|
|
* Copied from packet-sscop.c
|
|
|
|
*
|
|
|
|
* 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.
|
2004-11-24 02:59:49 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet.h>
|
|
|
|
|
|
|
|
static int proto_sscf = -1;
|
|
|
|
|
|
|
|
static gint ett_sscf = -1;
|
|
|
|
|
|
|
|
static dissector_handle_t mtp3_handle;
|
|
|
|
|
|
|
|
#define SSCF_PDU_LENGTH 4
|
|
|
|
#define SSCF_STATUS_OFFSET 3
|
|
|
|
#define SSCF_STATUS_LENGTH 1
|
|
|
|
#define SSCF_SPARE_OFFSET 0
|
|
|
|
#define SSCF_SPARE_LENGTH 3
|
|
|
|
|
|
|
|
static int hf_status = -1;
|
|
|
|
static int hf_spare = -1;
|
|
|
|
|
|
|
|
#define SSCF_STATUS_OOS 0x01
|
|
|
|
#define SSCF_STATUS_PO 0x02
|
|
|
|
#define SSCF_STATUS_IS 0x03
|
|
|
|
#define SSCF_STATUS_NORMAL 0x04
|
|
|
|
#define SSCF_STATUS_EMERGENCY 0x05
|
|
|
|
#define SSCF_STATUS_ALIGNMENT_NOT_SUCCESSFUL 0x7
|
|
|
|
#define SSCF_STATUS_MANAGEMENT_INITIATED 0x08
|
|
|
|
#define SSCF_STATUS_PROTOCOL_ERROR 0x09
|
|
|
|
#define SSCF_STATUS_PROVING_NOT_SUCCESSFUL 0x0a
|
|
|
|
|
|
|
|
static const value_string sscf_status_vals[] = {
|
|
|
|
{ SSCF_STATUS_OOS, "Out of Service" },
|
|
|
|
{ SSCF_STATUS_PO, "Processor Outage" },
|
|
|
|
{ SSCF_STATUS_IS, "In Service" },
|
|
|
|
{ SSCF_STATUS_NORMAL, "Normal" },
|
|
|
|
{ SSCF_STATUS_EMERGENCY, "Emergency" },
|
|
|
|
{ SSCF_STATUS_ALIGNMENT_NOT_SUCCESSFUL, "Alignment Not Successful" },
|
|
|
|
{ SSCF_STATUS_MANAGEMENT_INITIATED, "Management Initiated" },
|
|
|
|
{ SSCF_STATUS_PROTOCOL_ERROR, "Protocol Error" },
|
|
|
|
{ SSCF_STATUS_PROVING_NOT_SUCCESSFUL, "Proving Not Successful" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_sscf_nni(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
guint reported_length;
|
|
|
|
proto_item *sscf_item = NULL;
|
|
|
|
proto_tree *sscf_tree = NULL;
|
|
|
|
guint8 sscf_status;
|
|
|
|
|
|
|
|
reported_length = tvb_reported_length(tvb); /* frame length */
|
|
|
|
|
|
|
|
if (tree) {
|
2011-10-21 02:10:19 +00:00
|
|
|
sscf_item = proto_tree_add_item(tree, proto_sscf, tvb, 0, -1, ENC_NA);
|
2004-11-24 02:59:49 +00:00
|
|
|
sscf_tree = proto_item_add_subtree(sscf_item, ett_sscf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (reported_length > SSCF_PDU_LENGTH)
|
|
|
|
{
|
|
|
|
call_dissector(mtp3_handle, tvb, pinfo, tree);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
sscf_status = tvb_get_guint8(tvb, SSCF_STATUS_OFFSET);
|
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SSCF-NNI");
|
2004-11-24 02:59:49 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "STATUS (%s) ",
|
|
|
|
val_to_str(sscf_status, sscf_status_vals, "Unknown"));
|
|
|
|
|
2011-09-01 14:30:16 +00:00
|
|
|
|
2004-11-24 02:59:49 +00:00
|
|
|
proto_tree_add_item(sscf_tree, hf_status, tvb, SSCF_STATUS_OFFSET,
|
2011-10-06 03:35:44 +00:00
|
|
|
SSCF_STATUS_LENGTH, ENC_BIG_ENDIAN);
|
2004-11-24 02:59:49 +00:00
|
|
|
proto_tree_add_item(sscf_tree, hf_spare, tvb, SSCF_SPARE_OFFSET,
|
2011-10-06 03:35:44 +00:00
|
|
|
SSCF_SPARE_LENGTH, ENC_BIG_ENDIAN);
|
2004-11-24 02:59:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_sscf(void)
|
|
|
|
{
|
2011-09-01 14:30:16 +00:00
|
|
|
static hf_register_info hf[] =
|
2004-11-24 02:59:49 +00:00
|
|
|
{ { &hf_status, { "Status", "sscf-nni.status", FT_UINT8, BASE_HEX,
|
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
|
|
|
VALS(sscf_status_vals), 0x0, NULL, HFILL} },
|
2004-11-24 02:59:49 +00:00
|
|
|
{ &hf_spare, { "Spare", "sscf-nni.spare", FT_UINT24, BASE_HEX,
|
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, 0x0, NULL, HFILL} }
|
2004-11-24 02:59:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_sscf,
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_sscf = proto_register_protocol("SSCF-NNI", "SSCF-NNI", "sscf-nni");
|
|
|
|
|
|
|
|
proto_register_field_array(proto_sscf, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
|
|
|
register_dissector("sscf-nni", dissect_sscf_nni, proto_sscf);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_sscf(void)
|
|
|
|
{
|
|
|
|
mtp3_handle = find_dissector("mtp3");
|
|
|
|
}
|