aboutsummaryrefslogtreecommitdiffstats
path: root/epan/exported_pdu.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-06-12 12:28:02 -0400
committerAnders Broman <a.broman58@gmail.com>2016-06-13 17:06:38 +0000
commit04b82a7dc971597be958ba902bcf51dc32189305 (patch)
tree2b096991993a4070df224ca22b440eba94f037c3 /epan/exported_pdu.c
parente2e84563eeb1e7b9add817d2b0c39656fab297d5 (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/exported_pdu.c')
-rw-r--r--epan/exported_pdu.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/epan/exported_pdu.c b/epan/exported_pdu.c
index 840d9cbb8a..62d7aeb3d7 100644
--- a/epan/exported_pdu.c
+++ b/epan/exported_pdu.c
@@ -27,12 +27,15 @@
#include <epan/packet.h>
#include <epan/exported_pdu.h>
+#include <epan/address_types.h>
#include <epan/tap.h>
#include <epan/dissectors/packet-mtp3.h>
#include <epan/dissectors/packet-dvbci.h>
GSList *export_pdu_tap_name_list = NULL;
+static int ss7pc_address_type = -1;
+
/**
* Allocates and fills the exp_pdu_data_t struct according to the wanted_exp_tags
* bit field of wanted_exp_tags_len bytes length
@@ -98,13 +101,13 @@ load_export_pdu_tags(packet_info *pinfo, guint tag_type, const char* proto_name,
}
if((wanted_exp_tags[0] & EXP_PDU_TAG_SS7_OPC_BIT) == EXP_PDU_TAG_SS7_OPC_BIT){
- if(pinfo->src.type == AT_SS7PC){
+ if(pinfo->src.type == ss7pc_address_type){
tag_buf_size += 4 + EXP_PDU_TAG_SS7_OPC_LEN;
}
}
if((wanted_exp_tags[0] & EXP_PDU_TAG_SS7_DPC_BIT) == EXP_PDU_TAG_SS7_DPC_BIT){
- if(pinfo->dst.type == AT_SS7PC){
+ if(pinfo->dst.type == ss7pc_address_type){
tag_buf_size += 4 + EXP_PDU_TAG_SS7_DPC_LEN;
}
}
@@ -260,7 +263,7 @@ load_export_pdu_tags(packet_info *pinfo, guint tag_type, const char* proto_name,
}
if((wanted_exp_tags[0] & EXP_PDU_TAG_SS7_OPC_BIT) == EXP_PDU_TAG_SS7_OPC_BIT){
- if(pinfo->src.type == AT_SS7PC){
+ if(pinfo->src.type == ss7pc_address_type){
const mtp3_addr_pc_t *mtp3_addr = (const mtp3_addr_pc_t *)(pinfo->src.data);
exp_pdu_data->tlv_buffer[i] = 0;
i++;
@@ -282,7 +285,7 @@ load_export_pdu_tags(packet_info *pinfo, guint tag_type, const char* proto_name,
}
if((wanted_exp_tags[0] & EXP_PDU_TAG_SS7_DPC_BIT) == EXP_PDU_TAG_SS7_DPC_BIT){
- if(pinfo->dst.type == AT_SS7PC){
+ if(pinfo->dst.type == ss7pc_address_type){
const mtp3_addr_pc_t *mtp3_addr = (const mtp3_addr_pc_t *)(pinfo->dst.data);
exp_pdu_data->tlv_buffer[i] = 0;
i++;
@@ -358,6 +361,11 @@ get_export_pdu_tap_list(void)
return export_pdu_tap_name_list;
}
+void export_pdu_init(void)
+{
+ ss7pc_address_type = address_type_get_by_name("AT_SS7PC");
+}
+
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*