forked from osmocom/wireshark
packet_info.c and packet.c
add sccp_info to struct _packet_info (Sorry but the way private_data works and the fact that TCAP uses it and BSSAP/RANAP can be tunnelled on GSMMAP over TCAP makes it impossible to avoid) SCCP - Have SCCP to have a TAP, - Fix associations so that every message belongs to the association. - Export message type values so that they can be used by a tap listener RANAP - Have RANAP information attached to the sccp_info BSSAP + GSM_A - Have DTAP, BSSMAP and BSSAP info attached to the sccp_info svn path=/trunk/; revision=21076
This commit is contained in:
parent
1b2cddf0b3
commit
5fa8e75149
|
@ -56,6 +56,7 @@
|
|||
#include "packet-bssap.h"
|
||||
#include "packet-gsm_a.h"
|
||||
#include "packet-e212.h"
|
||||
#include "packet-sccp.h"
|
||||
|
||||
static void init_bssap(void);
|
||||
|
||||
|
@ -580,6 +581,9 @@ dissect_bssap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
col_set_str(pinfo->cinfo, COL_PROTOCOL, ((bssap_or_bsap_global == BSSAP) ? "BSSAP" : "BSAP"));
|
||||
}
|
||||
|
||||
if ( pinfo->sccp_info && pinfo->sccp_info->assoc )
|
||||
pinfo->sccp_info->assoc->proto = SCCP_PLOAD_BSSAP;
|
||||
|
||||
/*
|
||||
* create the bssap protocol tree
|
||||
*/
|
||||
|
@ -1627,6 +1631,10 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
|
|||
{
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BSSAP+");
|
||||
}
|
||||
|
||||
if (pinfo->sccp_info && pinfo->sccp_info->assoc)
|
||||
pinfo->sccp_info->assoc->proto = SCCP_PLOAD_BSSAP;
|
||||
|
||||
/* create the BSSAP+ protocol tree */
|
||||
bssap_item = proto_tree_add_item(tree, proto_bssap, tvb, 0, -1, FALSE);
|
||||
bssap_tree = proto_item_add_subtree(bssap_item, ett_bssap);
|
||||
|
|
|
@ -106,6 +106,7 @@
|
|||
#include "packet-q931.h"
|
||||
#include "packet-gsm_a.h"
|
||||
#include "packet-ipv6.h"
|
||||
#include "packet-sccp.h"
|
||||
|
||||
#include "packet-ppp.h"
|
||||
|
||||
|
@ -1292,6 +1293,8 @@ static proto_tree *g_tree;
|
|||
static gint comp_type_tag;
|
||||
static guint32 localValue;
|
||||
|
||||
static sccp_msg_info_t* sccp_msg;
|
||||
static sccp_assoc_info_t* sccp_assoc;
|
||||
|
||||
/*
|
||||
* this should be set on a per message basis, if possible
|
||||
|
@ -2370,7 +2373,7 @@ be_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar
|
|||
value = tvb_get_ntohs(tvb, curr_offset);
|
||||
|
||||
proto_tree_add_item(tree, hf_gsm_a_cell_lac, tvb, curr_offset, 2, FALSE);
|
||||
|
||||
|
||||
curr_offset += 2;
|
||||
|
||||
if (add_string)
|
||||
|
@ -3608,8 +3611,14 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_st
|
|||
tvb, curr_offset, len - (curr_offset - offset),
|
||||
a_bigbuf,
|
||||
"BCD Digits: %s",
|
||||
a_bigbuf);
|
||||
a_bigbuf);
|
||||
|
||||
if (sccp_assoc && ! sccp_assoc->calling_party) {
|
||||
sccp_assoc->calling_party = se_strdup_printf(
|
||||
((oct & 0x07) == 3) ? "IMEISV: %s" : "IMSI: %s",
|
||||
a_bigbuf );
|
||||
}
|
||||
|
||||
if (add_string)
|
||||
g_snprintf(add_string, string_len, " - %s (%s)",
|
||||
((oct & 0x07) == 3) ? "IMEISV" : "IMSI",
|
||||
|
@ -4221,7 +4230,12 @@ de_rr_ch_dsc(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *
|
|||
{
|
||||
str = "SDCCH/8 + SACCH/C8 or CBCH (SDCCH/8), Subchannel";
|
||||
subchannel = ((oct8 % 0x38)>>3);
|
||||
}
|
||||
} else {
|
||||
str = "";
|
||||
subchannel = 0;
|
||||
DISSECTOR_ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
other_decode_bitfield_value(a_bigbuf, oct8, 0xf8, 8);
|
||||
proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = %s %d",a_bigbuf,str,subchannel);
|
||||
}
|
||||
|
@ -4333,6 +4347,10 @@ de_rr_ch_dsc2(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar
|
|||
{
|
||||
str = "TCH/F + FACCH/F and SACCH/M + unidirectional channels at timeslot";
|
||||
subchannel = ((oct8 % 0x38)>>3);
|
||||
} else {
|
||||
str = "";
|
||||
subchannel = 0;
|
||||
DISSECTOR_ASSERT_NOT_REACHED();
|
||||
}
|
||||
other_decode_bitfield_value(a_bigbuf, oct8, 0xf8, 8);
|
||||
proto_tree_add_text(subtree,tvb, curr_offset, 1,"%s = %s %d",a_bigbuf,str,subchannel);
|
||||
|
@ -7166,6 +7184,10 @@ de_cld_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len,
|
|||
"BCD Digits: %s",
|
||||
a_bigbuf);
|
||||
|
||||
if (sccp_assoc && ! sccp_assoc->called_party) {
|
||||
sccp_assoc->called_party = se_strdup(a_bigbuf);
|
||||
}
|
||||
|
||||
curr_offset += len - (curr_offset - offset);
|
||||
|
||||
if (add_string)
|
||||
|
@ -7980,6 +8002,7 @@ static const ber_choice_t ERROR_choice[] = {
|
|||
{ 0, 0, 0, 0, NULL }
|
||||
};
|
||||
|
||||
#if 0
|
||||
static int
|
||||
dissect_ROS_ERROR(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
|
||||
offset = dissect_ber_choice(pinfo, tree, tvb, offset,
|
||||
|
@ -7987,6 +8010,7 @@ dissect_ROS_ERROR(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_i
|
|||
|
||||
return offset;
|
||||
}
|
||||
#endif
|
||||
|
||||
static guint8
|
||||
de_facility(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint fac_len, gchar *add_string _U_, int string_len _U_)
|
||||
|
@ -8922,7 +8946,7 @@ de_gmm_ftostby_h(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gch
|
|||
* [7] 10.5.5.8
|
||||
*/
|
||||
static guint8
|
||||
de_gmm_ptmsi_sig(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
|
||||
de_gmm_ptmsi_sig(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
|
||||
{
|
||||
guint32 curr_offset;
|
||||
proto_item *curr_item;
|
||||
|
@ -18077,8 +18101,17 @@ dissect_bssmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
proto_item *bssmap_item = NULL;
|
||||
proto_tree *bssmap_tree = NULL;
|
||||
const gchar *str;
|
||||
|
||||
|
||||
|
||||
sccp_msg = pinfo->sccp_info;
|
||||
|
||||
if (sccp_msg && sccp_msg->assoc) {
|
||||
sccp_assoc = sccp_msg->assoc;
|
||||
} else {
|
||||
sccp_assoc = NULL;
|
||||
sccp_msg = NULL;
|
||||
}
|
||||
|
||||
if (check_col(pinfo->cinfo, COL_INFO))
|
||||
{
|
||||
col_append_str(pinfo->cinfo, COL_INFO, "(BSSMAP) ");
|
||||
|
@ -18110,6 +18143,10 @@ dissect_bssmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
str = match_strval_idx((guint32) oct, gsm_a_bssmap_msg_strings, &idx);
|
||||
|
||||
if (sccp_msg && !sccp_msg->label) {
|
||||
sccp_msg->label = se_strdup(val_to_str((guint32) oct, gsm_a_bssmap_msg_strings, "BSSMAP (0x%02x)"));
|
||||
}
|
||||
|
||||
/*
|
||||
* create the protocol tree
|
||||
*/
|
||||
|
@ -18321,6 +18358,15 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
break;
|
||||
}
|
||||
|
||||
sccp_msg = pinfo->sccp_info;
|
||||
|
||||
if (sccp_msg && sccp_msg->assoc) {
|
||||
sccp_assoc = sccp_msg->assoc;
|
||||
} else {
|
||||
sccp_assoc = NULL;
|
||||
sccp_msg = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* create the protocol tree
|
||||
*/
|
||||
|
@ -18332,6 +18378,12 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
oct);
|
||||
|
||||
dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap_msg);
|
||||
|
||||
if (sccp_msg && !sccp_msg->label) {
|
||||
sccp_msg->label = se_strdup_printf("DTAP (0x%02x)",oct);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -18342,6 +18394,10 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
dtap_tree = proto_item_add_subtree(dtap_item, ett_tree);
|
||||
|
||||
if (sccp_msg && !sccp_msg->label) {
|
||||
sccp_msg->label = se_strdup(msg_str);
|
||||
}
|
||||
|
||||
if (check_col(pinfo->cinfo, COL_INFO))
|
||||
{
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Do not modify this file. */
|
||||
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
|
||||
/* .\packet-ranap.c */
|
||||
/* ./packet-ranap.c */
|
||||
/* ../../tools/asn2wrs.py -e -F -p ranap -c ranap.cnf -s packet-ranap-template ranap.asn */
|
||||
|
||||
/* Input file: packet-ranap-template.c */
|
||||
|
@ -40,6 +40,7 @@
|
|||
#include <epan/prefs.h>
|
||||
#include <epan/conversation.h>
|
||||
#include <epan/tap.h>
|
||||
#include <epan/emem.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -48,6 +49,7 @@
|
|||
#include "packet-per.h"
|
||||
#include "packet-ranap.h"
|
||||
#include "packet-e212.h"
|
||||
#include "packet-sccp.h"
|
||||
|
||||
#define SCCP_SSN_RANAP 0x8E
|
||||
|
||||
|
@ -592,7 +594,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 67 "packet-ranap-template.c"
|
||||
#line 69 "packet-ranap-template.c"
|
||||
|
||||
/* Initialize the subtree pointers */
|
||||
static int ett_ranap = -1;
|
||||
|
@ -859,7 +861,7 @@ static gint ett_ranap_PrivateIE_Container = -1;
|
|||
static gint ett_ranap_PrivateIE_Field = -1;
|
||||
|
||||
/*--- End of included file: packet-ranap-ett.c ---*/
|
||||
#line 72 "packet-ranap-template.c"
|
||||
#line 74 "packet-ranap-template.c"
|
||||
|
||||
|
||||
/* Global variables */
|
||||
|
@ -868,6 +870,7 @@ static guint type_of_message;
|
|||
static guint32 ProcedureCode;
|
||||
static guint32 ProtocolIE_ID;
|
||||
|
||||
|
||||
static int dissect_ranap_ies(tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree);
|
||||
static int dissect_ranap_FirstValue_ies(tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree);
|
||||
static int dissect_ranap_SecondValue_ies(tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree);
|
||||
|
@ -9755,7 +9758,7 @@ static int dissect_RANAP_PDU_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
|
|||
|
||||
|
||||
/*--- End of included file: packet-ranap-fn.c ---*/
|
||||
#line 85 "packet-ranap-template.c"
|
||||
#line 88 "packet-ranap-template.c"
|
||||
|
||||
|
||||
|
||||
|
@ -10230,6 +10233,7 @@ static int dissect_ranap_ies(tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_
|
|||
break;
|
||||
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
@ -10743,6 +10747,7 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
/* make entry in the Protocol column on summary display */
|
||||
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RANAP");
|
||||
|
||||
|
||||
/* create the ranap protocol tree */
|
||||
ranap_item = proto_tree_add_item(tree, proto_ranap, tvb, 0, -1, FALSE);
|
||||
|
@ -10750,6 +10755,18 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
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;
|
||||
|
||||
if (! sccp_msg->label) {
|
||||
sccp_msg->label = se_strdup(str);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -10787,6 +10804,7 @@ dissect_sccp_ranap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
dissect_ranap(tvb, pinfo, tree);
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -12889,7 +12907,7 @@ void proto_register_ranap(void) {
|
|||
"ranap.RANAP_PRIVATE_IES_Value", HFILL }},
|
||||
|
||||
/*--- End of included file: packet-ranap-hfarr.c ---*/
|
||||
#line 1150 "packet-ranap-template.c"
|
||||
#line 1168 "packet-ranap-template.c"
|
||||
};
|
||||
|
||||
/* List of subtrees */
|
||||
|
@ -13158,7 +13176,7 @@ void proto_register_ranap(void) {
|
|||
&ett_ranap_PrivateIE_Field,
|
||||
|
||||
/*--- End of included file: packet-ranap-ettarr.c ---*/
|
||||
#line 1157 "packet-ranap-template.c"
|
||||
#line 1175 "packet-ranap-template.c"
|
||||
};
|
||||
|
||||
/* Register protocol */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Do not modify this file. */
|
||||
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
|
||||
/* .\packet-ranap.h */
|
||||
/* ./packet-ranap.h */
|
||||
/* ../../tools/asn2wrs.py -e -F -p ranap -c ranap.cnf -s packet-ranap-template ranap.asn */
|
||||
|
||||
/* Input file: packet-ranap-template.h */
|
||||
|
|
|
@ -52,83 +52,62 @@
|
|||
#include <epan/reassemble.h>
|
||||
#include "packet-tcap.h"
|
||||
#include "packet-sccp.h"
|
||||
#include "tap.h"
|
||||
|
||||
static Standard_Type decode_mtp3_standard;
|
||||
#define SCCP_SI 3
|
||||
|
||||
#define MESSAGE_TYPE_OFFSET 0
|
||||
#define MESSAGE_TYPE_LENGTH 1
|
||||
#define SCCP_MSG_TYPE_OFFSET 0
|
||||
#define SCCP_MSG_TYPE_LENGTH 1
|
||||
#define POINTER_LENGTH 1
|
||||
#define POINTER_LENGTH_LONG 2
|
||||
|
||||
#define MESSAGE_TYPE_CR 0x01
|
||||
#define MESSAGE_TYPE_CC 0x02
|
||||
#define MESSAGE_TYPE_CREF 0x03
|
||||
#define MESSAGE_TYPE_RLSD 0x04
|
||||
#define MESSAGE_TYPE_RLC 0x05
|
||||
#define MESSAGE_TYPE_DT1 0x06
|
||||
#define MESSAGE_TYPE_DT2 0x07
|
||||
#define MESSAGE_TYPE_AK 0x08
|
||||
#define MESSAGE_TYPE_UDT 0x09
|
||||
#define MESSAGE_TYPE_UDTS 0x0a
|
||||
#define MESSAGE_TYPE_ED 0x0b
|
||||
#define MESSAGE_TYPE_EA 0x0c
|
||||
#define MESSAGE_TYPE_RSR 0x0d
|
||||
#define MESSAGE_TYPE_RSC 0x0e
|
||||
#define MESSAGE_TYPE_ERR 0x0f
|
||||
#define MESSAGE_TYPE_IT 0x10
|
||||
#define MESSAGE_TYPE_XUDT 0x11
|
||||
#define MESSAGE_TYPE_XUDTS 0x12
|
||||
/* The below 2 are ITU only */
|
||||
#define MESSAGE_TYPE_LUDT 0x13
|
||||
#define MESSAGE_TYPE_LUDTS 0x14
|
||||
|
||||
/* Same as below but with names typed out */
|
||||
static const value_string sccp_message_type_values[] = {
|
||||
{ MESSAGE_TYPE_CR, "Connection Request" },
|
||||
{ MESSAGE_TYPE_CC, "Connection Confirm" },
|
||||
{ MESSAGE_TYPE_CREF, "Connection Refused" },
|
||||
{ MESSAGE_TYPE_RLSD, "Released" },
|
||||
{ MESSAGE_TYPE_RLC, "Release Complete" },
|
||||
{ MESSAGE_TYPE_DT1, "Data Form 1" },
|
||||
{ MESSAGE_TYPE_DT2, "Data Form 2" },
|
||||
{ MESSAGE_TYPE_AK, "Data Acknowledgement" },
|
||||
{ MESSAGE_TYPE_UDT, "Unitdata" },
|
||||
{ MESSAGE_TYPE_UDTS, "Unitdata Service" },
|
||||
{ MESSAGE_TYPE_ED, "Expedited Data" },
|
||||
{ MESSAGE_TYPE_EA, "Expedited Data Acknowledgement" },
|
||||
{ MESSAGE_TYPE_RSR, "Reset Request" },
|
||||
{ MESSAGE_TYPE_RSC, "Reset Confirmation" },
|
||||
{ MESSAGE_TYPE_ERR, "Error" },
|
||||
{ MESSAGE_TYPE_IT, "Inactivity Timer" },
|
||||
{ MESSAGE_TYPE_XUDT, "Extended Unitdata" },
|
||||
{ MESSAGE_TYPE_XUDTS, "Extended Unitdata Service" },
|
||||
{ MESSAGE_TYPE_LUDT, "Long Unitdata (ITU)" },
|
||||
{ MESSAGE_TYPE_LUDTS, "Long Unitdata Service (ITU)" },
|
||||
{ SCCP_MSG_TYPE_CR, "Connection Request" },
|
||||
{ SCCP_MSG_TYPE_CC, "Connection Confirm" },
|
||||
{ SCCP_MSG_TYPE_CREF, "Connection Refused" },
|
||||
{ SCCP_MSG_TYPE_RLSD, "Released" },
|
||||
{ SCCP_MSG_TYPE_RLC, "Release Complete" },
|
||||
{ SCCP_MSG_TYPE_DT1, "Data Form 1" },
|
||||
{ SCCP_MSG_TYPE_DT2, "Data Form 2" },
|
||||
{ SCCP_MSG_TYPE_AK, "Data Acknowledgement" },
|
||||
{ SCCP_MSG_TYPE_UDT, "Unitdata" },
|
||||
{ SCCP_MSG_TYPE_UDTS, "Unitdata Service" },
|
||||
{ SCCP_MSG_TYPE_ED, "Expedited Data" },
|
||||
{ SCCP_MSG_TYPE_EA, "Expedited Data Acknowledgement" },
|
||||
{ SCCP_MSG_TYPE_RSR, "Reset Request" },
|
||||
{ SCCP_MSG_TYPE_RSC, "Reset Confirmation" },
|
||||
{ SCCP_MSG_TYPE_ERR, "Error" },
|
||||
{ SCCP_MSG_TYPE_IT, "Inactivity Timer" },
|
||||
{ SCCP_MSG_TYPE_XUDT, "Extended Unitdata" },
|
||||
{ SCCP_MSG_TYPE_XUDTS, "Extended Unitdata Service" },
|
||||
{ SCCP_MSG_TYPE_LUDT, "Long Unitdata (ITU)" },
|
||||
{ SCCP_MSG_TYPE_LUDTS, "Long Unitdata Service (ITU)" },
|
||||
{ 0, NULL } };
|
||||
|
||||
/* 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" },
|
||||
{ MESSAGE_TYPE_CREF, "CREF" },
|
||||
{ MESSAGE_TYPE_RLSD, "RLSD" },
|
||||
{ MESSAGE_TYPE_RLC, "RLC" },
|
||||
{ MESSAGE_TYPE_DT1, "DT1" },
|
||||
{ MESSAGE_TYPE_DT2, "DT2" },
|
||||
{ MESSAGE_TYPE_AK, "AK" },
|
||||
{ MESSAGE_TYPE_UDT, "UDT" },
|
||||
{ MESSAGE_TYPE_UDTS, "UDTS" },
|
||||
{ MESSAGE_TYPE_ED, "ED" },
|
||||
{ MESSAGE_TYPE_EA, "EA" },
|
||||
{ MESSAGE_TYPE_RSR, "RSR" },
|
||||
{ MESSAGE_TYPE_RSC, "RSC" },
|
||||
{ MESSAGE_TYPE_ERR, "ERR" },
|
||||
{ MESSAGE_TYPE_IT, "IT" },
|
||||
{ MESSAGE_TYPE_XUDT, "XUDT" },
|
||||
{ MESSAGE_TYPE_XUDTS, "XUDTS" },
|
||||
{ MESSAGE_TYPE_LUDT, "LUDT" },
|
||||
{ MESSAGE_TYPE_LUDTS, "LUDTS" },
|
||||
const value_string sccp_message_type_acro_values[] = {
|
||||
{ SCCP_MSG_TYPE_CR, "CR" },
|
||||
{ SCCP_MSG_TYPE_CC, "CC" },
|
||||
{ SCCP_MSG_TYPE_CREF, "CREF" },
|
||||
{ SCCP_MSG_TYPE_RLSD, "RLSD" },
|
||||
{ SCCP_MSG_TYPE_RLC, "RLC" },
|
||||
{ SCCP_MSG_TYPE_DT1, "DT1" },
|
||||
{ SCCP_MSG_TYPE_DT2, "DT2" },
|
||||
{ SCCP_MSG_TYPE_AK, "AK" },
|
||||
{ SCCP_MSG_TYPE_UDT, "UDT" },
|
||||
{ SCCP_MSG_TYPE_UDTS, "UDTS" },
|
||||
{ SCCP_MSG_TYPE_ED, "ED" },
|
||||
{ SCCP_MSG_TYPE_EA, "EA" },
|
||||
{ SCCP_MSG_TYPE_RSR, "RSR" },
|
||||
{ SCCP_MSG_TYPE_RSC, "RSC" },
|
||||
{ SCCP_MSG_TYPE_ERR, "ERR" },
|
||||
{ SCCP_MSG_TYPE_IT, "IT" },
|
||||
{ SCCP_MSG_TYPE_XUDT, "XUDT" },
|
||||
{ SCCP_MSG_TYPE_XUDTS, "XUDTS" },
|
||||
{ SCCP_MSG_TYPE_LUDT, "LUDT" },
|
||||
{ SCCP_MSG_TYPE_LUDTS, "LUDTS" },
|
||||
{ 0, NULL } };
|
||||
|
||||
#define PARAMETER_LENGTH_LENGTH 1
|
||||
|
@ -693,6 +672,9 @@ static gint ett_sccp_assoc = -1;
|
|||
/* Declarations to desegment XUDT Messages */
|
||||
static gboolean sccp_xudt_desegment = TRUE;
|
||||
|
||||
static int sccp_tap = -1;
|
||||
|
||||
|
||||
static const fragment_items sccp_xudt_msg_frag_items = {
|
||||
/* Fragment subtrees */
|
||||
&ett_sccp_xudt_msg_fragment,
|
||||
|
@ -740,174 +722,147 @@ static dissector_table_t sccp_ssn_dissector_table;
|
|||
|
||||
static emem_tree_t* assocs = NULL;
|
||||
static sccp_assoc_info_t* assoc;
|
||||
static sccp_assoc_info_t no_assoc = {0,0,0,0,0,FALSE,FALSE,NULL,SCCP_PLOAD_NONE,NULL,NULL};
|
||||
static sccp_assoc_info_t no_assoc = {0,0,0,0,0,FALSE,FALSE,NULL,NULL,SCCP_PLOAD_NONE,NULL,NULL,NULL};
|
||||
static gboolean trace_sccp = FALSE;
|
||||
static guint32 next_assoc_id = 0;
|
||||
|
||||
static sccp_assoc_info_t* sccp_assoc(packet_info* pinfo, guint offset, guint src_lr, guint dst_lr) {
|
||||
static const value_string assoc_protos[] = {
|
||||
{ SCCP_PLOAD_BSSAP, "BSSAP" },
|
||||
{ SCCP_PLOAD_RANAP, "RANAP" },
|
||||
{ 0 , NULL }
|
||||
};
|
||||
|
||||
static sccp_assoc_info_t* new_assoc(guint32 calling, guint32 called){
|
||||
sccp_assoc_info_t* a = se_alloc(sizeof(sccp_assoc_info_t));
|
||||
|
||||
a->id = next_assoc_id++;
|
||||
a->calling_dpc = calling;
|
||||
a->called_dpc = called;
|
||||
a->calling_ssn = INVALID_SSN;
|
||||
a->called_ssn = INVALID_SSN;
|
||||
a->has_fw_key = FALSE;
|
||||
a->has_bw_key = FALSE;
|
||||
a->proto = SCCP_PLOAD_NONE;
|
||||
a->calling_party = NULL;
|
||||
a->called_party = NULL;
|
||||
a->extra_info = NULL;
|
||||
a->msgs = NULL;
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
static sccp_assoc_info_t* sccp_assoc(packet_info* pinfo, guint offset, guint32 src_lr, guint32 dst_lr) {
|
||||
guint32 opck, dpck;
|
||||
address* opc = &(pinfo->src);
|
||||
address* dpc = &(pinfo->dst);
|
||||
guint framenum = pinfo->fd->num;
|
||||
|
||||
if (assoc)
|
||||
return assoc;
|
||||
|
||||
return assoc;
|
||||
|
||||
if (!src_lr && !dst_lr){
|
||||
return &no_assoc;
|
||||
return &no_assoc;
|
||||
}
|
||||
|
||||
|
||||
opck = opc->type == AT_SS7PC ? mtp3_pc_hash(opc->data) : g_str_hash(address_to_str(opc));
|
||||
dpck = dpc->type == AT_SS7PC ? mtp3_pc_hash(dpc->data) : g_str_hash(address_to_str(dpc));
|
||||
|
||||
|
||||
|
||||
switch (message_type) {
|
||||
case MESSAGE_TYPE_CR:
|
||||
{
|
||||
/* Calling and called is seen from initiator of CR */
|
||||
emem_tree_key_t key[] = {
|
||||
{1, NULL},
|
||||
{1, NULL},
|
||||
{1, NULL},
|
||||
{0, NULL}
|
||||
};
|
||||
case SCCP_MSG_TYPE_CR:
|
||||
{
|
||||
/* CR contains the opc,dpc,dlr key of backward messages swapped as dpc,opc,slr */
|
||||
emem_tree_key_t bw_key[] = {
|
||||
{1, &dpck}, {1, &opck}, {1, &src_lr}, {0, NULL}
|
||||
};
|
||||
|
||||
key[0].key = &dpck;
|
||||
key[1].key = &opck;
|
||||
key[2].key = &src_lr;
|
||||
|
||||
if (! ( assoc = se_tree_lookup32_array(assocs,key) ) ) {
|
||||
assoc = se_alloc(sizeof(sccp_assoc_info_t));
|
||||
|
||||
assoc->id = next_assoc_id++;
|
||||
assoc->calling_dpc = dpck;
|
||||
assoc->called_dpc = opck;
|
||||
assoc->calling_ssn = INVALID_SSN;
|
||||
assoc->called_ssn = INVALID_SSN;
|
||||
assoc->has_calling_key = FALSE;
|
||||
assoc->has_called_key = TRUE;
|
||||
assoc->pload = SCCP_PLOAD_NONE;
|
||||
assoc->private_data = NULL;
|
||||
assoc->msgs = NULL;
|
||||
|
||||
se_tree_insert32_array(assocs,key,assoc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MESSAGE_TYPE_CC:
|
||||
{
|
||||
/* Calling and called is seen from initiator of CR */
|
||||
emem_tree_key_t called_key[] = {
|
||||
{1, NULL},
|
||||
{1, NULL},
|
||||
{1, NULL},
|
||||
{0, NULL}
|
||||
};
|
||||
emem_tree_key_t calling_key[] = {
|
||||
{1, NULL},
|
||||
{1, NULL},
|
||||
{1, NULL},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
called_key[0].key = &opck;
|
||||
called_key[1].key = &dpck;
|
||||
called_key[2].key = &dst_lr;
|
||||
|
||||
calling_key[0].key = &dpck;
|
||||
calling_key[1].key = &opck;
|
||||
calling_key[2].key = &src_lr;
|
||||
|
||||
if (( assoc = se_tree_lookup32_array(assocs,calling_key) )) {
|
||||
if ( ! assoc->has_called_key ) {
|
||||
se_tree_insert32_array(assocs,called_key,assoc);
|
||||
assoc->has_called_key = TRUE;
|
||||
if (! ( assoc = se_tree_lookup32_array(assocs,bw_key) ) && ! pinfo->fd->flags.visited ) {
|
||||
assoc = new_assoc(opck,dpck);
|
||||
se_tree_insert32_array(assocs,bw_key,assoc);
|
||||
assoc->has_bw_key = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (( assoc = se_tree_lookup32_array(assocs,called_key) )) {
|
||||
if ( ! assoc->has_calling_key ) {
|
||||
se_tree_insert32_array(assocs,calling_key,assoc);
|
||||
assoc->has_calling_key = TRUE;
|
||||
case SCCP_MSG_TYPE_CC:
|
||||
{
|
||||
emem_tree_key_t fw_key[] = {
|
||||
{1, &dpck}, {1, &opck}, {1, &src_lr}, {0, NULL}
|
||||
};
|
||||
emem_tree_key_t bw_key[] = {
|
||||
{1, &opck}, {1, &dpck}, {1, &dst_lr}, {0, NULL}
|
||||
};
|
||||
|
||||
if ( ( assoc = se_tree_lookup32_array(assocs,bw_key) ) ) {
|
||||
goto got_assoc;
|
||||
}
|
||||
|
||||
if ( (assoc = se_tree_lookup32_array(assocs,fw_key) ) ) {
|
||||
goto got_assoc;
|
||||
}
|
||||
|
||||
assoc = new_assoc(opck,dpck);
|
||||
|
||||
got_assoc:
|
||||
if ( ! pinfo->fd->flags.visited && ! assoc->has_bw_key ) {
|
||||
|
||||
se_tree_insert32_array(assocs,bw_key,assoc);
|
||||
assoc->has_bw_key = TRUE;
|
||||
}
|
||||
|
||||
if ( ! pinfo->fd->flags.visited && ! assoc->has_fw_key ) {
|
||||
se_tree_insert32_array(assocs,fw_key,assoc);
|
||||
assoc->has_fw_key = TRUE;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
assoc = se_alloc(sizeof(sccp_assoc_info_t));
|
||||
default:
|
||||
{
|
||||
emem_tree_key_t key[] = {
|
||||
{1, &opck}, {1, &dpck}, {1, &dst_lr}, {0, NULL}
|
||||
};
|
||||
|
||||
assoc = se_tree_lookup32_array(assocs,key);
|
||||
|
||||
assoc->id = next_assoc_id++;
|
||||
assoc->calling_dpc = dpck;
|
||||
assoc->called_dpc = opck;
|
||||
assoc->calling_ssn = INVALID_SSN;
|
||||
assoc->called_ssn = INVALID_SSN;
|
||||
assoc->has_calling_key = TRUE;
|
||||
assoc->has_called_key = TRUE;
|
||||
assoc->pload = SCCP_PLOAD_NONE;
|
||||
assoc->private_data = NULL;
|
||||
assoc->msgs = NULL;
|
||||
|
||||
se_tree_insert32_array(assocs,calling_key,assoc);
|
||||
se_tree_insert32_array(assocs,called_key,assoc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
emem_tree_key_t calling_key[] = {
|
||||
{1, NULL},
|
||||
{1, NULL},
|
||||
{1, NULL},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
calling_key[0].key = &opck;
|
||||
calling_key[1].key = &dpck;
|
||||
calling_key[2].key = &dst_lr;
|
||||
|
||||
assoc = se_tree_lookup32_array(assocs,calling_key);
|
||||
/* Should a check be made on pinfo->p2p_dir ??? */
|
||||
if (!assoc){
|
||||
emem_tree_key_t called_key[] = {
|
||||
{1, NULL},
|
||||
{1, NULL},
|
||||
{1, NULL},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
called_key[0].key = &dpck;
|
||||
called_key[1].key = &opck;
|
||||
called_key[2].key = &dst_lr;
|
||||
assoc = se_tree_lookup32_array(assocs,called_key);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (assoc && trace_sccp) {
|
||||
|
||||
if (assoc && trace_sccp) {
|
||||
if ( ! pinfo->fd->flags.visited) {
|
||||
sccp_msg_info_t* msg = se_alloc(sizeof(sccp_msg_info_t));
|
||||
msg->framenum = framenum;
|
||||
msg->offset = offset;
|
||||
msg->info = NULL;
|
||||
msg->private_data = NULL;
|
||||
msg->next = NULL;
|
||||
|
||||
if (assoc->msgs) {
|
||||
sccp_msg_info_t* m;
|
||||
for (m = assoc->msgs; m->next; m = m->next) ;
|
||||
m->next = msg;
|
||||
} else {
|
||||
assoc->msgs = msg;
|
||||
}
|
||||
|
||||
assoc->cur_msg = msg;
|
||||
sccp_msg_info_t* msg = se_alloc(sizeof(sccp_msg_info_t));
|
||||
msg->framenum = framenum;
|
||||
msg->offset = offset;
|
||||
msg->next = NULL;
|
||||
msg->assoc = assoc;
|
||||
msg->label = NULL;
|
||||
msg->comment = NULL;
|
||||
msg->type = message_type;
|
||||
|
||||
if (assoc->msgs) {
|
||||
sccp_msg_info_t* m;
|
||||
for (m = assoc->msgs; m->next; m = m->next) ;
|
||||
m->next = msg;
|
||||
} else {
|
||||
assoc->msgs = msg;
|
||||
}
|
||||
|
||||
assoc->curr_msg = msg;
|
||||
|
||||
} else {
|
||||
sccp_msg_info_t* m;
|
||||
for (m = assoc->msgs; m; m = m->next) {
|
||||
if (m->framenum == framenum && m->offset == offset) {
|
||||
assoc->cur_msg = m;
|
||||
break;
|
||||
|
||||
sccp_msg_info_t* m;
|
||||
|
||||
for (m = assoc->msgs; m; m = m->next) {
|
||||
if (m->framenum == framenum && m->offset == offset) {
|
||||
assoc->curr_msg = m;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return assoc ? assoc : &no_assoc;
|
||||
|
||||
return assoc ? assoc : &no_assoc;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1448,53 +1403,52 @@ dissect_sccp_refusal_cause_param(tvbuff_t *tvb, proto_tree *tree, guint length)
|
|||
static void
|
||||
dissect_sccp_data_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
guint8 ssn;
|
||||
guint8 other_ssn;
|
||||
void* save_priv_data = pinfo->private_data;
|
||||
guint8 ssn = INVALID_SSN;
|
||||
guint8 other_ssn = INVALID_SSN;
|
||||
|
||||
if (assoc) {
|
||||
other_ssn = INVALID_SSN;
|
||||
if (trace_sccp && assoc && assoc != &no_assoc) {
|
||||
pinfo->sccp_info = assoc->curr_msg;
|
||||
} else {
|
||||
pinfo->sccp_info = NULL;
|
||||
}
|
||||
|
||||
if ( assoc ) {
|
||||
other_ssn = INVALID_SSN;
|
||||
|
||||
switch (pinfo->p2p_dir) {
|
||||
case P2P_DIR_SENT:
|
||||
ssn = assoc->calling_ssn;
|
||||
break;
|
||||
case P2P_DIR_RECV:
|
||||
ssn = assoc->called_ssn;
|
||||
break;
|
||||
default:
|
||||
switch (pinfo->p2p_dir) {
|
||||
case P2P_DIR_SENT:
|
||||
ssn = assoc->calling_ssn;
|
||||
break;
|
||||
case P2P_DIR_RECV:
|
||||
ssn = assoc->called_ssn;
|
||||
break;
|
||||
default:
|
||||
ssn = assoc->called_ssn;
|
||||
other_ssn = assoc->calling_ssn;
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
ssn = assoc->called_ssn;
|
||||
other_ssn = assoc->calling_ssn;
|
||||
break;
|
||||
}
|
||||
pinfo->private_data = assoc;
|
||||
|
||||
} else {
|
||||
ssn = assoc->called_ssn;
|
||||
other_ssn = assoc->calling_ssn;
|
||||
pinfo->private_data = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (ssn != INVALID_SSN && dissector_try_port(sccp_ssn_dissector_table, ssn, tvb, pinfo, tree)) {
|
||||
goto done;
|
||||
return;
|
||||
}
|
||||
|
||||
if (other_ssn != INVALID_SSN && dissector_try_port(sccp_ssn_dissector_table, other_ssn, tvb, pinfo, tree)) {
|
||||
goto done;
|
||||
return;
|
||||
}
|
||||
|
||||
/* try heuristic subdissector list to see if there are any takers */
|
||||
if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree)) {
|
||||
goto done;
|
||||
return;
|
||||
}
|
||||
|
||||
/* No sub-dissection occured, treat it as raw data */
|
||||
call_dissector(data_handle, tvb, pinfo, tree);
|
||||
|
||||
done:
|
||||
pinfo->private_data = save_priv_data;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1618,8 +1572,7 @@ dissect_sccp_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
break;
|
||||
|
||||
default:
|
||||
if (!sccp_tree)
|
||||
return(parameter_length);
|
||||
if (!sccp_tree) return(parameter_length);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1853,8 +1806,8 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
|
||||
|
||||
/* Extract the message type; all other processing is based on this */
|
||||
message_type = tvb_get_guint8(tvb, MESSAGE_TYPE_OFFSET);
|
||||
offset = MESSAGE_TYPE_LENGTH;
|
||||
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 ",
|
||||
|
@ -1863,7 +1816,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
if (sccp_tree) {
|
||||
/* add the message type to the protocol tree */
|
||||
proto_tree_add_uint(sccp_tree, hf_sccp_message_type, tvb,
|
||||
MESSAGE_TYPE_OFFSET, MESSAGE_TYPE_LENGTH, message_type);
|
||||
SCCP_MSG_TYPE_OFFSET, SCCP_MSG_TYPE_LENGTH, message_type);
|
||||
|
||||
};
|
||||
|
||||
|
@ -1871,17 +1824,20 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
dlr = 0;
|
||||
slr = 0;
|
||||
assoc = NULL;
|
||||
|
||||
no_assoc.calling_dpc = 0;
|
||||
no_assoc.called_dpc = 0;
|
||||
no_assoc.calling_ssn = INVALID_SSN;
|
||||
no_assoc.called_ssn = INVALID_SSN;
|
||||
no_assoc.has_calling_key = FALSE;
|
||||
no_assoc.has_called_key = FALSE;
|
||||
no_assoc.pload = SCCP_PLOAD_NONE;
|
||||
no_assoc.private_data = NULL;
|
||||
no_assoc.has_fw_key = FALSE;
|
||||
no_assoc.has_bw_key = FALSE;
|
||||
no_assoc.proto = SCCP_PLOAD_NONE;
|
||||
no_assoc.called_party = NULL;
|
||||
no_assoc.calling_party = NULL;
|
||||
no_assoc.extra_info = NULL;
|
||||
|
||||
switch(message_type) {
|
||||
case MESSAGE_TYPE_CR:
|
||||
case SCCP_MSG_TYPE_CR:
|
||||
/* TTC and NTT (Japan) say that the connection-oriented messages are
|
||||
* deleted (not standardized), but they appear to be used anyway, so
|
||||
* we'll dissect it...
|
||||
|
@ -1902,7 +1858,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
variable_pointer1);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_CC:
|
||||
case SCCP_MSG_TYPE_CC:
|
||||
/* TODO: connection has been established; theoretically we could keep
|
||||
* keep track of the SLR/DLR with the called/calling from the CR and
|
||||
* track the connection (e.g., on subsequent messages regarding this
|
||||
|
@ -1925,7 +1881,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
OPTIONAL_POINTER(POINTER_LENGTH);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_CREF:
|
||||
case SCCP_MSG_TYPE_CREF:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_DESTINATION_LOCAL_REFERENCE,
|
||||
offset,
|
||||
|
@ -1939,7 +1895,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
OPTIONAL_POINTER(POINTER_LENGTH);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_RLSD:
|
||||
case SCCP_MSG_TYPE_RLSD:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_DESTINATION_LOCAL_REFERENCE,
|
||||
offset,
|
||||
|
@ -1958,7 +1914,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
assoc = sccp_assoc(pinfo, msg_offset, slr, dlr);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_RLC:
|
||||
case SCCP_MSG_TYPE_RLC:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_DESTINATION_LOCAL_REFERENCE,
|
||||
offset,
|
||||
|
@ -1971,7 +1927,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_DT1:
|
||||
case SCCP_MSG_TYPE_DT1:
|
||||
source_local_ref = tvb_get_letoh24(tvb, offset);
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_DESTINATION_LOCAL_REFERENCE,
|
||||
|
@ -2028,7 +1984,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
/* End reassemble */
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_DT2:
|
||||
case SCCP_MSG_TYPE_DT2:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_DESTINATION_LOCAL_REFERENCE,
|
||||
offset,
|
||||
|
@ -2041,7 +1997,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
SEQUENCING_SEGMENTING_LENGTH);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_AK:
|
||||
case SCCP_MSG_TYPE_AK:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_DESTINATION_LOCAL_REFERENCE,
|
||||
offset,
|
||||
|
@ -2056,7 +2012,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
PARAMETER_CREDIT, offset, CREDIT_LENGTH);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_UDT:
|
||||
case SCCP_MSG_TYPE_UDT:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_CLASS, offset,
|
||||
PROTOCOL_CLASS_LENGTH);
|
||||
|
@ -2077,7 +2033,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
variable_pointer3);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_UDTS:
|
||||
case SCCP_MSG_TYPE_UDTS:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_RETURN_CAUSE, offset,
|
||||
RETURN_CAUSE_LENGTH);
|
||||
|
@ -2100,7 +2056,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
variable_pointer3);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_ED:
|
||||
case SCCP_MSG_TYPE_ED:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_DESTINATION_LOCAL_REFERENCE,
|
||||
offset,
|
||||
|
@ -2114,7 +2070,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
variable_pointer1);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_EA:
|
||||
case SCCP_MSG_TYPE_EA:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_DESTINATION_LOCAL_REFERENCE,
|
||||
offset,
|
||||
|
@ -2123,7 +2079,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_RSR:
|
||||
case SCCP_MSG_TYPE_RSR:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_DESTINATION_LOCAL_REFERENCE,
|
||||
offset,
|
||||
|
@ -2137,7 +2093,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
assoc = sccp_assoc(pinfo, msg_offset, slr, dlr);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_RSC:
|
||||
case SCCP_MSG_TYPE_RSC:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_DESTINATION_LOCAL_REFERENCE,
|
||||
offset,
|
||||
|
@ -2148,7 +2104,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
assoc = sccp_assoc(pinfo, msg_offset, slr, dlr);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_ERR:
|
||||
case SCCP_MSG_TYPE_ERR:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_DESTINATION_LOCAL_REFERENCE,
|
||||
offset,
|
||||
|
@ -2159,7 +2115,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
assoc = sccp_assoc(pinfo, msg_offset, slr, dlr);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_IT:
|
||||
case SCCP_MSG_TYPE_IT:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_DESTINATION_LOCAL_REFERENCE,
|
||||
offset,
|
||||
|
@ -2178,7 +2134,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
PARAMETER_CREDIT, offset, CREDIT_LENGTH);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_XUDT:
|
||||
case SCCP_MSG_TYPE_XUDT:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_CLASS, offset,
|
||||
PROTOCOL_CLASS_LENGTH);
|
||||
|
@ -2269,7 +2225,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
}
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_XUDTS:
|
||||
case SCCP_MSG_TYPE_XUDTS:
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
PARAMETER_RETURN_CAUSE, offset,
|
||||
RETURN_CAUSE_LENGTH);
|
||||
|
@ -2294,7 +2250,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
variable_pointer3);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_LUDT:
|
||||
case SCCP_MSG_TYPE_LUDT:
|
||||
if (decode_mtp3_standard != ANSI_STANDARD)
|
||||
{
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
|
@ -2323,7 +2279,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
dissect_sccp_unknown_message(tvb, sccp_tree);
|
||||
break;
|
||||
|
||||
case MESSAGE_TYPE_LUDTS:
|
||||
case SCCP_MSG_TYPE_LUDTS:
|
||||
if (decode_mtp3_standard != ANSI_STANDARD)
|
||||
{
|
||||
offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
|
||||
|
@ -2368,11 +2324,18 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
|
|||
sccp_msg_info_t* m;
|
||||
for(m = assoc->msgs; m ; m = m->next) {
|
||||
pi = proto_tree_add_uint( pt,hf_sccp_assoc_msg,tvb,0,0,m->framenum);
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
if (m->info) proto_item_append_text(pi," %s", m->info);
|
||||
|
||||
if (assoc->proto != SCCP_PLOAD_NONE)
|
||||
proto_item_append_text(pi," %s", val_to_str(assoc->proto, assoc_protos, "Unknown"));
|
||||
|
||||
if (m->label)
|
||||
proto_item_append_text(pi," %s", m->label);
|
||||
|
||||
if (m->framenum == pinfo->fd->num && m->offset == msg_offset ) {
|
||||
tap_queue_packet(sccp_tap, pinfo, m);
|
||||
proto_item_append_text(pi," (current)");
|
||||
}
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2912,6 +2875,8 @@ proto_register_sccp(void)
|
|||
|
||||
assocs = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "sccp_associations");
|
||||
|
||||
sccp_tap = register_tap("sccp");
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -25,24 +25,47 @@
|
|||
#ifndef __PACKET_SCCP_H
|
||||
#define __PACKET_SCCP_H
|
||||
|
||||
#define SCCP_MSG_TYPE_CR 0x01
|
||||
#define SCCP_MSG_TYPE_CC 0x02
|
||||
#define SCCP_MSG_TYPE_CREF 0x03
|
||||
#define SCCP_MSG_TYPE_RLSD 0x04
|
||||
#define SCCP_MSG_TYPE_RLC 0x05
|
||||
#define SCCP_MSG_TYPE_DT1 0x06
|
||||
#define SCCP_MSG_TYPE_DT2 0x07
|
||||
#define SCCP_MSG_TYPE_AK 0x08
|
||||
#define SCCP_MSG_TYPE_UDT 0x09
|
||||
#define SCCP_MSG_TYPE_UDTS 0x0a
|
||||
#define SCCP_MSG_TYPE_ED 0x0b
|
||||
#define SCCP_MSG_TYPE_EA 0x0c
|
||||
#define SCCP_MSG_TYPE_RSR 0x0d
|
||||
#define SCCP_MSG_TYPE_RSC 0x0e
|
||||
#define SCCP_MSG_TYPE_ERR 0x0f
|
||||
#define SCCP_MSG_TYPE_IT 0x10
|
||||
#define SCCP_MSG_TYPE_XUDT 0x11
|
||||
#define SCCP_MSG_TYPE_XUDTS 0x12
|
||||
|
||||
/* The below 2 are ITU only */
|
||||
#define SCCP_MSG_TYPE_LUDT 0x13
|
||||
#define SCCP_MSG_TYPE_LUDTS 0x14
|
||||
|
||||
WS_VAR_IMPORT const value_string sccp_message_type_acro_values[];
|
||||
|
||||
typedef enum _sccp_payload_t {
|
||||
SCCP_PLOAD_NONE,
|
||||
SCCP_PLOAD_BSSAP,
|
||||
SCCP_PLOAD_RANAP,
|
||||
SCCP_PLOAD_TCAP,
|
||||
SCCP_PLOAD_CAMEL
|
||||
SCCP_PLOAD_NUM_PLOADS
|
||||
} sccp_payload_t;
|
||||
|
||||
/* obscure to SCCP, to be defined by users */
|
||||
typedef struct _sccp_msg_payload_data_t sccp_msg_payload_data_t;
|
||||
typedef struct _sccp_assoc_data_t sccp_assoc_data_t;
|
||||
|
||||
typedef struct _sccp_msg_info_t {
|
||||
guint framenum;
|
||||
guint offset;
|
||||
gchar* info;
|
||||
sccp_msg_payload_data_t* private_data;
|
||||
guint type;
|
||||
struct _sccp_assoc_info_t* assoc;
|
||||
struct _sccp_msg_info_t* next;
|
||||
|
||||
gchar* label;
|
||||
gchar* comment;
|
||||
} sccp_msg_info_t;
|
||||
|
||||
typedef struct _sccp_assoc_info_t {
|
||||
|
@ -51,12 +74,16 @@ typedef struct _sccp_assoc_info_t {
|
|||
guint32 called_dpc;
|
||||
guint8 calling_ssn;
|
||||
guint8 called_ssn;
|
||||
gboolean has_calling_key;
|
||||
gboolean has_called_key;
|
||||
gboolean has_fw_key;
|
||||
gboolean has_bw_key;
|
||||
sccp_msg_info_t* msgs;
|
||||
sccp_payload_t pload;
|
||||
sccp_assoc_data_t* private_data;
|
||||
sccp_msg_info_t* cur_msg;
|
||||
sccp_msg_info_t* curr_msg;
|
||||
|
||||
sccp_payload_t proto;
|
||||
gchar* calling_party;
|
||||
gchar* called_party;
|
||||
gchar* extra_info;
|
||||
|
||||
} sccp_assoc_info_t;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -681,6 +681,7 @@ rtp_free_hash_dyn_payload
|
|||
rtp_payload_type_vals DATA
|
||||
rtp_payload_type_short_vals DATA
|
||||
running_in_build_directory
|
||||
sccp_message_type_acro_values DATA
|
||||
scsi_mmc_vals DATA
|
||||
scsi_smc_vals DATA
|
||||
scsi_sbc_vals DATA
|
||||
|
|
|
@ -311,10 +311,11 @@ dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header,
|
|||
edt->pi.link_number = 0;
|
||||
edt->pi.annex_a_used = MTP2_ANNEX_A_USED_UNKNOWN;
|
||||
edt->pi.profinet_type = 0;
|
||||
edt->pi.usb_conv_info = NULL;
|
||||
edt->pi.tcp_tree = NULL;
|
||||
edt->pi.usb_conv_info = NULL;
|
||||
edt->pi.tcp_tree = NULL;
|
||||
edt->pi.dcerpc_procedure_name="";
|
||||
|
||||
edt->pi.sccp_info = NULL;
|
||||
|
||||
TRY {
|
||||
edt->tvb = tvb_new_real_data(pd, fd->cap_len, fd->pkt_len);
|
||||
/* Add this tvbuffer into the data_src list */
|
||||
|
|
|
@ -179,6 +179,7 @@ typedef struct _packet_info {
|
|||
|
||||
const char *dcerpc_procedure_name; /* Used by PIDL to store the name of the current dcerpc procedure */
|
||||
|
||||
struct _sccp_msg_info_t* sccp_info;
|
||||
} packet_info;
|
||||
|
||||
#endif /* __PACKET_INFO_H__ */
|
||||
|
|
|
@ -103,5 +103,5 @@ declare_wslua.h: make-reg.pl $(wslua_modules) taps_wslua.c
|
|||
dummy:
|
||||
touch dummy
|
||||
|
||||
init.lua: template-init.lua make-init-lua.pl ../ftypes/ftypes.h ../../wiretap/wtap.h ../proto.h
|
||||
init.lua: template-init.lua make-init-lua.pl ../ftypes/ftypes.h ../../wiretap/wtap.h ../proto.h ../../stat_menu.h
|
||||
$(PERL) $(srcdir)/make-init-lua.pl template-init.lua > init.lua
|
||||
|
|
|
@ -286,8 +286,9 @@ WSLUA_METHOD Dumper_dump(lua_State* L) {
|
|||
|
||||
if (! ba) WSLUA_ARG_ERROR(Dumper_dump,BYTEARRAY,"must be a ByteArray");
|
||||
|
||||
pkthdr.ts.secs = (int)floor(ts);
|
||||
pkthdr.ts.nsecs = (int)floor(ts - pkthdr.ts.secs) * 1000000000;
|
||||
pkthdr.ts.secs = (unsigned)floor(ts);
|
||||
pkthdr.ts.nsecs = (unsigned)floor((ts - (double)pkthdr.ts.secs) * 1000000000);
|
||||
|
||||
pkthdr.len = ba->len;
|
||||
pkthdr.caplen = ba->len;
|
||||
pkthdr.pkt_encap = DUMPER_ENCAP(d);
|
||||
|
|
Loading…
Reference in New Issue