aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
Commit message (Collapse)AuthorAgeFilesLines
* Moved int-64bit.{c,h} into epan/Ed Warnicke2001-11-221-2/+2
| | | | svn path=/trunk/; revision=4248
* Fix an earlier typo of mine.Guy Harris2001-11-211-2/+2
| | | | svn path=/trunk/; revision=4238
* Allow the tvbuff pointer to various "proto_tree_add" routines to be nullGuy Harris2001-11-201-3/+14
| | | | | | | | | | | | | if (and only if) the length of the item being added is 0 (so that it has no data backing it). This means the data stream name pointer for the item in question is null; make sure we handle that. Use that for some "uses the value from the matching request" fields in the SMB Pipe protocol. svn path=/trunk/; revision=4231
* Get rid of NullTVB, the "compat_top_tvb" member of the "packet_info"Guy Harris2001-11-151-9/+2
| | | | | | | | structure, the check for a null tvbuff pointer in "alloc_field_info()", and the "tvb_create_from_top()" macro; they're no longer needed, as there's no non-tvbuffified dissector code remaining. svn path=/trunk/; revision=4205
* Tvbuffification of Negotiate Protocol, from Ronnie Sahlberg.Guy Harris2001-11-031-3/+15
| | | | | | | | | Fix up Info column to put "Request" or "Response" *after* the name of the request. Give the Negotiate Protocol request its full name. svn path=/trunk/; revision=4139
* When freeing the "gpa_hfinfo" pointer array, free the array itself, asGuy Harris2001-11-031-3/+3
| | | | | | well as the structure containing it. svn path=/trunk/; revision=4131
* Add support for 64-bit signed integers in "int-64bit.[ch]", add anGuy Harris2001-11-021-1/+40
| | | | | | | | FT_INT64 type, and make the Diameter dissector use it. Handle the 64-bit integer types in the display filter semantics checks. svn path=/trunk/; revision=4125
* From Ronnie Sahlberg: FT_UINT64 support, code to handle 64-bit integersGuy Harris2001-10-291-1/+73
| | | | | | | | without requiring compiler support for them, and updates to the Diameter, L2TP, NFS, and NLM dissectors to use it and to the ONC RPC dissector to allow ONC RPC subdissectors to use it. svn path=/trunk/; revision=4099
* Fix some signed/unsigned comparison warnings. In the case of tvbuff.h,Gilbert Ramirez2001-10-261-5/+5
| | | | | | | there were 2 functions which accepted 'maxlength' == -1, but the function prototypes had maxlength as a guint --- fixed. svn path=/trunk/; revision=4087
* When putting protocols into the list of protocols, do a case-insensitiveGuy Harris2001-10-231-2/+2
| | | | | | | | sort. Give iSCSI the short name "iSCSI" rather than "ISCSI". svn path=/trunk/; revision=4067
* Make the resolution for time values be nanoseconds rather thanGuy Harris2001-09-141-8/+8
| | | | | | | | microseconds. Fix some "signed vs. unsigned" comparison warnings. svn path=/trunk/; revision=3934
* Add a "proto_item_append_text()" routine, which is likeGuy Harris2001-08-291-1/+26
| | | | | | | | "proto_item_set_text()" except that it appends the result of the formatting to the item's current text, rather than replacing the item's current text. Use it in the DNS dissector. svn path=/trunk/; revision=3880
* Get rid of "proto_tree_add_notext()" - if you create a subtree using it,Guy Harris2001-08-281-7/+7
| | | | | | | | | | | | | but, before you set the text, you throw an exception while putting stuff under the subtree, you end up with an absolutely blank protocol tree item, which is really gross. Instead of calling "proto_tree_add_notext()", call "proto_tree_add_text()" with at least a minimal label - yes, it does mean you do some work that will probably be unnecessary, but, absent a scheme to arrange to do that work if it *is* necessary (e.g., catching exceptions), the alternative is an ugly protocol tree display. svn path=/trunk/; revision=3879
* Patch from Lee Berger to properly skip past the length in FT_UINT_STRINGGuy Harris2001-08-041-3/+3
| | | | | | data objects if the length isn't 1. svn path=/trunk/; revision=3821
* Add a "time_secs_to_str_buf()" routine, which takes seconds andGuy Harris2001-08-011-3/+3
| | | | | | | | | | | | | | | | | | | fractions-of-a-second (the units of which are either milliseconds or microseconds, specified by a Boolean argument), and formats it into a "DD days, HH hours, MM minutes, SS seconds" using a buffer supplied to it. Have "time_secs_to_str()" and "time_msecs_to_str()" both use it. Also, have it correctly handle the case of SS being > 0 but < 1 (which "time_msecs_to_str()" didn't do). Rename "rel_time_to_str()" to "rel_time_to_secs_str()", and add a "rel_time_to_str()" routine that takes a "struct timeval" and hands its seconds and microseconds values to "time_secs_to_str_buf()". Use "rel_time_to_secs_str()" to format FT_RELATIVE_TIME values for now; we might want to use "rel_time_to_str()" for them, though, or make it an option (either a user option, or a per-field option, using the field that also holds BASE_ values). svn path=/trunk/; revision=3806
* From Joerg Mayer:Guy Harris2001-07-131-2/+2
| | | | | | | | | | | | | | | * gcc 3.0 warning fixes: - text2pcap.c: The number of characters to scan should probably not be 0 - wiretap/csids.c: using preincrement on a variable used on both sides of an assignment might be undefined by the C99(?) standard * turn on additional warnings for epan and wiretap too - epan/configure.in - wiretap/configure.in * Fix some warnings (missing includes, signed/unsigned, missing initializers) found by turning on the warnings - all other files :-) svn path=/trunk/; revision=3709
* Enable "Match Selected" only if there's a field selected *and* we can doGuy Harris2001-06-051-3/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a "Match Selected" on it - we can't do a "Match Selected" if the field has no value (e.g., FT_NULL) and has a length of 0. If we unselect the current packet, we don't have a protocol tree, so we don't have a currently selected field - clear the "Match Selected" menu item and the display in the status line of information about the currently selected field. Move the low-level statusbar manipulation into "gtk/main.c", in routines whose API doesn't expose anything GTK+-ish. "close_cap_file()" calls one of those routines to clear out the status bar, so it doesn't need to take a pointer to the statusbar widget as an argument. "clear_tree_and_hex_views()" is purely a display-manipulating routine; move it to "gtk/proto_draw.c". Extract from "tree_view_unselect_row_cb()" an "unselect_field()" routine to do all the work that needs to be done if the currently selected protocol tree row is unselected, and call it if the currently selected packet list row is unselected (if it's unselected, there *is* no protocol tree, so no row can be selected), as well as from "tree_view_unselect_row_cb()". Before pushing a new field-description message onto the statusbar, pop the old one off. Get rid of an unused variable (set, but not used). svn path=/trunk/; revision=3513
* Add support for "Match Selected" on FT_ABSOLUTE_TIME andGuy Harris2001-05-311-8/+21
| | | | | | FT_RELATIVE_TIME fields. svn path=/trunk/; revision=3488
* When generating a filter expression to match a protocol tree line notGuy Harris2001-05-091-39/+36
| | | | | | | | | | | corresponding to a named field, by matching stuff at a particular offset in the frame, don't treat a length of 1 byte specially - the syntax for a one-byte byte string is the same as for longer byte strings, with no leading "0x" allowed. Clean up white space. svn path=/trunk/; revision=3406
* If "proto_item_set_len()" is passed a null pointer as its firstGuy Harris2001-05-071-2/+6
| | | | | | | | | | | | argument, have it just return; this allows dissectors that don't explicitly check for a null protocol-tree argument to pass the protocol-tree argument to "proto_tree_add_XXX()" routines - which means they'll get a null pointer back if the protocol-tree argument is null because we're not constructing a protocol tree - and then later use "proto_item_set_len()" without having to check for a null protocol-tree-item pointer. svn path=/trunk/; revision=3402
* When registering numeric fields, check that a base other than BASE_NONEGuy Harris2001-04-231-26/+18
| | | | | | | | | was specified. This should obviate the need to handle BASE_NONE specially in the formatting routines, so revert to the previous version. svn path=/trunk/; revision=3359
* Put BASE_NONE back into the FT_INTn and FT_UINTn display functionsEd Warnicke2001-04-201-2/+27
| | | | | | | | | with useful error messages. Some dissector are registering FT_INTn or FT_UINTn fields with BASE_NONE. Now when ethereal dies because of it the offending field will be identified so that it can be fixed. svn path=/trunk/; revision=3340
* Don't allow BASE_NONE to be used with FT_INTn and FT_UINTn variables -Guy Harris2001-04-191-6/+1
| | | | | | | | | you have to select a base (even before this change, you had to select one, otherwise the filter-construction GUI would crash if you selected an FT_INTn or FT_UINTn field with BASE_NONE and then selected a comparison operator). svn path=/trunk/; revision=3337
* Patch from Ronnie Sahlberg to cause the field description section of theGuy Harris2001-04-191-3/+23
| | | | | | | | | | status bar to display nothing, rather than "Text (text)", when a "proto_tree_add_text()" field is selected. While we're at it, use a similar test to eliminate the text pseudo-field from the output of "{ethereal,tethereal} -G", as well. svn path=/trunk/; revision=3335
* If the tvbuff pointer is null in "alloc_field_info()", get the dataGuy Harris2001-04-101-5/+2
| | | | | | | | | | | | source name from "pi.compat_top_tvb", which should always be set to the tvbuff that refers to the data that old-style dissectors are currently working on. Arrange that it be so set in those dissectors that create alternate data sources and call other dissectors, and also arrange that "pi.len" and "pi.captured_len" be set appropriately as well. svn path=/trunk/; revision=3286
* Don't call "register_all_plugin_handoffs()" if we don't have pluginGuy Harris2001-04-051-1/+3
| | | | | | support. svn path=/trunk/; revision=3262
* Added two new arguments to epan_init() and proto_init() toEd Warnicke2001-04-021-3/+3
| | | | | | | | | | allow the passing of register_all_protocols() and register_all_protocol_handoffs() through epan_init() to proto_init(). This allows the removal of the compile time dependence of proto.c on register.h. Modified dftest.c, tethereal.c, and gtk/main.c to use the new style epan_init() and depend on register.h. svn path=/trunk/; revision=3237
* Added a function proto_get_id_by_filter_name() function to proto.{c,h}Ed Warnicke2001-04-011-1/+20
| | | | | | to allow the lookup of proto_ids by filter_name. svn path=/trunk/; revision=3235
* Moved some ipv6 definitions from packet-ipv6.h to epan/ipv6-utils.h.Ed Warnicke2001-04-011-2/+2
| | | | | | Fixed some typos. svn path=/trunk/; revision=3230
* Change proto_item_add_subtree to test for NULL pi value and return NULL.Jeff Foster2001-03-261-2/+7
| | | | | | This is the same behavior as the proto_tree_add routines with NULL tree values. svn path=/trunk/; revision=3191
* Changes required to support multiple named data sources.Jeff Foster2001-03-231-3/+16
| | | | | | | | Tvbuffers changed to added the data source name, GUI and printing code changed to support these changes and display the multiple hex views. svn path=/trunk/; revision=3165
* The other "proto_tree_add" routines will, if the "tree" argument isGuy Harris2001-03-151-1/+4
| | | | | | | null, just return NULL without doing any work; make "proto_tree_add_item()" do so as well. svn path=/trunk/; revision=3139
* In the code that handles finding a field after a user clicks onGilbert Ramirez2001-03-071-2/+2
| | | | | | | | | | | | | | | a byte in the hex dump, 1. Fix an off-by-one error when finding the field. This only showed up if the selected byte had no field of its own and was only designated as part of the parent protocol (like the 00-padding at the beginning of TCP options). 2. Fix an off-by-one error when clicking on a character in the second half of the "text dump" portion of the hex dump. I forgot about the extra space between the first 8 characters and the second 8 characters. svn path=/trunk/; revision=3117
* Calculate the height and width of m_r_font globally, since variousGilbert Ramirez2001-03-021-1/+51
| | | | | | | | | | | | routines need it. When a user clicks on a hex digit or on the corresponding character (the "text dump" portion) in the hex dump, find the field in the proto_tree that the byte corresponds to, expand the GtkCTree so that the field is viewable, select the field, and center it vertically. LanAlyzer has this feature, and I've missed it in Ethereal. svn path=/trunk/; revision=3096
* Create proper display filter for FT_BOOLEAN when using "Match Selected".Gilbert Ramirez2001-03-011-4/+5
| | | | svn path=/trunk/; revision=3089
* In a display filter expression, make a field name refer to any of theGuy Harris2001-02-131-24/+53
| | | | | | fields with that name. svn path=/trunk/; revision=3030
* If there are multiple fields with the same name, list only one of themGuy Harris2001-02-121-1/+16
| | | | | | | | | in the output of "{ethereal,tethereal} -G", so that it appears only once in the documentation. Expand some comments to give more details. svn path=/trunk/; revision=3024
* Declare "proto_tree_set_protocol_tvb()" at the top, along with the otherGuy Harris2001-02-011-1/+3
| | | | | | "proto_tree_set_XXX_tvb()" routines. svn path=/trunk/; revision=2971
* Create a more modular type system for the FT_* types. Put themGilbert Ramirez2001-02-011-205/+327
| | | | | | | | | | | | | | | | | | | | | | | | into epan/ftypes. Re-write display filter routines using Lemon parser instead of yacc. Besides using a different tool, the new grammar is much simpler, while the display filter engine itself is more powerful and more easily extended. Add dftest executable, to test display filter "bytecode" generation. Add option to "configure" to build dftest or randpkt, both of which are not built by default. Implement Ed Warnicke's ideas about dranges in the new display filter and ftype code. Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree, while FT_PROTOCOL is used for protocols. This was necessary for being able to make byte slices (ranges) out of protocols, like "frame[0:3]" Win32 Makefile.nmake's will be added tonight. svn path=/trunk/; revision=2967
* "Decode As" dialog, from David Hampton.Guy Harris2001-02-011-1/+31
| | | | svn path=/trunk/; revision=2965
* Clean up the dissector registration up a bit - arrange that all pluginsGuy Harris2001-01-261-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | be loaded and their initialization routines called in right after we call the initialization routines for built-in dissectors, but don't call their handoff registration routines yet, and then call the handoff registration routines right after calling the handoff registration routines for built-in dissectors. Do all that in "proto_init()", rather than "epan_init()". That way, we call all dissector registration routines together, and then call all dissector handoff registration routines together; all the registration routines are called before any handoff registration routines, as is required, and, as "proto_init()" is called by "epan_init()" before "dfilter_init()" is called, all filterable fields have been registered before "dfilter_init()" is called, and no plugins have to call "dfilter_init()" themselves to get their fields registered. Remove pointers to "dfilter_init()" and "dfilter_cleanup()" from the plugin address table, as plugins shouldn't be calling them any more, and remove calls to them from plugins. svn path=/trunk/; revision=2940
* Have "proto_register_protocol()" build a list of data structures forGuy Harris2001-01-031-29/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | protocols, in addition to adding structures to the list of filterable fields. Give it an extra argument that specifies a "short name" for the protocol, for use in such places as pinfo->current_proto; the dialog box for constructing filters; the preferences tab for the protocol; and so on (although we're not yet using it in all those places). Make the preference name that appears in the preferences file and the command line for the DIAMETER protocol "diameter", not "Diameter"; the convention is that the name in question be all-lower-case. Make some routines and variables that aren't exported static. Update a comment in the ICP dissector to make it clear that the dissector won't see fragments other than the first fragment of a fragmented datagram. svn path=/trunk/; revision=2810
* Move "bytes_to_str()" to "strutil.c" from "packet.c" - it's just aGuy Harris2000-11-131-1/+2
| | | | | | | | | | | | | | | | | | | string formatter, like "format_text()", and, as "tvbuff.c" now calls it (*vide infra*), we don't want to have to make "tvbuff.c" drag "packet.h" in just to declare "bytes_to_str()". It's now declared in "strutil.h", so include it in modules that use "bytes_to_str()" and weren't already including it. Add a "tvb_bytes_to_str()" wrapper that calls "tvb_get_ptr()" to get a pointer to a chunk of N bytes at a given offset in a tvbuff and then hands that chunk to "bytes_to_str()". Convert the code that was doing that to use "tvb_bytes_to_str()" instead (which caught what I suspect is a bug in the Q.2931 dissector, where it was handing an offset of 0 to "tvb_get_ptr()" - a cut-and-pasteo, I think). Tvbuffify the ARP dissector. svn path=/trunk/; revision=2634
* Corrected BASE_OCT support for display formats. Note - it probably isn'tNathan Neulinger2000-11-031-5/+13
| | | | | | correct to display ints. svn path=/trunk/; revision=2552
* First step in moving core Ethereal routines to libepan.Gilbert Ramirez2000-09-271-0/+2480
svn path=/trunk/; revision=2458