aboutsummaryrefslogtreecommitdiffstats
path: root/epan
AgeCommit message (Collapse)AuthorFilesLines
2002-04-04Before putting an item into a protocol tree, make sure the item aboveGuy Harris1-17/+32
it, if it's going to be displayed (i.e., if it's not the root node), has had an ett_ value associated with it. svn path=/trunk/; revision=5098
2002-04-01Start assigning ett_ values at 0, rather than 1; get rid of the reservedGuy Harris2-24/+6
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-03-29Bump the version to 0.9.3. Update NEWS to be current toGerald Combs1-2/+2
http://www.ethereal.com/lists/ethereal-cvs/200203/msg00175.html (the rest will be added later). svn path=/trunk/; revision=5042
2002-03-28Initialize the fields of "edt->pi" in order - and initialize some fieldsGuy Harris1-15/+15
that weren't being initialized. svn path=/trunk/; revision=5034
2002-03-19Allow "proto_item_append_text()" to an item that doesn't have aGuy Harris1-5/+9
representation string - set the representation string to the default representation. This lets you append to an item that's been added with "proto_tree_add_XXX" calls that don't explicitly format the representation string. svn path=/trunk/; revision=4973
2002-03-06tvb_get_nstringz() needs to terminate a string with a NUL if theGilbert Ramirez3-28/+86
end of the tvbuff is reached before the maximum_length passed by the caller is reached and before a terminating NUL is found. In this case, tvb_get_nstringz() returns a -1, but if the string is not artificially terminated with a NUL by tvb_get_nstringz(), the caller has no idea where the string should end because 1) the return value "-1" gives the impression that the string ends at the end of the buffer but 2) the string does not end at the end of the buffer, but somewhere in the middle, due to the packet being shorter than expected. tvb_get_nstringz() and tvb_get_nstringz0() were both modified. The FT_STRINGZ case in proto_tree_add_item() is made simpler. During regression testing, when investigating a regression that I later corrected, I discovered that strings added through proto_tree_add_item (FT_STRING, FT_STRINGZ, and FT_UINT_STRING) leaked memory due to double allocation of the string. The proto_tree_add_string*() functions do not leak memory, since they only copy the string once. The memory leak was fixed by adding another argument to the static function proto_tree_set_string() to let the string ftype code know to g_strdup() the string or not. svn path=/trunk/; revision=4891
2002-03-03Bump the version to 0.9.2. Update NEWS to include everything from February.Gerald Combs1-2/+2
svn path=/trunk/; revision=4856
2002-03-03From Heikki Vatiainen: make "get_host_ipaddr()" require dotted-quad IPGuy Harris1-1/+10
addresses to really be quads, i.e. have four numbers. svn path=/trunk/; revision=4854
2002-03-02From Joerg Mayer: get rid of "-Wno-unused" flag in some configureGuy Harris10-29/+34
scripts, and check in changes to add _U_ to some unused arguments (some other should perhaps be used, so we leave the _U_ out so that the warnings serve as a reminder to check those). svn path=/trunk/; revision=4848
2002-02-27Remove unused variables, structure definitions, and functions.Gilbert Ramirez2-65/+23
From Joerg Mayer. svn path=/trunk/; revision=4827
2002-02-27From Joerg Mayer:Guy Harris4-7/+30
In the "configure.in" files, add -D_U_="__attribute__((unused))" to CFLAGS if we're using GCC, and add -D_U_="" otherwise, so _U_ can be used to mark arguments as unused. Add -D_U_="" arguments to the Makefile.nmake files as well, so _U_ works with Microsoft Visual C++ as well. Add comments and RCS IDs to the Makefile.nmake files that don't already have them. svn path=/trunk/; revision=4824
2002-02-27From Joerg Mayer: remove unused variables and declarations ofGuy Harris2-5/+2
non-existent functions. Remove the "filetype" argument from the "can_write_encap" functions for particular capture file types - the argument value is implicit, in that the routine being called is the routine for that particular file type. svn path=/trunk/; revision=4823
2002-02-27Fix "create_dissector_handle()" to properly create a handle for anGuy Harris1-2/+3
old-style dissector. svn path=/trunk/; revision=4816
2002-02-26Allow dissectors to be registered as "old-style" or "new-style"Guy Harris2-17/+90
dissectors. "Old-style" dissectors return nothing. "New-style" dissectors return one of: a positive integer, giving the number of bytes worth of data in the tvbuff that it considered to be part of the PDU in the tvbuff; zero, if it didn't consider the data in the tvbuff to be a PDU for its protocol; a negative integer, giving the number of additional bytes worth of data in needs to get the complete PDU (for use with fragmentation/segmentation when the length of the PDU isn't known to the protocol atop the one the dissector is dissecting). Have "call_dissector()" return the return value of new-style dissectors, and the length of the tvbuff handed to it for old-style dissectors. Have "dissector_try_port()" return FALSE if the subdissector is a new-style dissector and returned 0. Make the EAP dissector a new-style dissector, and have a "EAP fragment" dissector that is also a new-style dissector and handles fragmentation of EAP messages (as happens above, for example, RADIUS). Also, clean up some signed vs. unsigned comparison problems. Reassemble EAP-Message AVPs in RADIUS. svn path=/trunk/; revision=4811
2002-02-25Note that we could save some overhead if we require the name argument toGuy Harris1-1/+6
"add_new_data_source()" to be a string constant (or some other static data item). svn path=/trunk/; revision=4803
2002-02-24Get rid of "init_all_protocols()"; instead, have a routineGuy Harris2-7/+18
"init_dissection()" which calls "epan_conversation_init()", does the work that "init_all_protocols()" did, and then calls "reassemble_init()", so that the standard sequence of dissection initialization is done in one place, rather than having multiple places call the same sequence of routines. svn path=/trunk/; revision=4797
2002-02-23From John Mackenzie: put missing initializations of table entries inGuy Harris1-4/+20
"plugins.c". svn path=/trunk/; revision=4790
2002-02-22Handle TPKT packets split across segment boundaries, and multiple TPKTGuy Harris1-1/+5
packets per segment. Instead of having a routine for dissectors such as the Q.931 dissector to call to dissect the TPKT header, have a routine that does all the reassembly and multiple-packets-per-segment work, and have the Q.931 dissector call it. Export "is_tpkt()", and the new routine, to plugins. Add preferences for TPKT and Q.931 reassembly. svn path=/trunk/; revision=4778
2002-02-20Export "conversation_set_dissector()" in the plugin API table.Guy Harris1-3/+6
svn path=/trunk/; revision=4760
2002-02-18Have "alloc_field_info()" take a pointer to the field length as anGuy Harris1-33/+56
argument, so if the length was supplied as -1, it can set it to the length of data remaining in the tvbuff, so that its callers can use that length when getting the value for the field, rather than leaving the length in the "field_info" structure as -1. svn path=/trunk/; revision=4752
2002-02-18Don't give tvbuffs names; instead, give data sources names, where aGuy Harris8-45/+100
"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-17With the tvbuffication of all dissectors, the "packet_info" structure noGuy Harris2-11/+8
longer contains length fields, so there's no need to pass a "packet_info *" argument to "set_actual_length()". svn path=/trunk/; revision=4748
2002-02-15Comment-out FT_UCS2_LE, and remove the already commented-out FT_TEXT_ONLY.Gilbert Ramirez1-4/+2
svn path=/trunk/; revision=4738
2002-02-11dissect_frame() can throw a ReportedBoundsError; catch it inGilbert Ramirez1-4/+9
dissect_packet(). svn path=/trunk/; revision=4720
2002-02-06Old-style (non-tvbuffified) dissectors haven't been supported sinceGuy Harris1-2/+1
0.9.0 was released; get rid of the typedef for "old_dissector_t". svn path=/trunk/; revision=4703
2002-02-05"log" is a name that belongs to the ANSI C89 standard; it refers to aGuy Harris7-54/+56
function that computes the natural logarithm of a double. Using it as the name of a pointer to a routine to do logging can cause namespace collisions; in fact, it *does* cause them on AIX. Rename the function argument to "logfunc". svn path=/trunk/; revision=4700
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-02-02Update version to 0.9.1. Add NEWS entries for 0.9.1 changes.Gerald Combs1-2/+2
svn path=/trunk/; revision=4684
2002-02-02Routines added to the plugin table, and include-once #ifndef/#defineGuy Harris1-1/+4
wrappers added to plugin header files, by Charlie Duke. svn path=/trunk/; revision=4676
2002-02-01Squelch a GCC warning.Guy Harris1-1/+2
svn path=/trunk/; revision=4658
2002-02-01Provide tvb_ensure_length_remaining(), which is likeGilbert Ramirez3-5/+30
tvb_length_remaining() except that it throws BoundsError if 'offset' is out-of-bounds. Allow a length argument of -1 for FT_STRING and FT_BYTES fields in proto_tree_add_item(). Change some dissectors to either use -1 for the length argument in calls to proto_tree_add_item(), or call tvb_ensure_length_remaining() instead of tvb_length_remaining(), or to check the return-value of tvb_length_remaining(). Changes to more dissectors are necessary, but will follow later. svn path=/trunk/; revision=4656
2002-01-31There's no need to dynamically allocate the string buffer inGuy Harris1-7/+4
"col_prepend_fstr()" - just put it on the stack, and give it the size of the largest string you'll stuff into it. svn path=/trunk/; revision=4649
2002-01-31Don't include "inet_v6defs.h" in "column-utils.c"; nothing from it isGuy Harris1-11/+9
necessary. Don't use "alloca()", as it's not guaranteed to be present on all platforms. svn path=/trunk/; revision=4644
2002-01-30Remove the "--without-gcc" option - it doesn't work with the Sun,Guy Harris1-6/+1
Digital UNIX, and HP C compilers, and it may not work with other compilers (due to the GLib problem mentioned in the previous checkin), so it runs the risk of being an "attractive nuisance", i.e. users may try it, find it doesn't work, and then send mail to various Ethereal mailing lists asking about it. svn path=/trunk/; revision=4640
2002-01-30Add a "--without-gcc" option, similar to what tcpdump and libpcap have.Guy Harris1-1/+6
(This isn't as useful for testing purposes as it is in tcpdump and libpcap, as GLib is configured based on the compiler used to compile it, so you can't necessarily build an application using GLib with a compiler different from the one used to compile GLib, but we'll add it anyway.) svn path=/trunk/; revision=4637
2002-01-30Try defining just _USE_XOPEN and see if that gets "strptime()" declaredGuy Harris1-16/+1
on most platforms; it works on Solaris, at least. svn path=/trunk/; revision=4630
2002-01-30Alas, on Solaris, defining _XOPEN_SOURCE causes some things not in theGuy Harris1-1/+13
X/Open specs *not* to be defined, so we also have to define __EXTENSIONS__. XXX - can we just define __USE_XOPEN, and not define _XOPEN_SOURCE? Is that sufficient to get "strptime()" declared on all platforms? svn path=/trunk/; revision=4629
2002-01-30IPv6 name resolution support on Solaris 8, from Heikki Vatiainen.Guy Harris1-1/+5
svn path=/trunk/; revision=4627
2002-01-29Use:Gilbert Ramirez1-3/+4
#ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE 500 #endif #define __USE_XOPEN #include <time.h> to get strptime() declared in time.h on various systems. I hope this helps more than it hurts. svn path=/trunk/; revision=4624
2002-01-29Support for capturing on, and reading captures from, OpenBSD firewallGuy Harris3-3/+47
logging virtual interface, from Mike Frantzen. svn path=/trunk/; revision=4616
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris13-51/+42
"epan/..." pathnames, so as to avoid collisions with header files in any of the directories in which we look (e.g., "proto.h", as some other package has its own "proto.h" file which it installs in the top-level include directory). Don't add "-I" flags to search "epan", as that's no longer necessary (and we want includes of "epan" headers to fail if the "epan/" is left out, so that we don't re-introduce includes lacking "epan/"). svn path=/trunk/; revision=4586
2002-01-20Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOLGuy Harris1-8/+26
items to the protocol tree; it's interpreted as "the rest of the data in the tvbuff". This can be used if 1) the item covers the entire packet or the remaining payload in the packet or 2) the item's length won't be known until it's dissected, and will be then set with "proto_item_set_len()" - if an exception is thrown in the dissection, it means the item ran *past* the end of the tvbuff, so saying it runs to the end of the tvbuff is reasonable. Convert a number of "proto_tree_add_XXX()" calls using "tvb_length_remaining()", values derived from the result of "tvb_length()", or 0 (in the case of items whose length is unknown) to use -1 instead (using 0 means that if an exception is thrown, selecting the item highlights nothing; using -1 means it highlights all the data for that item that's available). In some places where "tvb_length()" or "tvb_length_remaining()" was used to determine how large a packet is, use "tvb_reported_length()" or "tvb_reported_length_remaining()", instead - the first two calls indicate how much captured data was in the packet, the latter two calls indicate how large the packet actually was (and the fact that using the latter could cause BoundsError exceptions to be thrown is a feature - if such an exception is thrown, the frame really *was* short, and it should be tagged as such). Replace some "proto_tree_add_XXX()" calls with equivalent "proto_tree_add_item()" calls. Fix some indentation. svn path=/trunk/; revision=4578
2002-01-17Use the "fragmented" field of the "packet_info" structure inGuy Harris1-2/+3
"dissect_frame()" to indicate whether a ReportedBoundsError was due to the packet being malformed (i.e., the packet was shorter than it's supposed to be, so the dissector went past the end trying to extract fields that were supposed to be there) or due to it not being reassembled (i.e., the packet was fragmented, and we didn't reassemble it, but just treated the first fragment as the entire packet, so the dissector went past the end trying to extract fields that were partially or completely in fragments after that). Mark the latter as being unreasembled rather than malformed. Properly initialize, save, and restore that field, and properly set it, so that works. svn path=/trunk/; revision=4555
2002-01-13Add a preferences page for the name resolution flags.Guy Harris2-21/+40
Separate the preferences value for those flags and the name resolution code's value into separate variables; this means that the resolution code no longer depends on the preferences code, and may let us eventually have the current setting and the preference setting differ (so that a user can temporarily override the preference setting without causing subsequent saves of the preferences to save the temporary value). Add routines to create various types of widgets for preferences, and to fetch the values for "enumerated" preferences, and use them both in the code to handle hardwired preference pages and table-driven preference pages. svn path=/trunk/; revision=4536
2002-01-11From Jirka Novak:Guy Harris2-20/+78
Support for generating filter expressions based on packet list column values Support for adding filter expressions generated from column or protocol tree field values to the current expression rather than replacing the current expression svn path=/trunk/; revision=4522
2002-01-07Clean up white space.Guy Harris1-19/+20
svn path=/trunk/; revision=4492
2002-01-05Long NCP traces can easily have many packets whose "uniqueness"Gilbert Ramirez3-3/+44
variables wrap-around. Since the request/reply packets are related via a hash based on these uniqueness variables, long NCP traces can have mis-matches reqeust/reply records. Thus, only do the hash-lookup for the reply packet during the first sequential scan of the trace file. Once the pertinent info is found, store it in the packet's private data area. Since the memory allocated for the hash and for the structures that make up the keys are no longer needed after the first sequential run through the trace file, arrange to free that memory after the first sequential run. Similar to the register_init_routine() that allows dissectors to register callbacks for calling *before* a capture file is loaded, set up a register_postseq_cleanup_routine() function that allows dissectors to register callbacks for calling *after* the first sequential run-through of the trace file is made. This is not a *final* cleanup callback, since Ethereal will still have that trace file open for random-access reading. I didn't have tethereal call postseq_cleanup_all_protocols() since tethereal doesn't keep the trace file open for random-access reading. I could easily be swayed to make tethereal call that function, however. svn path=/trunk/; revision=4484
2002-01-04If the "parent directory" of what would be the personal configurationGuy Harris1-3/+13
file directory is just a drive letter (e.g., if the directory is "c:\Ethereal"), don't "stat()" it to see if it exists (as that'll fail, falsely leading us to believe it needs to be created; the attempt to do so will fail), just assume it exists. svn path=/trunk/; revision=4482
2002-01-04From Hamish Moffatt:Guy Harris1-2/+13
Additional Windows Makefile dependencies, so more stuff gets built as needed. Additional stuff cleaned up by "make clean" (well, "nmake -f makefile.nmake clean", anyway) Make PDB_FILE be "vc*.pdb", so it referes to the PDB files either for VC++ 5.0 or VC++ 6.0. svn path=/trunk/; revision=4481
2002-01-04Fix up white space.Guy Harris1-5/+5
svn path=/trunk/; revision=4478