aboutsummaryrefslogtreecommitdiffstats
path: root/packet-x11.c
AgeCommit message (Collapse)AuthorFilesLines
2000-08-07Allow either old-style (pre-tvbuff) or new-style (tvbuffified)Guy Harris1-6/+6
dissectors to be registered as dissectors for particular ports, registered as heuristic dissectors, and registered as dissectors for conversations, and have routines to be used both by old-style and new-style dissectors to call registered dissectors. Have the code that calls those dissectors translate the arguments as necessary. (For conversation dissectors, replace "find_conversation_dissector()", which just returns a pointer to the dissector, with "old_try_conversation_dissector()" and "try_conversation_dissector()", which actually call the dissector, so that there's a single place at which we can do that translation. Also make "dissector_lookup()" static and, instead of calling it and, if it returns a non-null pointer, calling that dissector, just use "old_dissector_try_port()" or "dissector_try_port()", for the same reason.) This allows some dissectors that took old-style arguments and immediately translated them to new-style arguments to just take new-style arguments; make them do so. It also allows some new-style dissectors not to have to translate arguments before calling routines to look up and call dissectors; make them not do so. Get rid of checks for too-short frames in new-style dissectors - the tvbuff code does those checks for you. Give the routines to register old-style dissectors, and to call dissectors from old-style dissectors, names beginning with "old_", with the routines for new-style dissectors not having the "old_". Update the dissectors that use those routines appropriately. Rename "dissect_data()" to "old_dissect_data()", and "dissect_data_tvb()" to "dissect_data()". svn path=/trunk/; revision=2218
2000-06-17Add braces to squelch a warning from GCC 2.8.1 on Solaris 7/x86.Guy Harris1-3/+3
svn path=/trunk/; revision=2076
2000-06-15Fix typos in some printf formats - "+%d", not "%+d"Guy Harris1-3/+3
svn path=/trunk/; revision=2069
2000-06-15Convert IPX-and-friend dissectors in packet-ipx.c to useGilbert Ramirez1-2/+3
tvbuffs. In doing so, I realied that my recommendation for using tvb_new_subset(pi.compat_top_tvb, -1, -1) was incorrect, because some dissectors (ethernet!) change pi.len and pi.cap_len. So, I have to take those two variables into account instead of using -1 and -1. So, I provide a macro called tvb_create_from_top(offset), where offset is the name of your offset variable. It is a wrapper around tvb_new_subset(). I converted the lines that followed my suggestion to use tvb_create_from_top(). In proto.c I added proto_tree_add_debug_text(proto_tree*, const char*, ...) It's much like proto_tree_add_text(), except that it takes no offset or length; it's soley for temporarily putting debug text into the proto_tree while debugging a dissector. In making sure that its use is temporary, the funciton also prints the debug string to stdout to remind the programmer that the debug code needs to be removed before shipping the code. svn path=/trunk/; revision=2068
2000-06-14When building under Win32, "boolean" appears to be defined in a fashionGuy Harris1-3/+3
that causes "packet-x11.c" to fail to compile due to it defining its own function named "boolean", so we rename the "packet-x11.c" "boolean()" function to "add_boolean()". svn path=/trunk/; revision=2066
2000-06-14In "stringCopy()", make the character temporary unsigned, so that itGuy Harris1-2/+2
doesn't get sign-extended before being handed to "isgraph()". svn path=/trunk/; revision=2065
2000-06-12Initialize 'int next_offset' to 0 instead of NULL.Gilbert Ramirez1-2/+2
svn path=/trunk/; revision=2063
2000-06-12Don't include <X11/Xlib.h> to get AllPlanes defined; that causes theGuy Harris1-18/+2
build to fail on Win32 systems. It's defined (at least in the X11R6 on my FreeBSD 3.4 system) as "((unsigned long)~0L)", which presumably means "set all the bits" - which means "set all 32 bits" in the "value_string" table where it appears, as the value member of an entry in such a table is a "guint32", so just use 0xFFFFFFFF. Get rid of other unneeded #includes as well. svn path=/trunk/; revision=2061
2000-06-12Partial tvbuffification of the X11 dissector; we construct a tvbuff fromGuy Harris1-284/+320
the top-level "compatibility" tvbuff, so that we don't blow up if we get short frames *or* misinterpret data due to, for example, trying to treat the initial client->server message in a connection as an X11 request, or interpreting the middle of a multi-frame request (e.g., a big PutImage) as if it contained requests. (I have a capture file on which the non-tvbuffified code crashed.) Attempt to dissect requests until we reach the end of the frame, even if that would take us past the end of the captured data in the frame before we reach the end of the frame; the tvbuff code will throw an exception if we go past the end of the captured data, which means it'll put a "Short frame" indication into the protocol tree, which is what we want (the frame *is* short, because the capture length was too short). Define functions taking no arguments with a "(void)" argument list, so that the compiler knows that they must not be passed any arguments. svn path=/trunk/; revision=2059
2000-06-12Christophe Tronche's X11 dissector.Guy Harris1-0/+2951
svn path=/trunk/; revision=2057