diff options
author | Michele Baldessari <michele@acksyn.org> | 2014-12-03 20:14:33 +0100 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-12-04 09:04:00 +0000 |
commit | f27c34570031ff99c8e829db07a55bb6a28b907a (patch) | |
tree | 41ef37eacdcc06dc0bf7e6931757406585508ea7 /epan | |
parent | b8a23643b339037e13e61baa22ce86fba7c96869 (diff) |
Add resource-id parsing to the X11 errors that return it
- Rename BadColor to BadColormap as the former does not exist in the X11
specs
- Parse the bad resource id field in case of the following errors:
BadColormap, BadWindow, BadPixmap, BadCursor, BadFont, BadDrawable,
BadGC and BadIDChoice
Change-Id: I5b23d32189e1a8bb291c656cf6383a85b3e89642
Reviewed-on: https://code.wireshark.org/review/5592
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-x11.c | 14 | ||||
-rw-r--r-- | epan/dissectors/x11-declarations.h | 1 | ||||
-rw-r--r-- | epan/dissectors/x11-fields | 1 | ||||
-rw-r--r-- | epan/dissectors/x11-register-info.h | 1 |
4 files changed, 15 insertions, 2 deletions
diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c index 38d93021b2..fdf4ba6c68 100644 --- a/epan/dissectors/packet-x11.c +++ b/epan/dissectors/packet-x11.c @@ -956,7 +956,7 @@ static const value_string eventcode_vals[] = { list from other than the local host. */ #define BadAlloc 11 /* insufficient resources */ -#define BadColor 12 /* no such colormap */ +#define BadColormap 12 /* no such colormap */ #define BadGC 13 /* parameter not a GC */ #define BadIDChoice 14 /* choice not in range or already used */ #define BadName 15 /* font or color name doesn't exist */ @@ -976,7 +976,7 @@ static const value_string errorcode_vals[] = { { BadDrawable, "BadDrawable" }, { BadAccess, "BadAccess" }, { BadAlloc, "BadAlloc" }, - { BadColor, "BadColor" }, + { BadColormap, "BadColormap" }, { BadGC, "BadGC" }, { BadIDChoice, "BadIDChoice" }, { BadName, "BadName" }, @@ -5758,6 +5758,16 @@ dissect_x11_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, case BadValue: CARD32(error_badvalue); break; + case BadWindow: + case BadPixmap: + case BadCursor: + case BadFont: + case BadDrawable: + case BadColormap: + case BadGC: + case BadIDChoice: + CARD32(error_badresourceid); + break; default: UNDECODED(4); diff --git a/epan/dissectors/x11-declarations.h b/epan/dissectors/x11-declarations.h index 3f3e3bb630..0806831d53 100644 --- a/epan/dissectors/x11-declarations.h +++ b/epan/dissectors/x11-declarations.h @@ -132,6 +132,7 @@ static int hf_x11_do_not_propagate_mask_erroneous_bits = -1; static int hf_x11_event_sequencenumber = -1; static int hf_x11_error = -1; static int hf_x11_error_badvalue = -1; +static int hf_x11_error_badresourceid = -1; static int hf_x11_error_sequencenumber = -1; static int hf_x11_errorcode = -1; static int hf_x11_event_x = -1; diff --git a/epan/dissectors/x11-fields b/epan/dissectors/x11-fields index b6b2e64112..5b4d6b829e 100644 --- a/epan/dissectors/x11-fields +++ b/epan/dissectors/x11-fields @@ -142,6 +142,7 @@ do-not-propagate-mask UINT32 HEX event-sequencenumber UINT16 DEC error UINT8 DEC error-badvalue UINT32 DEC error badvalue +error-badresourceid UINT32 HEX error_badresourceid error_sequencenumber UINT16 DEC error sequencenumber errorcode UINT8 DEC VALS event-x UINT16 DEC event x diff --git a/epan/dissectors/x11-register-info.h b/epan/dissectors/x11-register-info.h index 0c99d34113..a025000be6 100644 --- a/epan/dissectors/x11-register-info.h +++ b/epan/dissectors/x11-register-info.h @@ -132,6 +132,7 @@ { &hf_x11_event_sequencenumber, { "event-sequencenumber", "x11.event-sequencenumber", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_x11_error, { "error", "x11.error", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, { &hf_x11_error_badvalue, { "error-badvalue", "x11.error-badvalue", FT_UINT32, BASE_DEC, NULL, 0, "error badvalue", HFILL }}, +{ &hf_x11_error_badresourceid, { "error-badresourceid", "x11.error-badresourceid", FT_UINT32, BASE_HEX, NULL, 0, "error_badresourceid", HFILL }}, { &hf_x11_error_sequencenumber, { "error_sequencenumber", "x11.error_sequencenumber", FT_UINT16, BASE_DEC, NULL, 0, "error sequencenumber", HFILL }}, { &hf_x11_errorcode, { "errorcode", "x11.errorcode", FT_UINT8, BASE_DEC, VALS(errorcode_vals), 0, NULL, HFILL }}, { &hf_x11_event_x, { "event-x", "x11.event-x", FT_UINT16, BASE_DEC, NULL, 0, "event x", HFILL }}, |