aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.h
AgeCommit message (Collapse)AuthorFilesLines
2003-08-25From Matthijs Melchior:Guy Harris1-3/+6
support for registering fields after all the protocol registration routines are called (i.e., adding fields to the named field tree as they're registered); fix the GTK 2.x version of the field list dialog to show the correct name. svn path=/trunk/; revision=8248
2003-05-03Rename "proto_alloc_dfilter_string()" toGuy Harris1-3/+5
"proto_construct_dfilter_string()", to more accurately reflect what it does. Give it, and "proto_can_match_selected()", an "epan_dissect_t *" argument, which replaces the raw data pointer argument to "proto_construct_dfilter_string()". For fields that don't have a type we can directly filter on, we don't support filtering on the field as raw data if: the "epan_dissect_t *" argument is null; the data source tvbuff for the field isn't the tvbuff for the "epan_dissect_t" in question (i.e., it's in the result of a reassembly, and "frame[N:M]" can't get at it). Trim the length the raw data in the case of such a field to the length of the tvbuff for the "epan_dissect_t" in question, so we don't go past it. Fetch the raw data bytes to match from that tvbuff. Have "proto_construct_dfilter_string()" return a null pointer if it can't construct the filter string, and have "protocolinfo_packet()" in the tap-protocolinfo tap ignore a field if "proto_construct_dfilter_string()" can't construct a filter string for it - and have it pass NULL as the "epan_dissect_t *", for now. If somebody decides it makes sense to dump out a "frame[N:M] =" value for non-registered fields, it can be changed to pass "edt". svn path=/trunk/; revision=7635
2003-04-29Add a "proto_item_set_end()" routine that sets the length of an itemGuy Harris1-1/+10
given a tvbuff/offset pair referring to the byte past the end of the item. Use it in one place in the SMB dissector (there are plenty of other places where it could be used as well). svn path=/trunk/; revision=7603
2003-01-31Get rid of BASE_BIN - it's just the same as BASE_DEC, but people seemedGuy Harris1-3/+2
to be using it for stuff that should be hex, and for stuff that should be Boolean. Use BASE_DEC if it should be decimal, BASE_HEX if it should be hex, and make it Boolean if it should be Boolean. svn path=/trunk/; revision=7053
2002-11-28Make the "strings" pointer in a "header_field_info" structure a constGuy Harris1-4/+4
pointer, and put "const" into the casts in "VALS()" and "TFS()" macros, so we don't un-constify pointers to "value_string" arrays and "true_false_string" structures. Make some things "const" to keep the compiler happy with the previous change. svn path=/trunk/; revision=6684
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-6/+6
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6116
2002-08-24From Ulf Lamping: add a new FT_FLOAT type, for single-precisionGuy Harris1-1/+21
floating-point numbers, and display all the significant digits for both single-precision and double-precision floating-point numbers in the protocol tree, not just what "%g" does (6 digits). Put in comments explaining how the length of filter strings is computed, and fix some of the computations. svn path=/trunk/; revision=6081
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-5/+1
equivalents for the epan/ directory but leave winsock2.h in inet_pton.c and inet_ntop.c for now (can't estimate the consequences). svn path=/trunk/; revision=5928
2002-06-23WinPcap 2.3's <pcap.h> includes <packet32.h>, and WinPcap 2.3'sGuy Harris1-3/+3
<packet32.h> includes <winsock2.h>; we include that rather than <winsock.h>, to avoid errors due to conflicting declarations in <winsock.h> and <winsock2.h>. svn path=/trunk/; revision=5742
2002-05-14Make the "-G" flag take an argument. If no arugment is specified, or ifGuy Harris1-2/+5
the argument is "fields", dump out a table of the fields, as we currently do; if the argument is "protocols", dump out a table of the protocols. svn path=/trunk/; revision=5462
2002-04-29Move the code to build the balanced tree of fields into "proto_init()",Guy Harris1-2/+2
move the code from "dfilter_lookup_token()" into "proto_registrar_get_byname()", and get rid of "dfilter_lookup_token()" and have its callers call "proto_registrar_get_byname()" instead. svn path=/trunk/; revision=5287
2002-04-18From Phil Williams: support for looking up fields by name.Guy Harris1-2/+5
Clean up some white space, and one non-extern declaration in "epan/proto.h". svn path=/trunk/; revision=5201
2002-04-01Start assigning ett_ values at 0, rather than 1; get rid of the reservedGuy Harris1-5/+2
ETT_NONE entry. Initialize the "tree_type" field of a "field_info" structure to -1, meaning "this has not been given a subtree". Add checks before using that field that it's in range. That way, you have to create a subtree before putting protocol tree items under another item. We allocate the "tree_is_expanded" array when we've registered all dissectors; there's no need to allocate it while we're registering dissectors and, in fact, doing so means we leak memory (the memory for the version we allocated while registering dissectors). svn path=/trunk/; revision=5068
2002-02-18Don't give tvbuffs names; instead, give data sources names, where aGuy Harris1-3/+3
"data source" has a name and a top-level tvbuff, and frames can have a list of data sources associated with them. Use the tvbuff pointer to determine which data source is the data source for a given field; this means we don't have to worry about multiple data sources with the same name - the only thing the name does is label the notebook tab for the display of the data source, and label the hex dump of the data source in print/Tethereal output. Clean up a bunch of things discovered in the process of doing the above. svn path=/trunk/; revision=4749
2002-02-05The typedef in "epan/value_string.h" declares "value_string" to be aGuy Harris1-4/+4
typedef for "struct _value_string"; as such, the incomplete structure declaration in "epan/proto.h" should declare "struct _value_string", not "struct value_string", and casts and declarations in that header should also use "struct _value_string", not "struct value_string". svn path=/trunk/; revision=4699
2002-01-04"proto_tree_is_visible" no longer exists as a global variable, so removeGuy Harris1-7/+1
its declaration. svn path=/trunk/; revision=4477
2001-12-18Provide for per-protocol-tree data in the proto_tree code.Gilbert Ramirez1-5/+34
Put a hash-table of "interesting" fields in the per-proto-tree data. The dfilter code records which fields/protocols are "interesting" (by which I mean, their value or existence is checked). Thus, the proto_tree routines can create special arrays of field_info*'s that are ready for the dfilter engine to use during a filter operation. Also store the "proto_tree_is_visible" boolean, renamed "visible", in the per-proto-tree data. Move epan_dissect_t to its own header file to make #include dependencies easier to handle. Provide epan_dissect_fill_in_columns(), which accepts just the epan_dissect_t* as an argument. epan_dissect_new() needs to be followed by epan_dissect_run() for the dissection to actually take place. Between those two calls, epan_dissect_prime_dfilter() can be run 0, 1, or multiple times in order to prime the empty proto_tree with the "intersesting" fields from the dfilter_t. svn path=/trunk/; revision=4422
2001-12-07Dfilter code finds field under *any* parent's subtree, not justGilbert Ramirez1-5/+5
the parent under which the field was registered. This is the *unoptimized* version, to give developers something to use while the optimized version is being created. svn path=/trunk/; revision=4351
2001-12-03Make "dissector_add()", "dissector_delete()", and "dissector_change()"Guy Harris1-4/+1
take a dissector handle as an argument, rather than a pointer to a dissector function and a protocol ID. Associate dissector handles with dissector table entries. svn path=/trunk/; revision=4308
2001-11-26This should be the final bit of removing the dissect_data symbolEd Warnicke1-9/+1
from being required by anyone other than packet-data.c. It can now be accessed with call_dissector() with the name "data". dissect_data is now also of dissect_t. svn path=/trunk/; revision=4271
2001-11-26Switched from using CHECK_DISPLAY_AS_DATA to using CHECK_DISPLAY_AS_XEd Warnicke1-1/+9
which also takes a handle as an argument and thus doesn't call dissect_data directly. svn path=/trunk/; revision=4270
2001-11-15Get rid of NullTVB, the "compat_top_tvb" member of the "packet_info"Guy Harris1-4/+1
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
2001-10-31Put "extern" in front of a pile of function declarations.Guy Harris1-100/+99
It makes no difference if they really are function declarations; however, in plugins, when building on OSes that don't let dynamically-loaded modules access functions in the main program (e.g., Windows), when compiling a plugin, <plugin_api.h> defines the names of those functions as (*pointer_name), so they turn into declarations of pointer variables pointing to the functions in question, and, on platforms with a def/ref model in the linker, if a plugin has more than one source file that gets linked into the plugin, the linker may get upset at two definitions of the same variable. svn path=/trunk/; revision=4114
2001-10-31Get rid of a bunch of stuff that was there to support non-tvbuffifiedGuy Harris1-8/+1
dissectors and that's no longer needed. svn path=/trunk/; revision=4112
2001-09-14Make the resolution for time values be nanoseconds rather thanGuy Harris1-9/+6
microseconds. Fix some "signed vs. unsigned" comparison warnings. svn path=/trunk/; revision=3934
2001-08-29Add a "proto_item_append_text()" routine, which is likeGuy Harris1-1/+9
"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
2001-08-28Get rid of "proto_tree_add_notext()" - if you create a subtree using it,Guy Harris1-5/+1
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
2001-07-22Do __attribute__ stuff if the GCC version number is greater than orGuy Harris1-17/+17
equal to 2, not just if it's equal to 2 - GCC 3.0 makes it 3, not 2.... svn path=/trunk/; revision=3765
2001-06-18From Joerg Mayer: explicitly fill in all members of aGuy Harris1-2/+7
"header_field_info" structure, including the ones that are later set by the routines to register fields. svn path=/trunk/; revision=3561
2001-06-05Enable "Match Selected" only if there's a field selected *and* we can doGuy Harris1-3/+9
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
2001-04-02Added two new arguments to epan_init() and proto_init() toEd Warnicke1-2/+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
2001-04-01Added a function proto_get_id_by_filter_name() function to proto.{c,h}Ed Warnicke1-1/+4
to allow the lookup of proto_ids by filter_name. svn path=/trunk/; revision=3235
2001-03-23Changes required to support multiple named data sources.Jeff Foster1-2/+3
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
2001-03-02Calculate the height and width of m_r_font globally, since variousGilbert Ramirez1-1/+4
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
2001-02-13In a display filter expression, make a field name refer to any of theGuy Harris1-2/+3
fields with that name. svn path=/trunk/; revision=3030
2001-02-01Create a more modular type system for the FT_* types. Put themGilbert Ramirez1-46/+30
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
2001-02-01"Decode As" dialog, from David Hampton.Guy Harris1-1/+4
svn path=/trunk/; revision=2965
2001-01-26Clean up the dissector registration up a bit - arrange that all pluginsGuy Harris1-2/+2
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
2001-01-03Have "proto_register_protocol()" build a list of data structures forGuy Harris1-5/+24
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
2000-11-16Tvbuffify the STP dissector, have it register itself and have the LLCGuy Harris1-2/+2
dissector call it through a handle, and make it static. Give "dissect_data()" an "offset" argument, so dissectors can use it to dissect part of the packet without having to cook up a new tvbuff. Go back to using "dissect_data()" to dissect the data in an IPP request. svn path=/trunk/; revision=2651
2000-09-27First step in moving core Ethereal routines to libepan.Gilbert Ramirez1-0/+553
svn path=/trunk/; revision=2458