diff options
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-isup.c | 158 | ||||
-rw-r--r-- | epan/dissectors/packet-q931.c | 14 | ||||
-rw-r--r-- | epan/dissectors/packet-q931.h | 2 |
3 files changed, 22 insertions, 152 deletions
diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c index 04e23574b5..26d1ae7171 100644 --- a/epan/dissectors/packet-isup.c +++ b/epan/dissectors/packet-isup.c @@ -2262,7 +2262,7 @@ dissect_isup_cause_indicators_parameter(tvbuff_t *parameter_tvb, proto_tree *par proto_tree_add_text(parameter_tree, parameter_tvb,0, -1, "Cause indicators (-> Q.850)"); dissect_q931_cause_ie(parameter_tvb,0,length, parameter_tree, - hf_isup_cause_indicator, &tap_cause_value); + hf_isup_cause_indicator, &tap_cause_value, isup_parameter_type_value); proto_item_set_text(parameter_item, "Cause indicators, see Q.850 (%u byte%s length)", length , plurality(length, "", "s")); } @@ -2563,7 +2563,7 @@ dissect_nsap(tvbuff_t *parameter_tvb,gint offset,gint len, proto_tree *parameter { guint8 afi, cc_length = 0; guint8 length = 0, address_digit_pair = 0; - guint icp, cc, id_code, cc_offset; + guint icp, cc_offset; afi = tvb_get_guint8(parameter_tvb, offset); @@ -2601,149 +2601,10 @@ dissect_nsap(tvbuff_t *parameter_tvb,gint offset,gint len, proto_tree *parameter proto_tree_add_text(parameter_tree, parameter_tvb, offset + 1, 8, "IDI = %s", tvb_bytes_to_str(parameter_tvb, offset + 1, 8)); offset = offset +1; - /* Dissect country code after removing non significant zeros */ + /* Dissect country code */ cc_offset = offset; - address_digit_pair = tvb_get_guint8(parameter_tvb, cc_offset); - while ( address_digit_pair == 0 ) { - cc_offset = cc_offset + 1; - address_digit_pair = tvb_get_guint8(parameter_tvb, cc_offset); - } - cc = tvb_get_ntohs(parameter_tvb, cc_offset); - if (( address_digit_pair & 0xf0 ) != 0 ) - cc = cc >> 4; - - switch ( cc & 0x0f00 ) { - - case 0x0 : - cc_length = 1; - break; - - case 0x0100 : cc_length = 1; - break; - - case 0x0200 : - switch ( cc & 0x00f0 ) { - case 0 : - case 0x70 : - cc_length = 2; - break; - default : - cc_length = 3; - break; - } - break; - - case 0x0300 : - switch ( cc & 0x00f0 ) { - case 0 : - case 0x10 : - case 0x20 : - case 0x30 : - case 0x40 : - case 0x60 : - case 0x90 : - cc_length = 2; - break; - default : - cc_length = 3; - break; - } - break; - case 0x0400 : - switch ( cc & 0x00f0 ) { - case 0x20 : - cc_length = 3; - break; - default : - cc_length = 2; - break; - } - break; - - case 0x0500 : - switch ( cc & 0x00f0 ) { - case 0 : - case 0x90 : - cc_length = 3; - break; - default : - cc_length = 2; - break; - } - break; - - case 0x0600 : - switch ( cc & 0x00f0 ) { - case 0x70 : - case 0x80 : - case 0x90 : - cc_length = 3; - break; - default : - cc_length = 2; - break; - } - break; - - case 0x0700 : cc_length = 1; - break; - - case 0x0800 : - switch ( cc & 0x00f0 ) { - case 0x10: - case 0x20: - case 0x40: - case 0x60: - cc_length = 2; - break; - default : - cc_length = 3; - break; - } - break; - - case 0x0900 : - switch ( cc & 0x00f0 ) { - case 0 : - case 0x10 : - case 0x20 : - case 0x30 : - case 0x40 : - case 0x50 : - case 0x80 : - cc_length = 2; - break; - default : - cc_length = 3; - break; - } - break; - - default: - break; - }/* End switch cc */ - switch ( cc_length ) { - case 0x1 : cc = cc >> 8; - length = 1; - break; - case 0x2 : cc = cc >> 4; - length = 1; - break; - default: - length = 2; - break; - }/* end switch cc_length */ - proto_tree_add_text(parameter_tree,parameter_tvb, cc_offset, length,"Country Code: %x %s length %u",cc, - val_to_str(cc,E164_country_code_value,"unknown (%x)"),cc_length); - switch ( cc ) { - case 0x882 : - id_code = tvb_get_ntohs(parameter_tvb, cc_offset + 1); - id_code = (id_code & 0x0fff) >> 4; - proto_tree_add_text(parameter_tree,parameter_tvb, (cc_offset + 1), 2,"Identification Code: %x %s ",id_code, - val_to_str(id_code,E164_International_Networks_vals,"unknown (%x)")); - break; - default:; - } + dissect_e164_cc(parameter_tvb, parameter_tree, 3, TRUE); + proto_tree_add_text(parameter_tree,parameter_tvb, cc_offset, length,"DSP length %u(len %u -9 )",(len-9),len ); proto_tree_add_item(parameter_tree, hf_bicc_nsap_dsp, parameter_tvb, offset + 8, (len - 9),FALSE); @@ -5110,6 +4971,15 @@ dissect_isup_generic_number_parameter(tvbuff_t *parameter_tvb, proto_tree *param } calling_number[i++] = '\0'; + /* + * Indicators1 = Nature of address + * Indicators2 = Number plan indicator + */ + indicators1 = indicators1 & 0x7f; + indicators2 = (indicators2 & 0x70)>>4; + if ((indicators1 == ISUP_CALLED_PARTY_NATURE_INTERNATNL_NR)&&(indicators2==ISDN_NUMBERING_PLAN)) + dissect_e164_cc(parameter_tvb, address_digits_tree, 3, TRUE); + proto_item_set_text(address_digits_item, "Generic number: %s", calling_number); proto_item_set_text(parameter_item, "Generic number: %s", calling_number); diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c index 2995bb13d8..8386746d35 100644 --- a/epan/dissectors/packet-q931.c +++ b/epan/dissectors/packet-q931.c @@ -1202,7 +1202,7 @@ static const value_string q931_rejection_reason_vals[] = { static void dissect_q931_cause_ie_unsafe(tvbuff_t *tvb, int offset, int len, - proto_tree *tree, int hf_cause_value, guint8 *cause_value) + proto_tree *tree, int hf_cause_value, guint8 *cause_value, const value_string *ie_vals) { guint8 octet; guint8 coding_standard; @@ -1303,14 +1303,14 @@ dissect_q931_cause_ie_unsafe(tvbuff_t *tvb, int offset, int len, case Q931_REJ_IE_MISSING: proto_tree_add_text(tree, tvb, offset, 1, "Missing information element: %s", - val_to_str(tvb_get_guint8(tvb, offset), q931_info_element_vals0, + val_to_str(tvb_get_guint8(tvb, offset), ie_vals, "Unknown (0x%02X)")); break; case Q931_REJ_IE_INSUFFICIENT: proto_tree_add_text(tree, tvb, offset, 1, "Insufficient information element: %s", - val_to_str(tvb_get_guint8(tvb, offset), q931_info_element_vals0, + val_to_str(tvb_get_guint8(tvb, offset), ie_vals, "Unknown (0x%02X)")); break; @@ -1330,7 +1330,7 @@ dissect_q931_cause_ie_unsafe(tvbuff_t *tvb, int offset, int len, do { proto_tree_add_text(tree, tvb, offset, 1, "Information element: %s", - val_to_str(tvb_get_guint8(tvb, offset), q931_info_element_vals0, + val_to_str(tvb_get_guint8(tvb, offset), ie_vals, "Unknown (0x%02X)")); offset += 1; len -= 1; @@ -1361,11 +1361,11 @@ dissect_q931_cause_ie_unsafe(tvbuff_t *tvb, int offset, int len, void dissect_q931_cause_ie(tvbuff_t *tvb, int offset, int len, - proto_tree *tree, int hf_cause_value, guint8 *cause_value) + proto_tree *tree, int hf_cause_value, guint8 *cause_value, const value_string *ie_vals) { gboolean have_valid_q931_pi_save = have_valid_q931_pi; have_valid_q931_pi = FALSE; - dissect_q931_cause_ie_unsafe(tvb, offset, len, tree, hf_cause_value, cause_value); + dissect_q931_cause_ie_unsafe(tvb, offset, len, tree, hf_cause_value, cause_value, ie_vals); have_valid_q931_pi = have_valid_q931_pi_save; } @@ -2828,7 +2828,7 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree, dissect_q931_cause_ie_unsafe(tvb, offset + 2, info_element_len, ie_tree, - hf_q931_cause_value, &dummy); + hf_q931_cause_value, &dummy, q931_info_element_vals0); break; case CS0 | Q931_IE_CALL_STATE: diff --git a/epan/dissectors/packet-q931.h b/epan/dissectors/packet-q931.h index cf37e8ffef..08c9b61f9b 100644 --- a/epan/dissectors/packet-q931.h +++ b/epan/dissectors/packet-q931.h @@ -31,7 +31,7 @@ extern void dissect_q931_bearer_capability_ie(tvbuff_t *, int, int, proto_tree *); extern void dissect_q931_cause_ie(tvbuff_t *, int, int, - proto_tree *, int, guint8 *); + proto_tree *, int, guint8 *,const value_string *); extern void dissect_q931_progress_indicator_ie(tvbuff_t *, int, int, proto_tree *); |