diff options
author | lego <lego@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-03-22 22:59:20 +0000 |
---|---|---|
committer | lego <lego@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-03-22 22:59:20 +0000 |
commit | 6f9caaf2f1b60d90db4e301cf1711978b523a563 (patch) | |
tree | 6986d6abf9e4fe13b040327b909b3e9ffa7bc795 /epan | |
parent | 2ab6d815f34239d8ed259e3cdade15dac9f1139e (diff) |
Mine:
* add SUA to the "VoIP Calls" tap.
* propagate changes to packet-sccp.h to other dissectors
From Neil Piercy:
* add SLR, DLR and CAUSE to COL_INFO
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21126 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-bssap.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-ranap.c | 70 | ||||
-rw-r--r-- | epan/dissectors/packet-sccp.c | 128 | ||||
-rw-r--r-- | epan/dissectors/packet-sccp.h | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-sua.c | 47 | ||||
-rw-r--r-- | epan/libwireshark.def | 1 |
6 files changed, 185 insertions, 77 deletions
diff --git a/epan/dissectors/packet-bssap.c b/epan/dissectors/packet-bssap.c index 139cfe5a21..5fc2a627b8 100644 --- a/epan/dissectors/packet-bssap.c +++ b/epan/dissectors/packet-bssap.c @@ -37,7 +37,7 @@ #include <stdio.h> #include <stdlib.h> -#include <gmodule.h> +#include <glib.h> #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> @@ -49,7 +49,7 @@ #include <string.h> -#include "epan/packet.h" +#include <epan/packet.h> #include <epan/prefs.h> #include <epan/emem.h> @@ -582,7 +582,7 @@ dissect_bssap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } if ( pinfo->sccp_info && pinfo->sccp_info->assoc ) - pinfo->sccp_info->assoc->proto = SCCP_PLOAD_BSSAP; + pinfo->sccp_info->assoc->payload = SCCP_PLOAD_BSSAP; /* * create the bssap protocol tree @@ -1633,7 +1633,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr } if (pinfo->sccp_info && pinfo->sccp_info->assoc) - pinfo->sccp_info->assoc->proto = SCCP_PLOAD_BSSAP; + pinfo->sccp_info->assoc->payload = SCCP_PLOAD_BSSAP; /* create the BSSAP+ protocol tree */ bssap_item = proto_tree_add_item(tree, proto_bssap, tvb, 0, -1, FALSE); diff --git a/epan/dissectors/packet-ranap.c b/epan/dissectors/packet-ranap.c index eeb0238069..d0dba3ee8d 100644 --- a/epan/dissectors/packet-ranap.c +++ b/epan/dissectors/packet-ranap.c @@ -41,6 +41,7 @@ #include <epan/conversation.h> #include <epan/tap.h> #include <epan/emem.h> +#include <epan/strutil.h> #include <stdio.h> #include <string.h> @@ -473,7 +474,7 @@ static int hf_ranap_mBMSServiceAreaList = -1; /* MBMSServiceAreaList */ static int hf_ranap_MBMSServiceAreaList_item = -1; /* MBMSServiceAreaCode */ static int hf_ranap_rAI = -1; /* RAI */ static int hf_ranap_PDP_TypeInformation_item = -1; /* PDP_Type */ -static int hf_ranap_iMSI = -1; /* IMSI */ +static int hf_ranap_iMSI = -1; /* T_iMSI */ static int hf_ranap_PermittedEncryptionAlgorithms_item = -1; /* EncryptionAlgorithm */ static int hf_ranap_PermittedIntegrityProtectionAlgorithms_item = -1; /* IntegrityProtectionAlgorithm */ static int hf_ranap_PLMNs_in_shared_network_item = -1; /* PLMNs_in_shared_network_item */ @@ -594,7 +595,7 @@ static int hf_ranap_private_id = -1; /* PrivateIE_ID */ static int hf_ranap_private_value = -1; /* RANAP_PRIVATE_IES_Value */ /*--- End of included file: packet-ranap-hf.c ---*/ -#line 69 "packet-ranap-template.c" +#line 70 "packet-ranap-template.c" /* Initialize the subtree pointers */ static int ett_ranap = -1; @@ -861,7 +862,7 @@ static gint ett_ranap_PrivateIE_Container = -1; static gint ett_ranap_PrivateIE_Field = -1; /*--- End of included file: packet-ranap-ett.c ---*/ -#line 74 "packet-ranap-template.c" +#line 75 "packet-ranap-template.c" /* Global variables */ @@ -982,7 +983,7 @@ static int dissect_secondCriticality(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx static int dissect_ranap_Value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 52 "ranap.cnf" +#line 67 "ranap.cnf" offset = dissect_ranap_messages(tvb, offset, actx, tree); @@ -1274,7 +1275,7 @@ static int dissect_id(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, p static int dissect_ranap_RANAP_PROTOCOL_IES_Value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 56 "ranap.cnf" +#line 71 "ranap.cnf" offset = dissect_ranap_ies(tvb, offset, actx, tree); @@ -1351,7 +1352,7 @@ static int dissect_ext_id(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U static int dissect_ranap_Extension(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 75 "ranap.cnf" +#line 90 "ranap.cnf" offset = dissect_ranap_ies(tvb, offset, actx, tree); @@ -1909,7 +1910,7 @@ static int dissect_private_id(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act static int dissect_ranap_RANAP_PRIVATE_IES_Value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 79 "ranap.cnf" +#line 94 "ranap.cnf" /* FIX ME */ @@ -3058,7 +3059,7 @@ static int dissect_aPN(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, static int dissect_ranap_PLMNidentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 82 "ranap.cnf" +#line 97 "ranap.cnf" tvbuff_t *parameter_tvb=NULL; @@ -4575,7 +4576,7 @@ static int dissect_id_DRX_CycleLengthCoefficient(tvbuff_t *tvb _U_, int offset _ static int dissect_ranap_NAS_PDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 60 "ranap.cnf" +#line 75 "ranap.cnf" tvbuff_t *nas_pdu_tvb=NULL; @@ -5081,21 +5082,45 @@ dissect_ranap_IMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, prot return offset; } -static int dissect_iMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_) { - return dissect_ranap_IMSI(tvb, offset, actx, tree, hf_ranap_iMSI); -} static int dissect_imsi(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_) { return dissect_ranap_IMSI(tvb, offset, actx, tree, hf_ranap_imsi); } + +static int +dissect_ranap_T_iMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { +#line 52 "ranap.cnf" + tvbuff_t* imsi_tvb; + offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_ranap_iMSI, + 3, 8, &imsi_tvb); + + if ( actx->pinfo->sccp_info + && actx->pinfo->sccp_info->assoc + && ! actx->pinfo->sccp_info->assoc->calling_party ) { + + guint len = tvb_length(imsi_tvb); + guint8* bytes = ep_tvb_memdup(imsi_tvb,0,len); + + actx->pinfo->sccp_info->assoc->calling_party = + se_strdup_printf("IMSI: %s", bytes_to_str(bytes, len) ); + } + + + return offset; +} +static int dissect_iMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_) { + return dissect_ranap_T_iMSI(tvb, offset, actx, tree, hf_ranap_iMSI); +} + + static const value_string ranap_PermanentNAS_UE_ID_vals[] = { { 0, "iMSI" }, { 0, NULL } }; static const per_choice_t PermanentNAS_UE_ID_choice[] = { - { 0, &hf_ranap_iMSI , ASN1_EXTENSION_ROOT , dissect_ranap_IMSI }, + { 0, &hf_ranap_iMSI , ASN1_EXTENSION_ROOT , dissect_ranap_T_iMSI }, { 0, NULL, 0, NULL } }; @@ -8199,7 +8224,7 @@ static int dissect_id_RAB_SetupOrModifiedList(tvbuff_t *tvb _U_, int offset _U_, static int dissect_ranap_FirstValue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 72 "ranap.cnf" +#line 87 "ranap.cnf" offset = dissect_ranap_FirstValue_ies(tvb, offset, actx, tree); @@ -8214,7 +8239,7 @@ static int dissect_firstValue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act static int dissect_ranap_SecondValue(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 69 "ranap.cnf" +#line 84 "ranap.cnf" offset = dissect_ranap_SecondValue_ies(tvb, offset, actx, tree); @@ -9758,7 +9783,7 @@ static int dissect_RANAP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, prot /*--- End of included file: packet-ranap-fn.c ---*/ -#line 88 "packet-ranap-template.c" +#line 89 "packet-ranap-template.c" @@ -10753,16 +10778,17 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ranap_item = proto_tree_add_item(tree, proto_ranap, tvb, 0, -1, FALSE); ranap_tree = proto_item_add_subtree(ranap_item, ett_ranap); + ProcedureCode = 0xFFFFFFFF; offset = dissect_RANAP_PDU_PDU(tvb, pinfo, ranap_tree); if (pinfo->sccp_info) { sccp_msg_info_t* sccp_msg = pinfo->sccp_info; - const gchar* str = val_to_str(ProcedureCode, ranap_ProcedureCode_vals,"Unknown RANAP"); if (sccp_msg->assoc) - sccp_msg->assoc->proto = SCCP_PLOAD_RANAP; + sccp_msg->assoc->payload = SCCP_PLOAD_RANAP; - if (! sccp_msg->label) { + if (! sccp_msg->label && ProcedureCode != 0xFFFFFFFF) { + const gchar* str = val_to_str(ProcedureCode, ranap_ProcedureCode_vals,"Unknown RANAP"); sccp_msg->label = se_strdup(str); } } @@ -12432,7 +12458,7 @@ void proto_register_ranap(void) { { &hf_ranap_iMSI, { "iMSI", "ranap.iMSI", FT_BYTES, BASE_HEX, NULL, 0, - "ranap.IMSI", HFILL }}, + "ranap.T_iMSI", HFILL }}, { &hf_ranap_PermittedEncryptionAlgorithms_item, { "Item", "ranap.PermittedEncryptionAlgorithms_item", FT_UINT32, BASE_DEC, VALS(ranap_EncryptionAlgorithm_vals), 0, @@ -12907,7 +12933,7 @@ void proto_register_ranap(void) { "ranap.RANAP_PRIVATE_IES_Value", HFILL }}, /*--- End of included file: packet-ranap-hfarr.c ---*/ -#line 1168 "packet-ranap-template.c" +#line 1170 "packet-ranap-template.c" }; /* List of subtrees */ @@ -13176,7 +13202,7 @@ void proto_register_ranap(void) { &ett_ranap_PrivateIE_Field, /*--- End of included file: packet-ranap-ettarr.c ---*/ -#line 1175 "packet-ranap-template.c" +#line 1177 "packet-ranap-template.c" }; /* Register protocol */ diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c index 468d84ce32..936f8d13e0 100644 --- a/epan/dissectors/packet-sccp.c +++ b/epan/dissectors/packet-sccp.c @@ -302,7 +302,7 @@ static const value_string sccp_oe_values[] = { #define GT_ODD_SIGNAL_MASK 0x0f #define GT_EVEN_SIGNAL_MASK 0xf0 #define GT_EVEN_SIGNAL_SHIFT 4 -#define GT_MAX_SIGNALS 32 +#define GT_MAX_SIGNALS (32*7) /* its a bit big, but it allows for adding a lot of "(spare)" and "Unknown" values (7 chars) if there are errors - e.g. ANSI vs ITU wrongly selected */ static const value_string sccp_address_signal_values[] = { { 0, "0" }, { 1, "1" }, @@ -672,6 +672,8 @@ static gint ett_sccp_assoc = -1; /* Declarations to desegment XUDT Messages */ static gboolean sccp_xudt_desegment = TRUE; +static gboolean show_key_params = FALSE; + static int sccp_tap = -1; @@ -742,7 +744,7 @@ static sccp_assoc_info_t* new_assoc(guint32 calling, guint32 called){ a->called_ssn = INVALID_SSN; a->has_fw_key = FALSE; a->has_bw_key = FALSE; - a->proto = SCCP_PLOAD_NONE; + a->payload = SCCP_PLOAD_NONE; a->calling_party = NULL; a->called_party = NULL; a->extra_info = NULL; @@ -751,7 +753,7 @@ static sccp_assoc_info_t* new_assoc(guint32 calling, guint32 called){ return a; } -static sccp_assoc_info_t* sccp_assoc(packet_info* pinfo, guint offset, guint32 src_lr, guint32 dst_lr) { +sccp_assoc_info_t* get_sccp_assoc(packet_info* pinfo, guint offset, guint32 src_lr, guint32 dst_lr, guint msg_type) { guint32 opck, dpck; address* opc = &(pinfo->src); address* dpc = &(pinfo->dst); @@ -768,7 +770,7 @@ static sccp_assoc_info_t* sccp_assoc(packet_info* pinfo, guint offset, guint32 s dpck = dpc->type == AT_SS7PC ? mtp3_pc_hash(dpc->data) : g_str_hash(address_to_str(dpc)); - switch (message_type) { + switch (msg_type) { case SCCP_MSG_TYPE_CR: { /* CR contains the opc,dpc,dlr key of backward messages swapped as dpc,opc,slr */ @@ -837,7 +839,7 @@ static sccp_assoc_info_t* sccp_assoc(packet_info* pinfo, guint offset, guint32 s msg->assoc = assoc; msg->label = NULL; msg->comment = NULL; - msg->type = message_type; + msg->type = msg_type; if (assoc->msgs) { sccp_msg_info_t* m; @@ -886,7 +888,7 @@ dissect_sccp_unknown_param(tvbuff_t *tvb, proto_tree *tree, guint8 type, guint l } static void -dissect_sccp_dlr_param(tvbuff_t *tvb, proto_tree *tree, guint length) +dissect_sccp_dlr_param(tvbuff_t *tvb, proto_tree *tree, guint length, packet_info *pinfo) { proto_item* lr_item; @@ -894,10 +896,13 @@ dissect_sccp_dlr_param(tvbuff_t *tvb, proto_tree *tree, guint length) proto_tree_add_uint(tree, hf_sccp_dlr, tvb, 0, length, dlr); lr_item = proto_tree_add_uint(tree, hf_sccp_lr, tvb, 0, length, dlr); PROTO_ITEM_SET_HIDDEN(lr_item); + + if (show_key_params && check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, "DLR=%ld ", dlr); } static void -dissect_sccp_slr_param(tvbuff_t *tvb, proto_tree *tree, guint length) +dissect_sccp_slr_param(tvbuff_t *tvb, proto_tree *tree, guint length, packet_info *pinfo) { proto_item* lr_item; @@ -905,6 +910,9 @@ dissect_sccp_slr_param(tvbuff_t *tvb, proto_tree *tree, guint length) proto_tree_add_uint(tree, hf_sccp_slr, tvb, 0, length, slr); lr_item = proto_tree_add_uint(tree, hf_sccp_lr, tvb, 0, length, slr); PROTO_ITEM_SET_HIDDEN(lr_item); + + if (show_key_params && check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, "SLR=%ld ", slr); } static void @@ -1355,48 +1363,63 @@ dissect_sccp_credit_param(tvbuff_t *tvb, proto_tree *tree, guint length) } static void -dissect_sccp_release_cause_param(tvbuff_t *tvb, proto_tree *tree, guint length) +dissect_sccp_release_cause_param(tvbuff_t *tvb, proto_tree *tree, guint length, packet_info *pinfo) { guint8 cause; cause = tvb_get_guint8(tvb, 0); proto_tree_add_uint(tree, hf_sccp_release_cause, tvb, 0, length, cause); + + if (show_key_params && check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", cause); } static void -dissect_sccp_return_cause_param(tvbuff_t *tvb, proto_tree *tree, guint length) +dissect_sccp_return_cause_param(tvbuff_t *tvb, proto_tree *tree, guint length, packet_info *pinfo) { guint8 cause; cause = tvb_get_guint8(tvb, 0); proto_tree_add_uint(tree, hf_sccp_return_cause, tvb, 0, length, cause); + + if (show_key_params && check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", cause); } static void -dissect_sccp_reset_cause_param(tvbuff_t *tvb, proto_tree *tree, guint length) +dissect_sccp_reset_cause_param(tvbuff_t *tvb, proto_tree *tree, guint length, packet_info *pinfo) { guint8 cause; cause = tvb_get_guint8(tvb, 0); proto_tree_add_uint(tree, hf_sccp_reset_cause, tvb, 0, length, cause); + + if (show_key_params && check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", cause); } static void -dissect_sccp_error_cause_param(tvbuff_t *tvb, proto_tree *tree, guint length) +dissect_sccp_error_cause_param(tvbuff_t *tvb, proto_tree *tree, guint length, packet_info *pinfo) { guint8 cause; cause = tvb_get_guint8(tvb, 0); proto_tree_add_uint(tree, hf_sccp_error_cause, tvb, 0, length, cause); + + if (show_key_params && check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", cause); } static void -dissect_sccp_refusal_cause_param(tvbuff_t *tvb, proto_tree *tree, guint length) +dissect_sccp_refusal_cause_param(tvbuff_t *tvb, proto_tree *tree, guint length, packet_info *pinfo) { guint8 cause; cause = tvb_get_guint8(tvb, 0); proto_tree_add_uint(tree, hf_sccp_refusal_cause, tvb, 0, length, cause); + + if (show_key_params && check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", cause); } /* This function is used for both data and long data (ITU only) parameters */ @@ -1565,6 +1588,11 @@ dissect_sccp_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, case PARAMETER_LONG_DATA: case PARAMETER_SOURCE_LOCAL_REFERENCE: case PARAMETER_DESTINATION_LOCAL_REFERENCE: + case PARAMETER_RELEASE_CAUSE: + case PARAMETER_RETURN_CAUSE: + case PARAMETER_RESET_CAUSE: + case PARAMETER_ERROR_CAUSE: + case PARAMETER_REFUSAL_CAUSE: /* These parameters must be dissected even if !sccp_tree (so that * assoc information can be created). @@ -1586,11 +1614,11 @@ dissect_sccp_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case PARAMETER_DESTINATION_LOCAL_REFERENCE: - dissect_sccp_dlr_param(parameter_tvb, sccp_tree, parameter_length); + dissect_sccp_dlr_param(parameter_tvb, sccp_tree, parameter_length, pinfo); break; case PARAMETER_SOURCE_LOCAL_REFERENCE: - dissect_sccp_slr_param(parameter_tvb, sccp_tree, parameter_length); + dissect_sccp_slr_param(parameter_tvb, sccp_tree, parameter_length, pinfo); break; case PARAMETER_CALLED_PARTY_ADDRESS: @@ -1625,23 +1653,23 @@ dissect_sccp_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case PARAMETER_RELEASE_CAUSE: - dissect_sccp_release_cause_param(parameter_tvb, sccp_tree, parameter_length); + dissect_sccp_release_cause_param(parameter_tvb, sccp_tree, parameter_length, pinfo); break; case PARAMETER_RETURN_CAUSE: - dissect_sccp_return_cause_param(parameter_tvb, sccp_tree, parameter_length); + dissect_sccp_return_cause_param(parameter_tvb, sccp_tree, parameter_length, pinfo); break; case PARAMETER_RESET_CAUSE: - dissect_sccp_reset_cause_param(parameter_tvb, sccp_tree, parameter_length); + dissect_sccp_reset_cause_param(parameter_tvb, sccp_tree, parameter_length, pinfo); break; case PARAMETER_ERROR_CAUSE: - dissect_sccp_error_cause_param(parameter_tvb, sccp_tree, parameter_length); + dissect_sccp_error_cause_param(parameter_tvb, sccp_tree, parameter_length, pinfo); break; case PARAMETER_REFUSAL_CAUSE: - dissect_sccp_refusal_cause_param(parameter_tvb, sccp_tree, parameter_length); + dissect_sccp_refusal_cause_param(parameter_tvb, sccp_tree, parameter_length, pinfo); break; case PARAMETER_DATA: @@ -1809,9 +1837,10 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, message_type = tvb_get_guint8(tvb, SCCP_MSG_TYPE_OFFSET); offset = SCCP_MSG_TYPE_LENGTH; - if (check_col(pinfo->cinfo, COL_INFO)) - col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", + if (check_col(pinfo->cinfo, COL_INFO)) { + col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, sccp_message_type_acro_values, "Unknown")); + }; if (sccp_tree) { /* add the message type to the protocol tree */ @@ -1831,7 +1860,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, no_assoc.called_ssn = INVALID_SSN; no_assoc.has_fw_key = FALSE; no_assoc.has_bw_key = FALSE; - no_assoc.proto = SCCP_PLOAD_NONE; + no_assoc.payload = SCCP_PLOAD_NONE; no_assoc.called_party = NULL; no_assoc.calling_party = NULL; no_assoc.extra_info = NULL; @@ -1848,7 +1877,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, PROTOCOL_CLASS_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1, POINTER_LENGTH) OPTIONAL_POINTER(POINTER_LENGTH) @@ -1873,7 +1902,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, PARAMETER_SOURCE_LOCAL_REFERENCE, offset, SOURCE_LOCAL_REFERENCE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, @@ -1887,7 +1916,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, offset, DESTINATION_LOCAL_REFERENCE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_REFUSAL_CAUSE, offset, @@ -1904,14 +1933,14 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, PARAMETER_SOURCE_LOCAL_REFERENCE, offset, SOURCE_LOCAL_REFERENCE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RELEASE_CAUSE, offset, RELEASE_CAUSE_LENGTH); OPTIONAL_POINTER(POINTER_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); break; case SCCP_MSG_TYPE_RLC: @@ -1923,7 +1952,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, PARAMETER_SOURCE_LOCAL_REFERENCE, offset, SOURCE_LOCAL_REFERENCE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); break; @@ -1934,7 +1963,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, offset, DESTINATION_LOCAL_REFERENCE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); more = tvb_get_guint8(tvb, offset) & SEGMENTING_REASSEMBLING_MASK; @@ -1990,7 +2019,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, offset, DESTINATION_LOCAL_REFERENCE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SEQUENCING_SEGMENTING, offset, @@ -2003,7 +2032,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, offset, DESTINATION_LOCAL_REFERENCE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RECEIVE_SEQUENCE_NUMBER, @@ -2020,7 +2049,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, VARIABLE_POINTER(variable_pointer2, hf_sccp_variable_pointer2, POINTER_LENGTH) VARIABLE_POINTER(variable_pointer3, hf_sccp_variable_pointer3, POINTER_LENGTH) - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLED_PARTY_ADDRESS, @@ -2042,7 +2071,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, VARIABLE_POINTER(variable_pointer2, hf_sccp_variable_pointer2, POINTER_LENGTH) VARIABLE_POINTER(variable_pointer3, hf_sccp_variable_pointer3, POINTER_LENGTH) - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLED_PARTY_ADDRESS, @@ -2062,7 +2091,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, offset, DESTINATION_LOCAL_REFERENCE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1, POINTER_LENGTH); @@ -2075,7 +2104,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, PARAMETER_DESTINATION_LOCAL_REFERENCE, offset, DESTINATION_LOCAL_REFERENCE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); break; @@ -2090,7 +2119,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RESET_CAUSE, offset, RESET_CAUSE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); break; case SCCP_MSG_TYPE_RSC: @@ -2101,7 +2130,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SOURCE_LOCAL_REFERENCE, offset, SOURCE_LOCAL_REFERENCE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); break; case SCCP_MSG_TYPE_ERR: @@ -2112,7 +2141,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_ERROR_CAUSE, offset, ERROR_CAUSE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); break; case SCCP_MSG_TYPE_IT: @@ -2123,7 +2152,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_SOURCE_LOCAL_REFERENCE, offset, SOURCE_LOCAL_REFERENCE_LENGTH); - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, PROTOCOL_CLASS_LENGTH); @@ -2152,7 +2181,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, * message. */ - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLED_PARTY_ADDRESS, @@ -2238,7 +2267,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, VARIABLE_POINTER(variable_pointer3, hf_sccp_variable_pointer3, POINTER_LENGTH) OPTIONAL_POINTER(POINTER_LENGTH) - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLED_PARTY_ADDRESS, @@ -2265,7 +2294,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, VARIABLE_POINTER(variable_pointer3, hf_sccp_variable_pointer3, POINTER_LENGTH_LONG) OPTIONAL_POINTER(POINTER_LENGTH_LONG) - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLED_PARTY_ADDRESS, @@ -2294,7 +2323,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, VARIABLE_POINTER(variable_pointer3, hf_sccp_variable_pointer3, POINTER_LENGTH_LONG) OPTIONAL_POINTER(POINTER_LENGTH_LONG) - assoc = sccp_assoc(pinfo, msg_offset, slr, dlr); + assoc = get_sccp_assoc(pinfo, msg_offset, slr, dlr, message_type); dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CALLED_PARTY_ADDRESS, @@ -2325,8 +2354,8 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, for(m = assoc->msgs; m ; m = m->next) { pi = proto_tree_add_uint( pt,hf_sccp_assoc_msg,tvb,0,0,m->framenum); - if (assoc->proto != SCCP_PLOAD_NONE) - proto_item_append_text(pi," %s", val_to_str(assoc->proto, assoc_protos, "Unknown")); + if (assoc->payload != SCCP_PLOAD_NONE) + proto_item_append_text(pi," %s", val_to_str(assoc->payload, assoc_protos, "Unknown")); if (m->label) proto_item_append_text(pi," %s", m->label); @@ -2345,7 +2374,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, static void dissect_sccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *sccp_item; + proto_item *sccp_item = NULL; proto_tree *sccp_tree = NULL; const mtp3_addr_pc_t *mtp3_addr_p; @@ -2870,6 +2899,13 @@ proto_register_sccp(void) "Whether to keep infomation about messages and their associations", &trace_sccp); + + prefs_register_bool_preference(sccp_module, "show_more_info", + "Show key parameters in Info Column", + "Show SLR, DLR, and CAUSE Parameters in the Information Column of the Summary", + &show_key_params); + + register_init_routine(&init_sccp); diff --git a/epan/dissectors/packet-sccp.h b/epan/dissectors/packet-sccp.h index 9e328a7b5e..50274592d2 100644 --- a/epan/dissectors/packet-sccp.h +++ b/epan/dissectors/packet-sccp.h @@ -50,6 +50,9 @@ WS_VAR_IMPORT const value_string sccp_message_type_acro_values[]; +/* from packet-sua.c */ +WS_VAR_IMPORT const value_string sua_co_class_type_acro_values[]; + typedef enum _sccp_payload_t { SCCP_PLOAD_NONE, SCCP_PLOAD_BSSAP, @@ -79,11 +82,14 @@ typedef struct _sccp_assoc_info_t { sccp_msg_info_t* msgs; sccp_msg_info_t* curr_msg; - sccp_payload_t proto; + sccp_payload_t payload; gchar* calling_party; gchar* called_party; gchar* extra_info; } sccp_assoc_info_t; + +extern sccp_assoc_info_t* get_sccp_assoc(packet_info* pinfo, guint offset, guint32 src_lr, guint32 dst_lr, guint msg_type); + #endif diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c index 6c43f0cff6..29e3b29a0c 100644 --- a/epan/dissectors/packet-sua.c +++ b/epan/dissectors/packet-sua.c @@ -2,7 +2,7 @@ * Routines for SS7 SCCP-User Adaptation Layer (SUA) dissection * It is hopefully (needs testing) compilant to * http://www.ietf.org/internet-drafts/draft-ietf-sigtran-sua-08.txt - * http://www.ietf.org/rfc/rfc3838.txt + * http://www.ietf.org/rfc/rfc3868.txt * * Copyright 2002, 2003, 2004 Michael Tuexen <tuexen [AT] fh-muenster.de> * @@ -36,7 +36,9 @@ #include <epan/packet.h> #include <epan/prefs.h> #include <epan/sctpppids.h> -#include <packet-mtp3.h> +#include <epan/tap.h> +#include "packet-mtp3.h" +#include "packet-sccp.h" #define NETWORK_BYTE_ORDER FALSE #define ADD_PADDING(x) ((((x) + 3) >> 2) << 2) @@ -214,6 +216,21 @@ static const value_string message_class_type_acro_values[] = { { MESSAGE_CLASS_RKM_MESSAGE * 256 + MESSAGE_TYPE_DEREG_RSP , "DEREG_RSP" }, { 0, NULL } }; +const value_string sua_co_class_type_acro_values[] = { + { MESSAGE_TYPE_CORE , "CORE" }, + { MESSAGE_TYPE_COAK , "COAK" }, + { MESSAGE_TYPE_COREF , "COREF" }, + { MESSAGE_TYPE_RELRE , "RELRE" }, + { MESSAGE_TYPE_RELCO , "RELCO" }, + { MESSAGE_TYPE_RESCO , "RESCO" }, + { MESSAGE_TYPE_RESRE , "RESRE" }, + { MESSAGE_TYPE_CODT , "CODT" }, + { MESSAGE_TYPE_CODA , "CODA" }, + { MESSAGE_TYPE_COERR , "COERR" }, + { MESSAGE_TYPE_COIT , "COIT" }, + { 0, NULL } +}; + /* Initialize the protocol and registered fields */ static int proto_sua = -1; static int hf_version = -1; @@ -327,10 +344,14 @@ static gint ett_sua_receive_sequence_number_number = -1; static gint ett_sua_return_on_error_bit_and_protocol_class = -1; static gint ett_sua_protcol_classes = -1; +static int sua_tap = -1; + static dissector_handle_t data_handle; static dissector_table_t sccp_ssn_dissector_table; static heur_dissector_list_t heur_subdissector_list; +static guint32 message_class, message_type, drn, srn; + /* stuff for supporting multiple versions */ typedef enum { SUA_V08, @@ -345,7 +366,6 @@ dissect_parameters(tvbuff_t *tlv_tvb, proto_tree *tree, tvbuff_t **data_tvb, gui static void dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tree *sua_tree) { - guint8 message_class, message_type; message_class = tvb_get_guint8(common_header_tvb, MESSAGE_CLASS_OFFSET); message_type = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET); @@ -746,7 +766,8 @@ dissect_destination_address_parameter(tvbuff_t *parameter_tvb, proto_tree *param static void dissect_source_reference_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { - proto_tree_add_item(parameter_tree, hf_source_reference_number, parameter_tvb, SOURCE_REFERENCE_NUMBER_OFFSET, SOURCE_REFERENCE_NUMBER_LENGTH, NETWORK_BYTE_ORDER); + srn = tvb_get_ntohl(parameter_tvb, SOURCE_REFERENCE_NUMBER_OFFSET); + proto_tree_add_item(parameter_tree, hf_source_reference_number, parameter_tvb, SOURCE_REFERENCE_NUMBER_OFFSET, SOURCE_REFERENCE_NUMBER_LENGTH, NETWORK_BYTE_ORDER); proto_item_append_text(parameter_item, " (%u)", tvb_get_ntohl(parameter_tvb, SOURCE_REFERENCE_NUMBER_OFFSET)); } @@ -756,6 +777,7 @@ dissect_source_reference_number_parameter(tvbuff_t *parameter_tvb, proto_tree *p static void dissect_destination_reference_number_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item) { + drn = tvb_get_ntohl(parameter_tvb, DESTINATION_REFERENCE_NUMBER_OFFSET); proto_tree_add_item(parameter_tree, hf_destination_reference_number, parameter_tvb, DESTINATION_REFERENCE_NUMBER_OFFSET, DESTINATION_REFERENCE_NUMBER_LENGTH, NETWORK_BYTE_ORDER); proto_item_append_text(parameter_item, " (%u)", tvb_get_ntohl(parameter_tvb, DESTINATION_REFERENCE_NUMBER_OFFSET)); } @@ -1815,12 +1837,27 @@ dissect_sua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *sua_t guint8 source_ssn = INVALID_SSN; guint8 dest_ssn = INVALID_SSN; + message_class = 0; + message_type = 0; + drn = 0; + srn = 0; + common_header_tvb = tvb_new_subset(message_tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH); dissect_common_header(common_header_tvb, pinfo, sua_tree); parameters_tvb = tvb_new_subset(message_tvb, COMMON_HEADER_LENGTH, -1, -1); dissect_parameters(parameters_tvb, sua_tree, &data_tvb, &source_ssn, &dest_ssn); + if ( message_class == MESSAGE_CLASS_CO_MESSAGE) { + /* XXX: this might fail with multihomed SCTP (on a path failure during a call) */ + sccp_assoc_info_t* assoc = get_sccp_assoc(pinfo, offset_from_real_beginning(message_tvb,0), srn, drn, message_type); + + if (assoc && assoc->curr_msg) { + pinfo->sccp_info = assoc->curr_msg; + tap_queue_packet(sua_tap,pinfo,assoc->curr_msg); + } + } + /* If there was SUA data it could be dissected */ if(data_tvb) { @@ -1873,6 +1910,7 @@ dissect_sua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree) /* dissect the message */ dissect_sua_message(message_tvb, pinfo, sua_tree, tree); + } /* Register the protocol with Wireshark */ @@ -2017,6 +2055,7 @@ proto_register_sua(void) prefs_register_enum_preference(sua_module, "version", "SUA Version", "Version used by Wireshark", &version, options, FALSE); register_heur_dissector_list("sua", &heur_subdissector_list); + sua_tap = register_tap("sua"); } diff --git a/epan/libwireshark.def b/epan/libwireshark.def index 92ef383d31..492a3c445a 100644 --- a/epan/libwireshark.def +++ b/epan/libwireshark.def @@ -728,6 +728,7 @@ stream_find_frag stream_new_circ stream_process_reassembled string_to_name_resolve +sua_co_class_type_acro_values DATA swaptab t30_data_vals DATA t30_facsimile_control_field_vals DATA |