aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-x11.c21
-rw-r--r--epan/dissectors/x11-declarations.h4
-rw-r--r--epan/dissectors/x11-fields8
-rw-r--r--epan/dissectors/x11-register-info.h4
4 files changed, 33 insertions, 4 deletions
diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c
index 4cdd7825d9..49fbd68e65 100644
--- a/epan/dissectors/packet-x11.c
+++ b/epan/dissectors/packet-x11.c
@@ -1171,6 +1171,7 @@ static const value_string zero_is_none_vals[] = {
#define LISTofBYTE(name, length) { listOfByte(tvb, offsetp, t, hf_x11_##name, (length), little_endian); }
#define LISTofCARD8(name, length) { listOfByte(tvb, offsetp, t, hf_x11_##name, (length), little_endian); }
#define LISTofIPADDRESS(name, length) { listOfByte(tvb, offsetp, t, hf_x11_##name, (length), FALSE); }
+#define LISTofCARD16(name, length) { listOfCard16(tvb, offsetp, t, hf_x11_##name, hf_x11_##name##_item, (length) / 2, little_endian); }
#define LISTofCARD32(name, length) { listOfCard32(tvb, offsetp, t, hf_x11_##name, hf_x11_##name##_item, (length) / 4, little_endian); }
#define LISTofCOLORITEM(name, length) { listOfColorItem(tvb, offsetp, t, hf_x11_##name, (length) / 12, little_endian); }
#define LISTofKEYCODE(map, name, length) { listOfKeycode(tvb, offsetp, t, hf_x11_##name, map, (length), little_endian); }
@@ -3412,10 +3413,26 @@ static void dissect_x11_request(tvbuff_t *tvb, packet_info *pinfo,
WINDOW(window);
ATOM(property);
ATOM(type);
- CARD8(format);
+ v8 = CARD8(format);
UNUSED(3);
v32 = CARD32(data_length);
- LISTofBYTE(data, v32);
+ switch (v8) {
+ case 8:
+ if (v32)
+ LISTofBYTE(data, v32);
+ break;
+ case 16:
+ if (v32)
+ LISTofCARD16(data16, v32 * 2);
+ break;
+ case 32:
+ if (v32)
+ LISTofCARD32(data32, v32 * 4);
+ break;
+ default:
+ expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, "Invalid Format");
+ break;
+ }
PAD();
break;
diff --git a/epan/dissectors/x11-declarations.h b/epan/dissectors/x11-declarations.h
index 6168b35b00..c448c6a064 100644
--- a/epan/dissectors/x11-declarations.h
+++ b/epan/dissectors/x11-declarations.h
@@ -171,6 +171,10 @@ static int hf_x11_gc_value_mask_arc_mode = -1;
static int hf_x11_green = -1;
static int hf_x11_greens = -1;
static int hf_x11_data = -1;
+static int hf_x11_data16 = -1;
+static int hf_x11_data16_item = -1;
+static int hf_x11_data32 = -1;
+static int hf_x11_data32_item = -1;
static int hf_x11_data_length = -1;
static int hf_x11_delete = -1;
static int hf_x11_delta = -1;
diff --git a/epan/dissectors/x11-fields b/epan/dissectors/x11-fields
index 19da0da2e5..2af5747995 100644
--- a/epan/dissectors/x11-fields
+++ b/epan/dissectors/x11-fields
@@ -13,12 +13,12 @@
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -185,6 +185,10 @@ gc-value-mask UINT32 HEX
green UINT16 DEC
greens UINT16 DEC
data BYTES NONE
+data16 NONE NONE
+ item UINT16 HEX
+data32 NONE NONE
+ item UINT32 HEX
data-length UINT32 DEC
delete BOOLEAN NONE Delete this property after reading
delta INT16 DEC
diff --git a/epan/dissectors/x11-register-info.h b/epan/dissectors/x11-register-info.h
index 377fe759d8..4d1dc2f493 100644
--- a/epan/dissectors/x11-register-info.h
+++ b/epan/dissectors/x11-register-info.h
@@ -171,6 +171,10 @@
{ &hf_x11_green, { "green", "x11.green", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
{ &hf_x11_greens, { "greens", "x11.greens", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
{ &hf_x11_data, { "data", "x11.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
+{ &hf_x11_data16, { "data16", "x11.data16", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
+{ &hf_x11_data16_item, { "item", "x11.data16.item", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
+{ &hf_x11_data32, { "data32", "x11.data32", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
+{ &hf_x11_data32_item, { "item", "x11.data32.item", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
{ &hf_x11_data_length, { "data-length", "x11.data-length", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
{ &hf_x11_delete, { "delete", "x11.delete", FT_BOOLEAN, BASE_NONE, NULL, 0, "Delete this property after reading", HFILL }},
{ &hf_x11_delta, { "delta", "x11.delta", FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL }},