From Jeff Morriss:

make ANSI point codes filterable in MTP3;

	fix a bug in the ANSI SLS dissection;

	have MTP3 store the SI for use by subdissectors;

	add a new MTP3-Management dissector.

Fix Makefile.nmake to include the Wellfleet HDLC dissector.

svn path=/trunk/; revision=6837
This commit is contained in:
Guy Harris 2003-01-02 20:44:32 +00:00
parent 6664e10070
commit 87ed53914b
7 changed files with 1354 additions and 76 deletions

View File

@ -1,7 +1,7 @@
# Makefile.am
# Automake file for Ethereal
#
# $Id: Makefile.am,v 1.531 2002/12/31 08:05:28 guy Exp $
# $Id: Makefile.am,v 1.532 2003/01/02 20:44:31 guy Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@ethereal.com>
@ -261,6 +261,7 @@ DISSECTOR_SRC = \
packet-msproxy.c \
packet-mtp2.c \
packet-mtp3.c \
packet-mtp3mg.c \
packet-nbipx.c \
packet-nbns.c \
packet-ncp.c \

View File

@ -1,7 +1,7 @@
## Makefile for building ethereal.exe with Microsoft C and nmake
## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
#
# $Id: Makefile.nmake,v 1.265 2002/12/31 08:05:29 guy Exp $
# $Id: Makefile.nmake,v 1.266 2003/01/02 20:44:32 guy Exp $
include config.nmake
include <win32.mak>
@ -204,6 +204,7 @@ DISSECTOR_SRC = \
packet-msproxy.c \
packet-mtp2.c \
packet-mtp3.c \
packet-mtp3mg.c \
packet-nbipx.c \
packet-nbns.c \
packet-ncp.c \
@ -314,6 +315,7 @@ DISSECTOR_SRC = \
packet-wap.c \
packet-wccp.c \
packet-wcp.c \
packet-wfleet-hdlc.c \
packet-who.c \
packet-wlancap.c \
packet-wsp.c \

View File

@ -3,7 +3,7 @@
* Copyright 2001, Michael Tuexen <Michael.Tuexen@icn.siemens.de>
* Updated for ANSI support by Jeff Morriss <jeff.morriss[AT]ulticom.com>
*
* $Id: packet-mtp3.c,v 1.12 2002/06/20 20:40:36 guy Exp $
* $Id: packet-mtp3.c,v 1.13 2003/01/02 20:44:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -32,6 +32,10 @@
#include <glib.h>
#ifdef NEED_SNPRINTF_H
#include "snprintf.h"
#endif
#include <epan/packet.h>
#include "prefs.h"
@ -44,10 +48,12 @@ static int hf_mtp3_network_indicator = -1;
static int hf_mtp3_itu_spare = -1;
static int hf_mtp3_ansi_priority = -1;
static int hf_mtp3_itu_opc = -1;
static int hf_mtp3_ansi_opc = -1;
static int hf_mtp3_opc_network = -1;
static int hf_mtp3_opc_cluster = -1;
static int hf_mtp3_opc_member = -1;
static int hf_mtp3_itu_dpc = -1;
static int hf_mtp3_ansi_dpc = -1;
static int hf_mtp3_dpc_network = -1;
static int hf_mtp3_dpc_cluster = -1;
static int hf_mtp3_dpc_member = -1;
@ -135,7 +141,7 @@ static const value_string network_indicator_vals[] = {
static dissector_handle_t data_handle;
static void
dissect_mtp3_sio(tvbuff_t *tvb, proto_tree *mtp3_tree)
dissect_mtp3_sio(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mtp3_tree)
{
guint8 sio;
proto_item *sio_item;
@ -162,6 +168,9 @@ dissect_mtp3_sio(tvbuff_t *tvb, proto_tree *mtp3_tree)
proto_tree_add_uint(sio_tree, hf_mtp3_service_indicator, tvb, SIO_OFFSET,
SIO_LENGTH, sio);
/* Store the SI so that subidissectors know what SI this msg is */
pinfo->private_data = (void *)(sio & SERVICE_INDICATOR_MASK);
}
static void
@ -171,6 +180,7 @@ dissect_mtp3_routing_label(tvbuff_t *tvb, proto_tree *mtp3_tree)
guint8 sls;
proto_item *label_item, *label_dpc_item, *label_opc_item;
proto_tree *label_tree, *label_dpc_tree, *label_opc_tree;
char pc[ANSI_PC_STRING_LENGTH];
switch (mtp3_standard) {
case ITU_STANDARD:
@ -192,56 +202,64 @@ dissect_mtp3_routing_label(tvbuff_t *tvb, proto_tree *mtp3_tree)
break;
case ANSI_STANDARD:
/* this could be 5 or 8 bits */
sls = tvb_get_guint8(tvb, ANSI_SLS_OFFSET);
/* Create the Routing Label Tree */
label_item = proto_tree_add_text(mtp3_tree, tvb, ANSI_ROUTING_LABEL_OFFSET,
ANSI_ROUTING_LABEL_LENGTH,
"Routing label");
label_tree = proto_item_add_subtree(label_item, ett_mtp3_label);
/* SLS */
if (mtp3_use_ansi_5_bit_sls)
proto_tree_add_item(label_tree, hf_mtp3_ansi_5_bit_sls, tvb,
ANSI_SLS_OFFSET, ANSI_SLS_LENGTH, TRUE);
else
proto_tree_add_item(label_tree, hf_mtp3_ansi_8_bit_sls, tvb,
ANSI_SLS_OFFSET, ANSI_SLS_LENGTH, TRUE);
/* create the DPC tree */
dpc = tvb_get_ntoh24(tvb, ANSI_DPC_OFFSET);
label_dpc_item = proto_tree_add_text(label_tree, tvb, ANSI_DPC_OFFSET,
ANSI_PC_LENGTH, "DPC (%d-%d-%d)",
(dpc & ANSI_NETWORK_MASK),
snprintf(pc, sizeof(pc), "%d-%d-%d", (dpc & ANSI_NETWORK_MASK),
((dpc & ANSI_CLUSTER_MASK) >> 8),
((dpc & ANSI_MEMBER_MASK) >> 16));
label_dpc_item = proto_tree_add_string_format(label_tree, hf_mtp3_ansi_dpc,
tvb, ANSI_DPC_OFFSET,
ANSI_PC_LENGTH, pc,
"DPC (%s)", pc);
label_dpc_tree = proto_item_add_subtree(label_dpc_item, ett_mtp3_label_dpc);
proto_tree_add_uint(label_dpc_tree, hf_mtp3_dpc_member, tvb,
ANSI_DPC_OFFSET, ANSI_PC_LENGTH, dpc);
ANSI_DPC_OFFSET + ANSI_MEMBER_OFFSET, ANSI_NCM_LENGTH,
dpc);
proto_tree_add_uint(label_dpc_tree, hf_mtp3_dpc_cluster,tvb,
ANSI_DPC_OFFSET, ANSI_PC_LENGTH, dpc);
ANSI_DPC_OFFSET + ANSI_CLUSTER_OFFSET, ANSI_NCM_LENGTH,
dpc);
proto_tree_add_uint(label_dpc_tree, hf_mtp3_dpc_network,tvb,
ANSI_DPC_OFFSET, ANSI_PC_LENGTH, dpc);
ANSI_DPC_OFFSET + ANSI_NETWORK_OFFSET, ANSI_NCM_LENGTH,
dpc);
/* create the OPC tree */
opc = tvb_get_ntoh24(tvb, ANSI_OPC_OFFSET);
label_opc_item = proto_tree_add_text(label_tree, tvb, ANSI_OPC_OFFSET,
ANSI_PC_LENGTH, "OPC (%d-%d-%d)",
(opc & ANSI_NETWORK_MASK),
snprintf(pc, sizeof(pc), "%d-%d-%d", (opc & ANSI_NETWORK_MASK),
((opc & ANSI_CLUSTER_MASK) >> 8),
((opc & ANSI_MEMBER_MASK) >> 16));
label_opc_item = proto_tree_add_string_format(label_tree, hf_mtp3_ansi_opc,
tvb, ANSI_OPC_OFFSET,
ANSI_PC_LENGTH, pc,
"OPC (%s)", pc);
label_opc_tree = proto_item_add_subtree(label_opc_item, ett_mtp3_label_opc);
proto_tree_add_uint(label_opc_tree, hf_mtp3_opc_member, tvb,
ANSI_OPC_OFFSET, ANSI_PC_LENGTH, opc);
ANSI_OPC_OFFSET + ANSI_MEMBER_OFFSET, ANSI_NCM_LENGTH,
opc);
proto_tree_add_uint(label_opc_tree, hf_mtp3_opc_cluster, tvb,
ANSI_OPC_OFFSET, ANSI_PC_LENGTH, opc);
ANSI_OPC_OFFSET + ANSI_CLUSTER_OFFSET, ANSI_NCM_LENGTH,
opc);
proto_tree_add_uint(label_opc_tree, hf_mtp3_opc_network,tvb,
ANSI_OPC_OFFSET, ANSI_PC_LENGTH, opc);
/* SLS */
if (mtp3_use_ansi_5_bit_sls)
proto_tree_add_item(label_tree, hf_mtp3_ansi_5_bit_sls, tvb,
ANSI_SLS_OFFSET, ANSI_SLS_LENGTH, sls);
else
proto_tree_add_item(label_tree, hf_mtp3_ansi_8_bit_sls, tvb,
ANSI_SLS_OFFSET, ANSI_SLS_LENGTH, sls);
ANSI_OPC_OFFSET + ANSI_NETWORK_OFFSET, ANSI_NCM_LENGTH,
opc);
break;
}
}
@ -291,21 +309,21 @@ dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (mtp3_standard) {
case ITU_STANDARD:
mtp3_item = proto_tree_add_item(tree, proto_mtp3, tvb, 0,
ITU_HEADER_LENGTH, FALSE);
ITU_HEADER_LENGTH, TRUE);
break;
case ANSI_STANDARD:
mtp3_item = proto_tree_add_item(tree, proto_mtp3, tvb, 0,
ANSI_HEADER_LENGTH, FALSE);
ANSI_HEADER_LENGTH, TRUE);
break;
}
mtp3_tree = proto_item_add_subtree(mtp3_item, ett_mtp3);
/* dissect the packet */
dissect_mtp3_sio(tvb, mtp3_tree);
dissect_mtp3_routing_label(tvb, mtp3_tree);
}
/* Need to dissect payload even if !tree so can call sub-dissectors */
/* Dissect the packet (even if !tree so can call sub-dissectors) */
dissect_mtp3_sio(tvb, pinfo, mtp3_tree);
if (tree)
dissect_mtp3_routing_label(tvb, mtp3_tree);
dissect_mtp3_payload(tvb, pinfo, tree);
}
@ -335,6 +353,10 @@ proto_register_mtp3(void)
{ "OPC", "mtp3.opc",
FT_UINT32, BASE_DEC, NULL, ITU_OPC_MASK,
"", HFILL }},
{ &hf_mtp3_ansi_opc,
{ "DPC", "mtp3.ansi_opc",
FT_STRING, BASE_NONE, NULL, 0x0,
"", HFILL }},
{ &hf_mtp3_opc_network,
{ "OPC Network", "mtp3.opc.network",
FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK,
@ -351,6 +373,10 @@ proto_register_mtp3(void)
{ "DPC", "mtp3.dpc",
FT_UINT32, BASE_DEC, NULL, ITU_DPC_MASK,
"", HFILL }},
{ &hf_mtp3_ansi_dpc,
{ "DPC", "mtp3.ansi_dpc",
FT_STRING, BASE_NONE, NULL, 0x0,
"", HFILL }},
{ &hf_mtp3_dpc_network,
{ "DPC Network", "mtp3.dpc.network",
FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK,

View File

@ -1,6 +1,6 @@
/* packet-mtp3.h
*
* $Id: packet-mtp3.h,v 1.1 2002/03/04 22:39:22 guy Exp $
* $Id: packet-mtp3.h,v 1.2 2003/01/02 20:44:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -33,6 +33,10 @@ extern Standard_Type mtp3_standard;
#define ANSI_PC_LENGTH 3
#define ANSI_NCM_LENGTH 1
#define ANSI_MEMBER_OFFSET 0
#define ANSI_CLUSTER_OFFSET 1
#define ANSI_NETWORK_OFFSET 2
#define ANSI_NETWORK_MASK 0x0000FF
#define ANSI_CLUSTER_MASK 0x00FF00
#define ANSI_MEMBER_MASK 0xFF0000
#define ANSI_PC_STRING_LENGTH 16

1210
packet-mtp3mg.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
*
* Copyright 2002, Jeff Morriss <jeff.morriss[AT]ulticom.com>
*
* $Id: packet-sccp.c,v 1.6 2002/08/02 23:36:00 jmayer Exp $
* $Id: packet-sccp.c,v 1.7 2003/01/02 20:44:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -35,10 +35,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "epan/packet.h"
#include <glib.h>
#ifdef NEED_SNPRINTF_H
#include "snprintf.h"
#endif
#include <epan/packet.h>
#include "packet-mtp3.h"
#define SCCP_SI 3
@ -93,7 +98,7 @@ static const value_string sccp_message_type_values[] = {
{ MESSAGE_TYPE_LUDTS, "Long Unitdata Service (ITU)" },
{ 0, NULL } };
/* Same as above but in acronym for (for the Info column) */
/* Same as above but in acronym form (for the Info column) */
static const value_string sccp_message_type_acro_values[] = {
{ MESSAGE_TYPE_CR, "CR" },
{ MESSAGE_TYPE_CC, "CC" },
@ -564,6 +569,7 @@ static int hf_sccp_called_ssn = -1;
static int hf_sccp_called_pc_member = -1;
static int hf_sccp_called_pc_cluster = -1;
static int hf_sccp_called_pc_network = -1;
static int hf_sccp_called_ansi_pc = -1;
static int hf_sccp_called_itu_pc = -1;
static int hf_sccp_called_gt_nai = -1;
static int hf_sccp_called_gt_oe = -1;
@ -585,6 +591,7 @@ static int hf_sccp_calling_ssn = -1;
static int hf_sccp_calling_pc_member = -1;
static int hf_sccp_calling_pc_cluster = -1;
static int hf_sccp_calling_pc_network = -1;
static int hf_sccp_calling_ansi_pc = -1;
static int hf_sccp_calling_itu_pc = -1;
static int hf_sccp_calling_gt_nai = -1;
static int hf_sccp_calling_gt_oe = -1;
@ -835,6 +842,7 @@ dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree,
guint8 national = -1, routing_ind, gti, pci, ssni, ssn;
guint32 dpc;
tvbuff_t *gt_tvb;
char pc[ANSI_PC_STRING_LENGTH];
call_item = proto_tree_add_text(tree, tvb, 0, length,
"%s Party address (%u byte%s)",
@ -963,13 +971,16 @@ dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree,
if (pci) {
/* create the DPC tree; modified from that in packet-mtp3.c */
dpc = tvb_get_ntoh24(tvb, offset);
call_pc_item = proto_tree_add_text(call_tree, tvb, offset,
ANSI_PC_LENGTH,
"PC (%d-%d-%d)",
(dpc & ANSI_NETWORK_MASK),
snprintf(pc, sizeof(pc), "%d-%d-%d", (dpc & ANSI_NETWORK_MASK),
((dpc & ANSI_CLUSTER_MASK) >> 8),
((dpc & ANSI_MEMBER_MASK) >> 16));
call_pc_item = proto_tree_add_string_format(call_tree,
called ? hf_sccp_called_ansi_pc
: hf_sccp_calling_ansi_pc,
tvb, offset, ANSI_PC_LENGTH,
pc, "PC (%s)", pc);
call_pc_tree = proto_item_add_subtree(call_pc_item,
called ? ett_sccp_called_pc
: ett_sccp_calling_pc);
@ -1925,6 +1936,10 @@ proto_register_sccp(void)
{ "PC", "sccp.called.pc",
FT_UINT16, BASE_DEC, NULL, ITU_PC_MASK,
"", HFILL}},
{ &hf_sccp_called_ansi_pc,
{ "PC", "sccp.called.ansi_pc",
FT_STRING, BASE_NONE, NULL, 0x0,
"", HFILL}},
{ &hf_sccp_called_pc_network,
{ "PC Network",
"sccp.called.network",
@ -2011,6 +2026,10 @@ proto_register_sccp(void)
{ "PC", "sccp.calling.pc",
FT_UINT16, BASE_DEC, NULL, ITU_PC_MASK,
"", HFILL}},
{ &hf_sccp_calling_ansi_pc,
{ "PC", "sccp.calling.ansi_pc",
FT_STRING, BASE_NONE, NULL, 0x0,
"", HFILL}},
{ &hf_sccp_calling_pc_network,
{ "PC Network",
"sccp.calling.network",

View File

@ -6,7 +6,7 @@
*
* Copyright 2002, Jeff Morriss <jeff.morriss[AT]ulticom.com>
*
* $Id: packet-sccpmg.c,v 1.1 2002/09/20 09:22:46 sahlberg Exp $
* $Id: packet-sccpmg.c,v 1.2 2003/01/02 20:44:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -31,7 +31,17 @@
# include "config.h"
#endif
#include "epan/packet.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#ifdef NEED_SNPRINTF_H
#include "snprintf.h"
#endif
#include <epan/packet.h>
#include "packet-mtp3.h"
#define SCCPMG_SSN 1
@ -101,6 +111,7 @@ static int proto_sccpmg = -1;
static int hf_sccpmg_message_type = -1;
static int hf_sccpmg_affected_ssn = -1;
static int hf_sccpmg_affected_pc = -1;
static int hf_sccpmg_affected_ansi_pc = -1;
static int hf_sccpmg_affected_pc_member = -1;
static int hf_sccpmg_affected_pc_cluster = -1;
static int hf_sccpmg_affected_pc_network = -1;
@ -138,6 +149,7 @@ dissect_sccpmg_affected_pc(tvbuff_t *tvb, proto_tree *sccpmg_tree)
proto_tree *pc_tree = 0;
guint32 dpc;
guint8 offset = SCCPMG_AFFECTED_PC_OFFSET;
char pc[ANSI_PC_STRING_LENGTH];
if (mtp3_standard == ITU_STANDARD) {
proto_tree_add_item(sccpmg_tree, hf_sccpmg_affected_pc, tvb,
@ -145,11 +157,16 @@ dissect_sccpmg_affected_pc(tvbuff_t *tvb, proto_tree *sccpmg_tree)
} else if (mtp3_standard == ANSI_STANDARD) {
/* create the DPC tree; modified from that in packet-sccp.c */
dpc = tvb_get_ntoh24(tvb, offset);
pc_item = proto_tree_add_text(sccpmg_tree, tvb, offset,
ANSI_PC_LENGTH, "PC (%d-%d-%d)",
(dpc & ANSI_NETWORK_MASK),
((dpc & ANSI_CLUSTER_MASK) >> 8),
((dpc & ANSI_MEMBER_MASK) >> 16));
snprintf(pc, sizeof(pc), "%d-%d-%d",
(dpc & ANSI_NETWORK_MASK),
((dpc & ANSI_CLUSTER_MASK) >> 8),
((dpc & ANSI_MEMBER_MASK) >> 16));
pc_item = proto_tree_add_string_format(sccpmg_tree,
hf_sccpmg_affected_ansi_pc,
tvb, offset,
ANSI_PC_LENGTH, pc,
"PC (%s)", pc);
pc_tree = proto_item_add_subtree(pc_item,
ett_sccpmg_affected_pc);
@ -277,41 +294,40 @@ proto_register_sccpmg(void)
static hf_register_info hf[] = {
{ &hf_sccpmg_message_type,
{ "Message Type", "sccpmg.message_type",
FT_UINT8, BASE_HEX, VALS(sccpmg_message_type_values), 0x0,
"", HFILL}},
FT_UINT8, BASE_HEX, VALS(sccpmg_message_type_values), 0x0,
"", HFILL}},
{ &hf_sccpmg_affected_ssn,
{ "Affected SubSystem Number", "sccpmg.ssn",
FT_UINT8, BASE_DEC, NULL, 0x0,
"", HFILL}},
FT_UINT8, BASE_DEC, NULL, 0x0,
"", HFILL}},
{ &hf_sccpmg_affected_pc,
{ "Affected Point Code", "sccpmg.pc",
FT_UINT16, BASE_DEC, NULL, ITU_PC_MASK,
"", HFILL}},
FT_UINT16, BASE_DEC, NULL, ITU_PC_MASK,
"", HFILL}},
{ &hf_sccpmg_affected_ansi_pc,
{ "Affected Point Code", "sccpmg.ansi_pc",
FT_STRING, BASE_NONE, NULL, 0x0,
"", HFILL}},
{ &hf_sccpmg_affected_pc_network,
{ "Affected PC Network",
"sccpmg.network",
FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK,
"", HFILL}},
{ "Affected PC Network", "sccpmg.network",
FT_UINT24, BASE_DEC, NULL, ANSI_NETWORK_MASK,
"", HFILL}},
{ &hf_sccpmg_affected_pc_cluster,
{ "Affected PC Cluster",
"sccpmg.cluster",
FT_UINT24, BASE_DEC, NULL, ANSI_CLUSTER_MASK,
"", HFILL}},
{ "Affected PC Cluster", "sccpmg.cluster",
FT_UINT24, BASE_DEC, NULL, ANSI_CLUSTER_MASK,
"", HFILL}},
{ &hf_sccpmg_affected_pc_member,
{ "Affected PC Member",
"sccpmg.member",
FT_UINT24, BASE_DEC, NULL, ANSI_MEMBER_MASK,
"", HFILL}},
{ "Affected PC Member", "sccpmg.member",
FT_UINT24, BASE_DEC, NULL, ANSI_MEMBER_MASK,
"", HFILL}},
{ &hf_sccpmg_smi,
{ "Subsystem Multiplicity Indicator",
"sccpmg.smi",
FT_UINT8, BASE_DEC, NULL, SCCPMG_SMI_MASK,
"", HFILL}},
{ "Subsystem Multiplicity Indicator", "sccpmg.smi",
FT_UINT8, BASE_DEC, NULL, SCCPMG_SMI_MASK,
"", HFILL}},
{ &hf_sccpmg_congestion_level,
{ "SCCP Congestionl Level (ITU)",
"sccpmg.congestion",
FT_UINT8, BASE_DEC, NULL, ITU_SCCPMG_CONGESTION_MASK,
"", HFILL}}
{ "SCCP Congestionl Level (ITU)", "sccpmg.congestion",
FT_UINT8, BASE_DEC, NULL, ITU_SCCPMG_CONGESTION_MASK,
"", HFILL}}
};
/* Setup protocol subtree array */