diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-10-30 08:07:30 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-10-30 08:07:30 +0000 |
commit | b10a085434600412229bdcafb6af4e040a05b31d (patch) | |
tree | 1106e3551c05bdd6f414254100068cc1e7a8af33 /packet-q931.c | |
parent | 2494f0bf3202828f70e015456e82b78fd6f8fa5a (diff) |
From Anders Broman:
fix the offset when putting the cause code in a Cause IE into the
protocol tree;
in a Number IE, show the number type, numbering plan, and
extension indicator as named-field bitfields.
svn path=/trunk/; revision=8828
Diffstat (limited to 'packet-q931.c')
-rw-r--r-- | packet-q931.c | 73 |
1 files changed, 45 insertions, 28 deletions
diff --git a/packet-q931.c b/packet-q931.c index 8fb83832b1..8f327404e7 100644 --- a/packet-q931.c +++ b/packet-q931.c @@ -2,7 +2,7 @@ * Routines for Q.931 frame disassembly * Guy Harris <guy@alum.mit.edu> * - * $Id: packet-q931.c,v 1.60 2003/09/21 20:06:00 gerald Exp $ + * $Id: packet-q931.c,v 1.61 2003/10/30 08:07:30 guy Exp $ * * Modified by Andreas Sikkema for possible use with H.323 * @@ -52,20 +52,23 @@ * http://www.tulatelecom.ru/staff/german/DSSHelp/MessList/InfEl/InfElList.html */ -static int proto_q931 = -1; -static int hf_q931_discriminator = -1; -static int hf_q931_call_ref_len = -1; -static int hf_q931_call_ref_flag = -1; -static int hf_q931_call_ref = -1; -static int hf_q931_message_type = -1; -static int hf_q931_cause_value = -1; +static int proto_q931 = -1; +static int hf_q931_discriminator = -1; +static int hf_q931_call_ref_len = -1; +static int hf_q931_call_ref_flag = -1; +static int hf_q931_call_ref = -1; +static int hf_q931_message_type = -1; +static int hf_q931_cause_value = -1; +static int hf_q931_number_type = -1; +static int hf_q931_numbering_plan = -1; +static int hf_q931_extension_ind = -1; static int hf_q931_calling_party_number = -1; -static int hf_q931_called_party_number = -1; -static int hf_q931_connected_number = -1; -static int hf_q931_redirecting_number = -1; +static int hf_q931_called_party_number = -1; +static int hf_q931_connected_number = -1; +static int hf_q931_redirecting_number = -1; -static gint ett_q931 = -1; -static gint ett_q931_ie = -1; +static gint ett_q931 = -1; +static gint ett_q931_ie = -1; static dissector_table_t codeset_dissector_table; static dissector_table_t ie_dissector_table; @@ -194,6 +197,11 @@ static const true_false_string tfs_call_ref_flag = { * Variable-length IEs. */ #define Q931_IE_VL_EXTENSION 0x80 /* Extension flag */ +static const true_false_string q931_extension_ind_value = { + "information continues through the next octet", + "last octet", +}; + /* * Codeset 0 (default). @@ -1166,7 +1174,7 @@ dissect_q931_cause_ie(tvbuff_t *tvb, int offset, int len, return; octet = tvb_get_guint8(tvb, offset); cause_value = octet & 0x7F; - proto_tree_add_uint(tree, hf_cause_value, tvb, 0, 1, cause_value); + proto_tree_add_uint(tree, hf_cause_value, tvb, offset, 1, cause_value); offset += 1; len -= 1; @@ -1971,12 +1979,12 @@ dissect_q931_reverse_charge_ind_ie(tvbuff_t *tvb, int offset, int len, * Dissect a (phone) number information element. */ static const value_string q931_number_type_vals[] = { - { 0x00, "Unknown" }, - { 0x10, "International number" }, - { 0x20, "National number" }, - { 0x30, "Network specific number" }, - { 0x40, "Subscriber number" }, - { 0x60, "Abbreviated number" }, + { 0x0, "Unknown" }, + { 0x1, "International number" }, + { 0x2, "National number" }, + { 0x3, "Network specific number" }, + { 0x4, "Subscriber number" }, + { 0x6, "Abbreviated number" }, { 0, NULL } }; @@ -2025,14 +2033,10 @@ dissect_q931_number_ie(tvbuff_t *tvb, int offset, int len, if (len == 0) return; octet = tvb_get_guint8(tvb, offset); - proto_tree_add_text(tree, tvb, offset, 1, - "Type of number: %s", - val_to_str(octet & 0x70, q931_number_type_vals, - "Unknown (0x%02X)")); - proto_tree_add_text(tree, tvb, offset, 1, - "Numbering plan: %s", - val_to_str(octet & 0x0F, q931_numbering_plan_vals, - "Unknown (0x%02X)")); + proto_tree_add_uint(tree, hf_q931_numbering_plan, tvb, offset, 1, octet); + proto_tree_add_uint(tree, hf_q931_number_type, tvb, offset, 1, octet); + proto_tree_add_boolean(tree, hf_q931_extension_ind, tvb, offset, 1, octet); + offset += 1; len -= 1; @@ -2867,6 +2871,19 @@ proto_register_q931(void) { "Cause value", "q931.cause_value", FT_UINT8, BASE_DEC, VALS(q931_cause_code_vals), 0x0, "", HFILL }}, + { &hf_q931_number_type, + { "Number type", "q931.number_type", FT_UINT8, BASE_HEX, VALS(q931_number_type_vals), 0x70, + "", HFILL }}, + + { &hf_q931_numbering_plan, + { "Numbering plan", "q931.numbering_plan", FT_UINT8, BASE_HEX, VALS(q931_numbering_plan_vals), 0x0f, + "", HFILL }}, + + { &hf_q931_extension_ind, + { "Extension indicator", "q931.extension_ind", + FT_BOOLEAN, 8, TFS(&q931_extension_ind_value), 0x80, + "", HFILL }}, + { &hf_q931_calling_party_number, { "Calling party number digits", "q931.calling_party_number.digits", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, |