aboutsummaryrefslogtreecommitdiffstats
path: root/packet-x11.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-04-14 21:44:48 +0000
committerGuy Harris <guy@alum.mit.edu>2002-04-14 21:44:48 +0000
commitebc22d3550f78ac8467fa0e6acf4c4f6e26177a6 (patch)
treeb6adec95c69e6df0807547f4f5ec3b03e08a161e /packet-x11.c
parentb6b2aa49069293ce8706774b542f8a2c4f614efc (diff)
Display Boolean bitfields regardless of whether they're set or clear, so
you can see not only what flags are set, but also what flags aren't set. Don't show reserved bits unless they're set, though. svn path=/trunk/; revision=5157
Diffstat (limited to 'packet-x11.c')
-rw-r--r--packet-x11.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/packet-x11.c b/packet-x11.c
index 0cf8c0cb48..8f2629b7db 100644
--- a/packet-x11.c
+++ b/packet-x11.c
@@ -2,7 +2,7 @@
* Routines for X11 dissection
* Copyright 2000, Christophe Tronche <ch.tronche@computer.org>
*
- * $Id: packet-x11.c,v 1.34 2002/04/13 20:16:09 guy Exp $
+ * $Id: packet-x11.c,v 1.35 2002/04/14 21:44:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -643,6 +643,9 @@ static struct maskStruct {
}
#define FLAG(position, name) {\
+ proto_tree_add_boolean(lastMask._tree, hf_x11_##position##_mask##_##name, tvb, lastMask._offset, lastMask._zone, lastMask._value); }
+
+#define FLAG_IF_NONZERO(position, name) {\
if (lastMask._value & proto_registrar_get_nth(hf_x11_##position##_mask##_##name) -> bitmask)\
proto_tree_add_boolean(lastMask._tree, hf_x11_##position##_mask##_##name, tvb, lastMask._offset, lastMask._zone, lastMask._value); }
@@ -1425,7 +1428,7 @@ static void setOfEvent(tvbuff_t *tvb, int *offsetp, proto_tree *t)
FLAG(event, PropertyChange);
FLAG(event, ColormapChange);
FLAG(event, OwnerGrabButton);
- FLAG(event, erroneous_bits);
+ FLAG_IF_NONZERO(event, erroneous_bits);
lastMask = save;
}
@@ -1444,7 +1447,7 @@ static void setOfDeviceEvent(tvbuff_t *tvb, int *offsetp, proto_tree *t)
FLAG(do_not_propagate, Button4Motion);
FLAG(do_not_propagate, Button5Motion);
FLAG(do_not_propagate, ButtonMotion);
- FLAG(do_not_propagate, erroneous_bits);
+ FLAG_IF_NONZERO(do_not_propagate, erroneous_bits);
lastMask = save;
}
@@ -1471,7 +1474,7 @@ static void setOfKeyMask(tvbuff_t *tvb, int *offsetp, proto_tree *t)
FLAG(modifiers, Mod3);
FLAG(modifiers, Mod4);
FLAG(modifiers, Mod5);
- FLAG(modifiers, erroneous_bits);
+ FLAG_IF_NONZERO(modifiers, erroneous_bits);
}
lastMask = save;
*offsetp += 2;
@@ -1494,7 +1497,7 @@ static void setOfPointerEvent(tvbuff_t *tvb, int *offsetp, proto_tree *t)
FLAG(pointer_event, Button5Motion);
FLAG(pointer_event, ButtonMotion);
FLAG(pointer_event, KeymapState);
- FLAG(pointer_event, erroneous_bits);
+ FLAG_IF_NONZERO(pointer_event, erroneous_bits);
lastMask = save;
}