aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sccpmg.c
diff options
context:
space:
mode:
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>2006-09-14 10:51:44 +0000
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>2006-09-14 10:51:44 +0000
commit3f7ba6886272742d4845827d3efdf6075cfce413 (patch)
treeb197f9b0cad8af7239969d57a19e10eeb46212d6 /epan/dissectors/packet-sccpmg.c
parentd8c46156b6aab1f7dcb208a1ecd93fa3ab2c77f1 (diff)
Jeff Morriss:
Fix for bug 1036 I looked at this today and found that in fact the PC stuff is pretty hosed up in the SS7 dissectors. For example, MTP3 *looks* OK here (DPC is 4-5-6): Routing label DPC (4-5-6) (394500) but 394500 == 0x60504 == 6-5-4. Something's not right. I made a common PC dissector function for all the SS7 dissectors so as to concentrate all this code in one place (something I've been wanting to do for a while anyway) and fixed the reported problem as well as the above problem in the attached patch. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19231 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-sccpmg.c')
-rw-r--r--epan/dissectors/packet-sccpmg.c36
1 files changed, 8 insertions, 28 deletions
diff --git a/epan/dissectors/packet-sccpmg.c b/epan/dissectors/packet-sccpmg.c
index ed9d7aaab0..4a75b07bce 100644
--- a/epan/dissectors/packet-sccpmg.c
+++ b/epan/dissectors/packet-sccpmg.c
@@ -150,11 +150,7 @@ dissect_sccpmg_affected_ssn(tvbuff_t *tvb, proto_tree *sccpmg_tree)
static void
dissect_sccpmg_affected_pc(tvbuff_t *tvb, proto_tree *sccpmg_tree)
{
- proto_item *pc_item = 0;
- 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_itu_pc, tvb,
@@ -172,30 +168,14 @@ dissect_sccpmg_affected_pc(tvbuff_t *tvb, proto_tree *sccpmg_tree)
hf_affected_pc = &hf_sccpmg_affected_chinese_pc;
}
- /* create the DPC tree; modified from that in packet-sccp.c */
- dpc = tvb_get_ntoh24(tvb, offset);
- g_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_affected_pc,
- tvb, offset,
- ANSI_PC_LENGTH, pc,
- "PC (%s)", pc);
-
- pc_tree = proto_item_add_subtree(pc_item,
- ett_sccpmg_affected_pc);
-
- proto_tree_add_uint(pc_tree, hf_sccpmg_affected_pc_member, tvb,
- offset, ANSI_NCM_LENGTH, dpc);
- offset += ANSI_NCM_LENGTH;
- proto_tree_add_uint(pc_tree, hf_sccpmg_affected_pc_cluster, tvb,
- offset, ANSI_NCM_LENGTH, dpc);
- offset += ANSI_NCM_LENGTH;
- proto_tree_add_uint(pc_tree, hf_sccpmg_affected_pc_network,
- tvb, offset, ANSI_NCM_LENGTH, dpc);
+ /* create and fill the PC tree */
+ dissect_mtp3_3byte_pc(tvb, offset, sccpmg_tree,
+ ett_sccpmg_affected_pc, *hf_affected_pc,
+ hf_sccpmg_affected_pc_network,
+ hf_sccpmg_affected_pc_cluster,
+ hf_sccpmg_affected_pc_member, 0, 0);
+
+ offset += ANSI_PC_LENGTH;
}
}