diff options
author | lego <lego@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-03-27 23:00:55 +0000 |
---|---|---|
committer | lego <lego@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-03-27 23:00:55 +0000 |
commit | acf50c3379f600b60bffa3c5e63192f223bee387 (patch) | |
tree | 2ddfb4b4612738e326a40ac2df91248d41dc91f6 | |
parent | ae923beee24d8ff3b7e18fe655256b242cc74863 (diff) |
Another iteration over sctp calls (RANAP/BSSAP) a step towards TCAP/(MAP/IMAP/CAMEL)
- Fix SUA calls (I would need some more traces to test this)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21235 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r-- | asn1/ranap/packet-ranap-template.c | 8 | ||||
-rw-r--r-- | asn1/ranap/ranap.cnf | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-bssap.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_a.c | 20 | ||||
-rw-r--r-- | epan/dissectors/packet-ranap.c | 16 | ||||
-rw-r--r-- | epan/dissectors/packet-ranap.h | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-sccp.c | 90 | ||||
-rw-r--r-- | epan/dissectors/packet-sccp.h | 20 | ||||
-rw-r--r-- | epan/dissectors/packet-sua.c | 42 | ||||
-rw-r--r-- | gtk/voip_calls.c | 10 |
10 files changed, 157 insertions, 65 deletions
diff --git a/asn1/ranap/packet-ranap-template.c b/asn1/ranap/packet-ranap-template.c index 49144e1f33..00fe4e8567 100644 --- a/asn1/ranap/packet-ranap-template.c +++ b/asn1/ranap/packet-ranap-template.c @@ -1086,12 +1086,12 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (pinfo->sccp_info) { sccp_msg_info_t* sccp_msg = pinfo->sccp_info; - if (sccp_msg->assoc) - sccp_msg->assoc->payload = SCCP_PLOAD_RANAP; + if (sccp_msg->data.co.assoc) + sccp_msg->data.co.assoc->payload = SCCP_PLOAD_RANAP; - if (! sccp_msg->label && ProcedureCode != 0xFFFFFFFF) { + if (! sccp_msg->data.co.label && ProcedureCode != 0xFFFFFFFF) { const gchar* str = val_to_str(ProcedureCode, ranap_ProcedureCode_vals,"Unknown RANAP"); - sccp_msg->label = se_strdup(str); + sccp_msg->data.co.label = se_strdup(str); } } diff --git a/asn1/ranap/ranap.cnf b/asn1/ranap/ranap.cnf index d23be14d79..ee72587f1a 100644 --- a/asn1/ranap/ranap.cnf +++ b/asn1/ranap/ranap.cnf @@ -54,13 +54,13 @@ VAL_PTR = &ProtocolIE_ID 3, 8, &imsi_tvb); if ( actx->pinfo->sccp_info - && actx->pinfo->sccp_info->assoc - && ! actx->pinfo->sccp_info->assoc->calling_party ) { + && actx->pinfo->sccp_info->data.co.assoc + && ! actx->pinfo->sccp_info->data.co.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 = + actx->pinfo->sccp_info->data.co.assoc->calling_party = se_strdup_printf("IMSI: %%s", bytes_to_str(bytes, len) ); } #.FN_BODY Value diff --git a/epan/dissectors/packet-bssap.c b/epan/dissectors/packet-bssap.c index 5fc2a627b8..ab39c59898 100644 --- a/epan/dissectors/packet-bssap.c +++ b/epan/dissectors/packet-bssap.c @@ -581,8 +581,8 @@ 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->payload = SCCP_PLOAD_BSSAP; + if ( pinfo->sccp_info && pinfo->sccp_info->data.co.assoc ) + pinfo->sccp_info->data.co.assoc->payload = SCCP_PLOAD_BSSAP; /* * create the bssap protocol tree @@ -1632,8 +1632,8 @@ 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->payload = SCCP_PLOAD_BSSAP; + if (pinfo->sccp_info && pinfo->sccp_info->data.co.assoc) + pinfo->sccp_info->data.co.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-gsm_a.c b/epan/dissectors/packet-gsm_a.c index f5a494b7e6..89900e763e 100644 --- a/epan/dissectors/packet-gsm_a.c +++ b/epan/dissectors/packet-gsm_a.c @@ -18105,8 +18105,8 @@ dissect_bssmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) sccp_msg = pinfo->sccp_info; - if (sccp_msg && sccp_msg->assoc) { - sccp_assoc = sccp_msg->assoc; + if (sccp_msg && sccp_msg->data.co.assoc) { + sccp_assoc = sccp_msg->data.co.assoc; } else { sccp_assoc = NULL; sccp_msg = NULL; @@ -18143,8 +18143,8 @@ 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)")); + if (sccp_msg && !sccp_msg->data.co.label) { + sccp_msg->data.co.label = se_strdup(val_to_str((guint32) oct, gsm_a_bssmap_msg_strings, "BSSMAP (0x%02x)")); } /* @@ -18360,8 +18360,8 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) sccp_msg = pinfo->sccp_info; - if (sccp_msg && sccp_msg->assoc) { - sccp_assoc = sccp_msg->assoc; + if (sccp_msg && sccp_msg->data.co.assoc) { + sccp_assoc = sccp_msg->data.co.assoc; } else { sccp_assoc = NULL; sccp_msg = NULL; @@ -18379,8 +18379,8 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) 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); + if (sccp_msg && !sccp_msg->data.co.label) { + sccp_msg->data.co.label = se_strdup_printf("DTAP (0x%02x)",oct); } @@ -18394,8 +18394,8 @@ 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 (sccp_msg && !sccp_msg->data.co.label) { + sccp_msg->data.co.label = se_strdup(msg_str); } if (check_col(pinfo->cinfo, COL_INFO)) diff --git a/epan/dissectors/packet-ranap.c b/epan/dissectors/packet-ranap.c index d0dba3ee8d..cfbc56d371 100644 --- a/epan/dissectors/packet-ranap.c +++ b/epan/dissectors/packet-ranap.c @@ -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 */ @@ -5096,13 +5096,13 @@ dissect_ranap_T_iMSI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pr 3, 8, &imsi_tvb); if ( actx->pinfo->sccp_info - && actx->pinfo->sccp_info->assoc - && ! actx->pinfo->sccp_info->assoc->calling_party ) { + && actx->pinfo->sccp_info->data.co.assoc + && ! actx->pinfo->sccp_info->data.co.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 = + actx->pinfo->sccp_info->data.co.assoc->calling_party = se_strdup_printf("IMSI: %s", bytes_to_str(bytes, len) ); } @@ -10784,12 +10784,12 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (pinfo->sccp_info) { sccp_msg_info_t* sccp_msg = pinfo->sccp_info; - if (sccp_msg->assoc) - sccp_msg->assoc->payload = SCCP_PLOAD_RANAP; + if (sccp_msg->data.co.assoc) + sccp_msg->data.co.assoc->payload = SCCP_PLOAD_RANAP; - if (! sccp_msg->label && ProcedureCode != 0xFFFFFFFF) { + if (! sccp_msg->data.co.label && ProcedureCode != 0xFFFFFFFF) { const gchar* str = val_to_str(ProcedureCode, ranap_ProcedureCode_vals,"Unknown RANAP"); - sccp_msg->label = se_strdup(str); + sccp_msg->data.co.label = se_strdup(str); } } diff --git a/epan/dissectors/packet-ranap.h b/epan/dissectors/packet-ranap.h index 6c4ee8c06c..56f826b9a2 100644 --- a/epan/dissectors/packet-ranap.h +++ b/epan/dissectors/packet-ranap.h @@ -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 */ diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c index 22ce575fd2..db4ae85920 100644 --- a/epan/dissectors/packet-sccp.c +++ b/epan/dissectors/packet-sccp.c @@ -724,6 +724,7 @@ static dissector_table_t sccp_ssn_dissector_table; static emem_tree_t* assocs = NULL; static sccp_assoc_info_t* assoc; +static sccp_msg_info_t* sccp_msg; 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; @@ -753,18 +754,18 @@ static sccp_assoc_info_t* new_assoc(guint32 calling, guint32 called){ return a; } +void reset_sccp_assoc(void) { + assoc = NULL; +} + 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); guint framenum = pinfo->fd->num; - if (assoc) - return assoc; - - if (!src_lr && !dst_lr){ - return &no_assoc; - } + if(assoc) + return 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)); @@ -777,9 +778,11 @@ sccp_assoc_info_t* get_sccp_assoc(packet_info* pinfo, guint offset, guint32 src_ emem_tree_key_t bw_key[] = { {1, &dpck}, {1, &opck}, {1, &src_lr}, {0, NULL} }; + printf("pinfo->fd->flags.visited=%d\n",pinfo->fd->flags.visited); if (! ( assoc = se_tree_lookup32_array(assocs,bw_key) ) && ! pinfo->fd->flags.visited ) { assoc = new_assoc(opck,dpck); + printf("A %d->%d %d\n",dpck,opck,src_lr); se_tree_insert32_array(assocs,bw_key,assoc); assoc->has_bw_key = TRUE; } @@ -806,12 +809,14 @@ sccp_assoc_info_t* get_sccp_assoc(packet_info* pinfo, guint offset, guint32 src_ got_assoc: if ( ! pinfo->fd->flags.visited && ! assoc->has_bw_key ) { - + printf("B %d->%d %d\n",opck,dpck,dst_lr); se_tree_insert32_array(assocs,bw_key,assoc); assoc->has_bw_key = TRUE; } if ( ! pinfo->fd->flags.visited && ! assoc->has_fw_key ) { + printf("C %d->%d %d\n",dpck,opck,src_lr); + se_tree_insert32_array(assocs,fw_key,assoc); assoc->has_fw_key = TRUE; } @@ -835,16 +840,16 @@ sccp_assoc_info_t* get_sccp_assoc(packet_info* pinfo, guint offset, guint32 src_ 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->data.co.next = NULL; + msg->data.co.assoc = assoc; + msg->data.co.label = NULL; + msg->data.co.comment = NULL; msg->type = msg_type; if (assoc->msgs) { sccp_msg_info_t* m; - for (m = assoc->msgs; m->next; m = m->next) ; - m->next = msg; + for (m = assoc->msgs; m->data.co.next; m = m->data.co.next) ; + m->data.co.next = msg; } else { assoc->msgs = msg; } @@ -855,7 +860,7 @@ sccp_assoc_info_t* get_sccp_assoc(packet_info* pinfo, guint offset, guint32 src_ sccp_msg_info_t* m; - for (m = assoc->msgs; m; m = m->next) { + for (m = assoc->msgs; m; m = m->data.co.next) { if (m->framenum == framenum && m->offset == offset) { assoc->curr_msg = m; break; @@ -864,6 +869,7 @@ sccp_assoc_info_t* get_sccp_assoc(packet_info* pinfo, guint offset, guint32 src_ } } + printf("no_assoc=%p assoc=%p curr_msg=%p\n",&no_assoc,assoc,assoc ? assoc->curr_msg: (void*)(0xffffffff)); return assoc ? assoc : &no_assoc; } @@ -915,6 +921,12 @@ dissect_sccp_slr_param(tvbuff_t *tvb, proto_tree *tree, guint length, packet_inf col_append_fstr(pinfo->cinfo, COL_INFO, "SLR=%d ", slr); } + +#define is_connectionless(m) \ + ( m == SCCP_MSG_TYPE_UDT || m == SCCP_MSG_TYPE_UDTS \ + || m == SCCP_MSG_TYPE_XUDT|| m == SCCP_MSG_TYPE_XUDTS \ + || m == SCCP_MSG_TYPE_LUDT|| m == SCCP_MSG_TYPE_LUDTS) + static void dissect_sccp_gt_address_information(tvbuff_t *tvb, proto_tree *tree, guint length, gboolean even_length, @@ -941,6 +953,12 @@ dissect_sccp_gt_address_information(tvbuff_t *tvb, proto_tree *tree, offset += GT_SIGNAL_LENGTH; } + if (is_connectionless(message_type) && sccp_msg) { + guint8** gt_ptr = called ? &(sccp_msg->data.ud.called_gt) : &(sccp_msg->data.ud.calling_gt); + + *gt_ptr = ep_strdup(gt_digits); + } + proto_tree_add_string_format(tree, called ? hf_sccp_called_gt_digits : hf_sccp_calling_gt_digits, tvb, 0, length, gt_digits, @@ -1183,6 +1201,12 @@ dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree, else if (assoc) assoc->calling_ssn = ssn; + if (is_connectionless(message_type) && sccp_msg) { + guint* ssn_ptr = called ? &(sccp_msg->data.ud.called_ssn) : &(sccp_msg->data.ud.calling_ssn); + + *ssn_ptr = ssn; + } + proto_tree_add_uint(call_tree, called ? hf_sccp_called_ssn : hf_sccp_calling_ssn, tvb, offset, ADDRESS_SSN_LENGTH, ssn); @@ -1255,7 +1279,13 @@ dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree, else if (assoc) assoc->calling_ssn = ssn; - proto_tree_add_uint(call_tree, called ? hf_sccp_called_ssn + if (is_connectionless(message_type) && sccp_msg) { + guint* ssn_ptr = called ? &(sccp_msg->data.ud.called_ssn) : &(sccp_msg->data.ud.calling_ssn); + + *ssn_ptr = ssn; + } + + proto_tree_add_uint(call_tree, called ? hf_sccp_called_ssn : hf_sccp_calling_ssn, tvb, offset, ADDRESS_SSN_LENGTH, ssn); proto_tree_add_uint_hidden(call_tree, hf_sccp_ssn, tvb, offset, @@ -1790,6 +1820,18 @@ dissect_sccp_optional_parameters(tvbuff_t *tvb, packet_info *pinfo, } +static sccp_msg_info_t* new_ud_msg(packet_info* pinfo, guint32 msg_type) { + sccp_msg_info_t* m = ep_alloc(sizeof(sccp_msg_info_t)); + m->framenum = pinfo->fd->num; + m->offset = 0; /* irrelevant */ + m->type = 0; + m->data.ud.calling_gt = NULL; + m->data.ud.calling_ssn = 0; + m->data.ud.called_gt = NULL; + m->data.ud.called_ssn = 0; + + return m; +} static void dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, @@ -2042,6 +2084,8 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case SCCP_MSG_TYPE_UDT: + pinfo->sccp_info = sccp_msg = new_ud_msg(pinfo,message_type); + offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, PROTOCOL_CLASS_LENGTH); @@ -2063,6 +2107,8 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case SCCP_MSG_TYPE_UDTS: + pinfo->sccp_info = sccp_msg = new_ud_msg(pinfo,message_type); + offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RETURN_CAUSE, offset, RETURN_CAUSE_LENGTH); @@ -2164,6 +2210,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case SCCP_MSG_TYPE_XUDT: + pinfo->sccp_info = sccp_msg = new_ud_msg(pinfo,message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, PROTOCOL_CLASS_LENGTH); @@ -2255,6 +2302,7 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case SCCP_MSG_TYPE_XUDTS: + pinfo->sccp_info = sccp_msg = new_ud_msg(pinfo,message_type); offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RETURN_CAUSE, offset, RETURN_CAUSE_LENGTH); @@ -2280,7 +2328,8 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case SCCP_MSG_TYPE_LUDT: - if (decode_mtp3_standard != ANSI_STANDARD) + pinfo->sccp_info = sccp_msg = new_ud_msg(pinfo,message_type); + if (decode_mtp3_standard != ANSI_STANDARD) { offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_CLASS, offset, @@ -2309,7 +2358,8 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, break; case SCCP_MSG_TYPE_LUDTS: - if (decode_mtp3_standard != ANSI_STANDARD) + pinfo->sccp_info = sccp_msg = new_ud_msg(pinfo,message_type); + if (decode_mtp3_standard != ANSI_STANDARD) { offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree, PARAMETER_RETURN_CAUSE, offset, @@ -2351,14 +2401,14 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree, PROTO_ITEM_SET_GENERATED(pi); if (assoc->msgs) { sccp_msg_info_t* m; - for(m = assoc->msgs; m ; m = m->next) { + for(m = assoc->msgs; m ; m = m->data.co.next) { pi = proto_tree_add_uint( pt,hf_sccp_assoc_msg,tvb,0,0,m->framenum); 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); + if (m->data.co.label) + proto_item_append_text(pi," %s", m->data.co.label); if (m->framenum == pinfo->fd->num && m->offset == msg_offset ) { tap_queue_packet(sccp_tap, pinfo, m); diff --git a/epan/dissectors/packet-sccp.h b/epan/dissectors/packet-sccp.h index 50274592d2..ff8c0be122 100644 --- a/epan/dissectors/packet-sccp.h +++ b/epan/dissectors/packet-sccp.h @@ -64,11 +64,21 @@ typedef struct _sccp_msg_info_t { guint framenum; guint offset; guint type; - struct _sccp_assoc_info_t* assoc; - struct _sccp_msg_info_t* next; - gchar* label; - gchar* comment; + union { + struct { + gchar* label; + gchar* comment; + struct _sccp_assoc_info_t* assoc; + struct _sccp_msg_info_t* next; + } co; + struct { + guint8* calling_gt; + guint calling_ssn; + guint8* called_gt; + guint called_ssn; + } ud; + } data; } sccp_msg_info_t; typedef struct _sccp_assoc_info_t { @@ -89,7 +99,7 @@ typedef struct _sccp_assoc_info_t { } sccp_assoc_info_t; - +extern void reset_sccp_assoc(void); 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 29e3b29a0c..3d80608caf 100644 --- a/epan/dissectors/packet-sua.c +++ b/epan/dissectors/packet-sua.c @@ -330,6 +330,8 @@ static int hf_ssn_number = -1; static int hf_ipv4 = -1; static int hf_hostname = -1; static int hf_ipv6 = -1; +static int hf_assoc_id = -1; +static int hf_assoc_msg = -1; /* Initialize the subtree pointers */ static gint ett_sua = -1; @@ -343,6 +345,7 @@ static gint ett_sua_sequence_number_sent_number = -1; 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 gint ett_sua_assoc = -1; static int sua_tap = -1; @@ -1850,13 +1853,23 @@ dissect_sua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *sua_t 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); + sccp_assoc_info_t* assoc; + printf("t=%d ::",message_type); + reset_sccp_assoc(); + assoc = get_sccp_assoc(pinfo, offset_from_real_beginning(message_tvb,0), srn, drn, message_type); if (assoc && assoc->curr_msg) { + printf("-->1\n"); pinfo->sccp_info = assoc->curr_msg; tap_queue_packet(sua_tap,pinfo,assoc->curr_msg); + } else { + printf("-->2\n"); + pinfo->sccp_info = NULL; } - } + } else { + printf("-->3\n"); + pinfo->sccp_info = NULL; + } /* If there was SUA data it could be dissected */ if(data_tvb) @@ -1869,12 +1882,22 @@ dissect_sua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *sua_t { /* try heuristic subdissector list to see if there are any takers */ if (dissector_try_heuristic(heur_subdissector_list, data_tvb, pinfo, tree)) { - return; + goto done; } /* No sub-dissection occured, treat it as raw data */ call_dissector(data_handle, data_tvb, pinfo, sua_tree); } } + done: + + if (pinfo->sccp_info) { + sccp_msg_info_t* m = pinfo->sccp_info; + + printf("p=%p fnum=%d o=%d t=%d l='%s' c='%s' a=%p\n", + m,m->framenum,m->offset,m->type,m->data.co.label,m->data.co.comment,m->data.co.assoc); + } else { + printf("-------\n"); + } } static void @@ -2017,7 +2040,14 @@ proto_register_sua(void) { &hf_ipv4, { "IP Version 4 address", "sua.ipv4_address", FT_IPv4, BASE_NONE, NULL, 0x0, "", HFILL } }, { &hf_hostname, { "Hostname", "sua.hostname.name", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL } }, { &hf_ipv6, { "IP Version 6 address", "sua.ipv6_address", FT_IPv6, BASE_NONE, NULL, 0x0, "", HFILL } }, - }; + { &hf_assoc_id, + { "Association ID", "sccp.assoc.id", + FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}}, + {&hf_assoc_msg, + {"Message in frame", "sccp.assoc.msg", + FT_FRAMENUM, BASE_NONE, NULL, 0x00, "", HFILL } + }, + }; /* Setup protocol subtree array */ static gint *ett[] = { @@ -2031,7 +2061,9 @@ proto_register_sua(void) &ett_sua_receive_sequence_number_number, &ett_sua_protcol_classes, &ett_sua_first_remaining, - &ett_sua_return_on_error_bit_and_protocol_class + &ett_sua_return_on_error_bit_and_protocol_class, + &ett_sua_assoc + }; module_t *sua_module; diff --git a/gtk/voip_calls.c b/gtk/voip_calls.c index 1c9e4e911b..caaa549a4a 100644 --- a/gtk/voip_calls.c +++ b/gtk/voip_calls.c @@ -2906,7 +2906,7 @@ const value_string* sccp_payload_values; static int sccp_calls(packet_info *pinfo, const void *prot_info) { voip_calls_tapinfo_t *tapinfo = &the_tapinfo_struct; const sccp_msg_info_t* msg = prot_info; - sccp_assoc_info_t* assoc = msg->assoc; + sccp_assoc_info_t* assoc = msg->data.co.assoc; GList* list; voip_calls_info_t *strinfo = NULL; const gchar* label = NULL; @@ -2986,14 +2986,14 @@ static int sccp_calls(packet_info *pinfo, const void *prot_info) { } } - if (msg->label) { - label = msg->label; + if (msg->data.co.label) { + label = msg->data.co.label; } else { label = val_to_str(msg->type, sccp_payload_values, "Unknown(%d)"); } - if (msg->comment) { - comment = msg->comment; + if (msg->data.co.comment) { + comment = msg->data.co.comment; } else { comment = ""; } |