aboutsummaryrefslogtreecommitdiffstats
path: root/packet-q2931.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-11-10 20:26:24 +0000
committerGuy Harris <guy@alum.mit.edu>2002-11-10 20:26:24 +0000
commit5dda6f75561a6b3c75e7c119e68bb2ffcc529759 (patch)
tree183872d0aa7f64c567a40de9043a11540021633a /packet-q2931.c
parentc6bcd3eb0d5ad4dbfdbfca7cc91d9814afc68e7d (diff)
Display the call reference flag, and don't include that bit in the call
reference value. svn path=/trunk/; revision=6604
Diffstat (limited to 'packet-q2931.c')
-rw-r--r--packet-q2931.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/packet-q2931.c b/packet-q2931.c
index 5906aa0833..d54762a620 100644
--- a/packet-q2931.c
+++ b/packet-q2931.c
@@ -2,7 +2,7 @@
* Routines for Q.2931 frame disassembly
* Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-q2931.c,v 1.29 2002/08/28 21:00:25 jmayer Exp $
+ * $Id: packet-q2931.c,v 1.30 2002/11/10 20:26:24 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -50,6 +50,7 @@
static int proto_q2931 = -1;
static int hf_q2931_discriminator = -1;
static int hf_q2931_call_ref_len = -1;
+static int hf_q2931_call_ref_flag = -1;
static int hf_q2931_call_ref = -1;
static int hf_q2931_message_type = -1;
static int hf_q2931_message_type_ext = -1;
@@ -118,6 +119,11 @@ static const value_string q2931_message_type_vals[] = {
{ 0, NULL }
};
+static const true_false_string tfs_call_ref_flag = {
+ "Message sent to originating side",
+ "Message sent from originating side"
+};
+
/*
* Bits in the message type extension.
*/
@@ -2020,10 +2026,13 @@ dissect_q2931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(q2931_tree, hf_q2931_call_ref_len, tvb, offset, 1, call_ref_len);
offset += 1;
if (call_ref_len != 0) {
- /* XXX - split this into flag and value */
tvb_memcpy(tvb, call_ref, offset, call_ref_len);
- if (q2931_tree != NULL)
+ if (q2931_tree != NULL) {
+ proto_tree_add_boolean(q2931_tree, hf_q2931_call_ref_flag,
+ tvb, offset, 1, (call_ref[0] & 0x80) != 0);
+ call_ref[0] &= 0x7F;
proto_tree_add_bytes(q2931_tree, hf_q2931_call_ref, tvb, offset, call_ref_len, call_ref);
+ }
offset += call_ref_len;
}
message_type = tvb_get_guint8(tvb, offset);
@@ -2106,6 +2115,10 @@ proto_register_q2931(void)
{ "Call reference value length", "q2931.call_ref_len", FT_UINT8, BASE_DEC, NULL, 0x0,
"", HFILL }},
+ { &hf_q2931_call_ref_flag,
+ { "Call reference flag", "q2931.call_ref_flag", FT_BOOLEAN, BASE_NONE, TFS(&tfs_call_ref_flag), 0x0,
+ "", HFILL }},
+
{ &hf_q2931_call_ref,
{ "Call reference value", "q2931.call_ref", FT_BYTES, BASE_HEX, NULL, 0x0,
"", HFILL }},