diff options
author | Michael Mann <mmann78@netscape.net> | 2016-06-12 12:28:02 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-06-13 17:06:38 +0000 |
commit | 04b82a7dc971597be958ba902bcf51dc32189305 (patch) | |
tree | 2b096991993a4070df224ca22b440eba94f037c3 /epan/dissectors/packet-sua.c | |
parent | e2e84563eeb1e7b9add817d2b0c39656fab297d5 (diff) |
Convert AT_SS7PC to a "dissector address type"
The formatting of the address type is determined by a preference in
packet-mtp3.c, so just make MTP3 register the address type.
Use address_type_get_by_name in other dissectors (and export_pdu)
to use the address type.
Change-Id: Ifb32d7de27aeaa23cee8e803e25ffb3c905547b5
Reviewed-on: https://code.wireshark.org/review/15856
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-sua.c')
-rw-r--r-- | epan/dissectors/packet-sua.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c index b1c5a63b74..13bdab10ea 100644 --- a/epan/dissectors/packet-sua.c +++ b/epan/dissectors/packet-sua.c @@ -30,6 +30,7 @@ #include "config.h" #include <epan/packet.h> +#include <epan/address_types.h> #include <epan/prefs.h> #include <epan/sctpppids.h> #include <epan/tap.h> @@ -381,6 +382,8 @@ static heur_dissector_list_t heur_subdissector_list; static guint32 message_class, message_type, drn, srn; +static int ss7pc_address_type = -1; + #define INVALID_SSN 0xff static guint next_assoc_id = 1; @@ -436,8 +439,8 @@ sua_assoc(packet_info* pinfo, address* opc, address* dpc, guint src_rn, guint ds return &no_sua_assoc; } - opck = opc->type == AT_SS7PC ? mtp3_pc_hash((const mtp3_addr_pc_t *)opc->data) : g_str_hash(address_to_str(wmem_packet_scope(), opc)); - dpck = dpc->type == AT_SS7PC ? mtp3_pc_hash((const mtp3_addr_pc_t *)dpc->data) : g_str_hash(address_to_str(wmem_packet_scope(), dpc)); + opck = opc->type == ss7pc_address_type ? mtp3_pc_hash((const mtp3_addr_pc_t *)opc->data) : g_str_hash(address_to_str(wmem_packet_scope(), opc)); + dpck = dpc->type == ss7pc_address_type ? mtp3_pc_hash((const mtp3_addr_pc_t *)dpc->data) : g_str_hash(address_to_str(wmem_packet_scope(), dpc)); switch (message_type) { case MESSAGE_TYPE_CORE: @@ -2242,9 +2245,9 @@ dissect_sua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *sua_t if (set_addresses) { if (sua_opc->type) - set_address(&pinfo->src, AT_SS7PC, sizeof(mtp3_addr_pc_t), (guint8 *) sua_opc); + set_address(&pinfo->src, ss7pc_address_type, sizeof(mtp3_addr_pc_t), (guint8 *) sua_opc); if (sua_dpc->type) - set_address(&pinfo->dst, AT_SS7PC, sizeof(mtp3_addr_pc_t), (guint8 *) sua_dpc); + set_address(&pinfo->dst, ss7pc_address_type, sizeof(mtp3_addr_pc_t), (guint8 *) sua_dpc); if (sua_source_gt) set_address(&pinfo->src, AT_STRINGZ, 1+(int)strlen(sua_source_gt), wmem_strdup(pinfo->pool, sua_source_gt)); @@ -2486,6 +2489,7 @@ proto_reg_handoff_sua(void) sccp_ssn_dissector_table = find_dissector_table("sccp.ssn"); + ss7pc_address_type = address_type_get_by_name("AT_SS7PC"); } /* |