aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-x11.c
AgeCommit message (Collapse)AuthorFilesLines
2013-09-30Convert some proto_tree_add_string_format calls to something more appropriate.Michael Mann1-3/+2
There seem to be several cases of proto_tree_add_string_format where a "string" value/filter doesn't really make sense because it's always empty, and is just being used as a "filterable subtree header (placeholder)". They appear to be more for "presense" than "value" and should probably be FT_NONE, although I'd almost argue for removing the filter in favor of proto_tree_add_text. svn path=/trunk/; revision=52296
2013-09-22emem -> wmem conversion:Pascal Quantin1-3/+3
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits() - tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup() - tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode() - tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string() - tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string() - tvb_get_ephemeral_string_enc() -> tvb_get_string_enc() - update docs accordingly svn path=/trunk/; revision=52172
2013-09-16Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-3/+2
hf_ field name is the first part of the formatted string. This was all manual inspection and most cases were either: 1. Case sensitivity differences between hf_ field name and formatted string. 2. Unnecessary whitespace between hf_ field name and colon in formatted string There are cases where the hf_ field name doesn't quite match the proto_tree_add_uint_format, but it's close enough that one of them should be "right", I'm just not sure which is, I just know the string in proto_tree_add_uint_format is the one displayed. svn path=/trunk/; revision=52098
2013-09-13Replace some emem with wmem.Evan Huus1-17/+19
The windows-common dissector seems to make excessive use of strbufs - I converted them and simplified a bit, but it could probably be simplified more. svn path=/trunk/; revision=52008
2013-09-08Add filterable expert info to generated X11 dissector. I didn't regenerate ↵Michael Mann1-0/+2
the dissector files, but did manually update the source (tools/process-x11-xcb.pl) so any future regeneration won't lose the changes. svn path=/trunk/; revision=51834
2013-07-23Don't cast away constness (except in cases where an API makes thatGuy Harris1-2/+5
impossible). svn path=/trunk/; revision=50856
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-22/+16
This leaves just the Pidl dissectors remaining for removal of check_col() in the dissectors directory. A small handful of check_col() calls remain outside of the dissectors. svn path=/trunk/; revision=49941
2013-05-28Batch of filterable expert infos. This (mostly) completes the non-ASN.1 ↵Michael Mann1-1/+11
list of (built-in) dissectors that only had a small handful of add_expert_info_format calls. svn path=/trunk/; revision=49602
2013-03-29Rename value string (and similar) functions to use a consistent pattern. ThisEvan Huus1-5/+5
was done using textual search+replace, not anything syntax-aware, so presumably it got most comments as well (except where there were typos). Use a consistent coding style, and make proper use of the WS_DLL_* defines. Group the functions appropriately in the header. I ended up getting rid of most of the explanatory comments since many of them duplicated what was in the value_string.c file (and were out of sync with the recent updates I made to those in r48633). Presumably most of the comments should be in the .h file not the .c file, but there's enough churn ahead that it's not worth fixing yet. Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467 svn path=/trunk/; revision=48634
2013-03-20From beroset:Bill Meier1-13/+13
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10401 svn path=/trunk/; revision=48441
2013-02-27Include <epan/show_exception.h>, as show_exception() is called.Guy Harris1-1/+1
svn path=/trunk/; revision=47926
2013-02-27Get rid of unnecessary includes of "packet-frame.h".Guy Harris1-1/+0
svn path=/trunk/; revision=47925
2013-02-27Move show_exception() and show_reported_bounds_error() toGuy Harris1-10/+4
epan/show_exception.c, as it's used outside epan/dissectors/packet-frame.c. Update their callers to include <epan/show_exception.h> to get their declaration. Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if there's more stuff in the packet to dissect after the dissector call that threw the exception, doesn't mean you shouldn't go ahead and dissect that stuff. Use it in all those cases, including ones where BoundsError was inappropriately being caught (you want those passed up to the top level, so that the packet is reported as having been cut short in the capture process). Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that correspond to running past the end of the data for a tvbuff; use it rather than explicitly catching those exceptions individually, and rather than just catching all exceptions (the only place that DissectorError should be caught, for example, is at the top level, so dissector bugs show up in the protocol tree). Don't catch and then immediately rethrow exceptions without doing anything else; just let the exceptions go up to the final catcher. Use show_exception() to report non-fatal errors, rather than doing it yourself. If a dissector is called from Lua, catch all non-fatal errors and use show_exception() to report them rather than catching only ReportedBoundsError and adding a proto_malformed item. Don't catch exceptions when constructing a trailer tvbuff in packet-ieee8023.c - just construct it after the payload has been dissected, and let whatever exceptions that throws be handled at the top level. Avoid some TRY/CATCH/ENDTRY cases by using checks such as tvb_bytes_exist() before even looking in the tvbuff. svn path=/trunk/; revision=47924
2013-02-26Fix spelling/typos found using a list of commonly misspelled words.Bill Meier1-1/+1
The misspellings were mostly in comments but some were in text strings visible to the user. svn path=/trunk/; revision=47899
2013-02-01Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-3/+3
svn path=/trunk/; revision=47411
2013-01-04replace "unsigned" datatype with "guint". Some mpeg files needed "unsigned ↵Michael Mann1-10/+10
int" instead. bugs 7825-7827 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7825) svn path=/trunk/; revision=46928
2012-12-26Fix a bunch of warnings.Guy Harris1-3/+5
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
2012-10-14The strings added to the value_string table for X11 opcodes forGuy Harris1-19/+8
extensions were incorrectly made ephemeral, rather than seasonal, in r44662. They need to be seasonal, as they're used for dissecting all packets in the X session. Redo a couple of loops as for loops to make it a little clearer what they're doing. svn path=/trunk/; revision=45539
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017
2012-08-25cleanup some unnecessary g_malloc callsMichael Mann1-44/+9
svn path=/trunk/; revision=44662
2012-08-10Use val_to_str_const() where appropriate;Bill Meier1-1/+1
Also (for a few files): - create/use some extended value strings; - remove unneeded #include files; - remove unneeded variable initialization; - re-order fcns slightly so prefs_reg_handoff...() at end, etc svn path=/trunk/; revision=44438
2012-07-03Improve use of the value_string x11_keysym_vals_source[]:Bill Meier1-15/+32
- Compile the value_string only as part of packet-x11.c - Create a value_string_ext to ref the value_string; - packet_vnc.c: Access the value_string using the value_string_ext; - packet-x11.c: Access the value-string using the value_string_ext rather then building a temp GTree from the value_string. svn path=/trunk/; revision=43558
2012-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538
2012-05-15Remove unneeded #includes (stdlib, stdio, ctypes, time);Bill Meier1-3/+2
In a few cases: do some whitespace, indentation cleanup & reformatting. svn path=/trunk/; revision=42632
2012-05-12"byte_order" is an encoding value, so it should be guint.Guy Harris1-6/+6
svn path=/trunk/; revision=42608
2012-05-12Fix a compile errorBill Meier1-1/+1
svn path=/trunk/; revision=42606
2012-05-12Get rid of remaining Booleans-as-encoding-arguments inGuy Harris1-171/+167
proto_tree_add_item() calls. Updated tools/process-x11-xcb.pl to support different encoding values for different fields. Replaced the "little_endian" Boolean value with a "byte_order" value containing the setting of the byte-order ENC_ bit. Regenerated X11 fields from current x.org git. svn path=/trunk/; revision=42601
2012-05-12hf_x11_keycodes is an FT_NONE; use ENC_NA with it.Guy Harris1-2/+2
svn path=/trunk/; revision=42595
2012-05-12string16_with_buffer_preallocated() takes a byte-order gboolean as itsGuy Harris1-1/+1
argument. svn path=/trunk/; revision=42594
2012-05-12Get rid of remaining Booleans-as-encoding-arguments inGuy Harris1-39/+46
proto_tree_add_item() calls. svn path=/trunk/; revision=42593
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-7/+7
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-07-09If the reply length is < 32, that's an overflow, not a bug in theGuy Harris1-1/+3
dissector (unless you consider the calculation not being done in 64 bits as a bug). For now, toss a ReportedBoundsError. svn path=/trunk/; revision=37946
2011-06-19Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings.Bill Meier1-2/+1
svn path=/trunk/; revision=37716
2011-05-27Use a non-volatile temporary variable as a parameter to DISSECTOR_ASSERT().Chris Maynard1-2/+8
This avoids an "assert with side effects" warning and resolves Coverity CID322. svn path=/trunk/; revision=37441
2011-05-27Fix a gcc 4.6 error: "variable might be clobbered by 'longjmp' or 'vfork' ↵Bill Meier1-1/+1
[-Werror=clobbered]" svn path=/trunk/; revision=37438
2011-03-25From Didier via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3055 :Jeff Morriss1-8/+15
Apply rev 25869 to most of the rest of the TCP-desegmenting dissectors. (The SSL dissector was already updated in one of two spots with bug 4535/rev 32456.) A couple of the patches had to be manually applied. From me: Fix the comments to match the change (including in the TCP and SSL dissectors.) svn path=/trunk/; revision=36332
2011-02-18Try to fix more Clang scan-build warnings.Gerald Combs1-2/+2
svn path=/trunk/; revision=36005
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-5/+5
keys to have _uint in their names, to match the routines that handle dissector tables with string keys. (Using _port can confuse people into thinking they're intended solely for use with TCP/UDP/etc. ports when, in fact, they work better for things such as Ethernet types, where the binding of particular values to particular protocols are a lot stronger.) svn path=/trunk/; revision=35224
2010-12-14Minor cleanup:Bill Meier1-3418/+3418
- Initialize a few static global variables; - Remove two unnecessary calls to g_hash_table_foreach_remove; - Do whitespace cleanup and use consistent indentation; - Fix a few typos and fix up several comments. svn path=/trunk/; revision=35183
2010-05-18Use val_to_str() instead of match_strval() to ensure we get a non-NULL result.Jeff Morriss1-4/+3
svn path=/trunk/; revision=32877
2010-05-13As suggested in ↵Jeff Morriss1-19/+2
http://www.wireshark.org/lists/wireshark-dev/200809/msg00075.html (as referenced in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2907 ) and https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3411 : Write a new convenience routine for finding a conversation and, if it is not found, create it. The frame number and addresses are taken from pinfo (as is the common case). Use this function in a bunch of dissectors. svn path=/trunk/; revision=32790
2010-04-21From Peter Harris via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4701 :Jeff Morriss1-2/+19
The ChangeProperty request always calls LISTofBYTE, which always tries to dissect at least one byte, even when the request is empty. This causes Wireshark to put a big, red, scary "Malformed Packet" entry in the dissection. Also, ChangeProperty only dissects (data_length) bytes. data_length is "number of units", and units may be 16 or 32-bit entities. In this case, the dissected data will be truncated. First reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4481#c10 The attached patch fixes these two bugs. svn path=/trunk/; revision=32526
2010-04-20From Peter Harris via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4481 :Jeff Morriss1-0/+14
The XKEYBOARD extension is a pain in the... so XCB had to grow new ways to describe the protocol. This patch adds support to the Wireshark dissector, so it can successfully process the XCB description of the XKEYBOARD extension. Without this patch, "make x11-dissector" chokes on the current xcbproto from git. Also update the script to deal with the new mesa directory structure. svn path=/trunk/; revision=32520
2010-04-03 From Yaniv Kaul: constify parametersBill Meier1-2/+2
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422 From me: Fix a number of instances where the function prototype or the function definition wasn't changed so there was a mismatch thus causing Windows (but not gcc) compilation errors. svn path=/trunk/; revision=32365
2010-04-02Revert SVN #32360 until Windows compilation errors corrected.Bill Meier1-2/+2
svn path=/trunk/; revision=32361
2010-04-02From Yaniv Kaul: constify parametersBill Meier1-2/+2
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422 svn path=/trunk/; revision=32360
2010-01-26Fix some gcc -Wshadow warningsBill Meier1-12/+14
svn path=/trunk/; revision=31673
2009-10-25From Jakub Zawadzki:Anders Broman1-4/+1
Cleanup dissector code - use proper memory functions. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164 svn path=/trunk/; revision=30691
2009-09-11From Peter Harris via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2981 :Jeff Morriss1-28/+283
This patch adds extension support to the X11 dissector. I've removed the perl script from the make file, since the new one depends on perl 5.10, xcbproto (at least git as of today), and mesa (at least the mesa/src/mesa/glapi directory). It seemed easier to just add the generated header files to svn directly. svn path=/trunk/; revision=29854
2009-08-09Don't guard col_set_str (COL_INFO) with col_checkKovarththanan Rajaratnam1-5/+2
svn path=/trunk/; revision=29342