aboutsummaryrefslogtreecommitdiffstats
path: root/epan
AgeCommit message (Collapse)AuthorFilesLines
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
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
2002-01-04Throw a BoundsError if a length parameter in a tvbuff-accessor is < -1.Gilbert Ramirez1-3/+9
svn path=/trunk/; revision=4474
2001-12-28Correctly handle the nanoseconds fields in strings representing absoluteGuy Harris1-7/+68
and relative times - "0.4" is 400,000,000 nanoseconds, not 4 nanoseconds. svn path=/trunk/; revision=4458
2001-12-23Bump the version up to 0.9.0. Update the NEWS file.Gerald Combs1-2/+2
svn path=/trunk/; revision=4440
2001-12-20Work around Windows' annoying decision to map 0.0.0.0 to the local hostGuy Harris1-2/+8
name in "gethostbyaddr()". svn path=/trunk/; revision=4433
2001-12-18Provide for per-protocol-tree data in the proto_tree code.Gilbert Ramirez15-218/+441
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-16Add an extra argument to "epan_dissect_new()" that indicates whether theGuy Harris2-4/+14
display representation should be put into protocol tree items if a protocol tree is to be constructed; have it set "proto_tree_is_visible" from that argument. svn path=/trunk/; revision=4408
2001-12-13Plug a really bad memory leak. The GPtrArrays of field_info's thatGilbert Ramirez1-1/+2
are created for every tested field for every tested packet during a dfilter run were not being destroyed. svn path=/trunk/; revision=4393
2001-12-12From Motonori Shindo: add "*.pdb" to the ".cvsignore" files inGuy Harris3-0/+3
directories in which PDB files are generated and in which it wasn't already present. svn path=/trunk/; revision=4386
2001-12-12From Motonori Shindo:Guy Harris3-9/+10
fix a bogus batch mode inference rule of make, so that "vc60.pdb" files are created in the proper directory; delete ".pdb" files in a "nmake -f Makefile.nmake clean"; include the text2pcap and mergecap ".pdb" files in the Windows binary distribution. svn path=/trunk/; revision=4385
2001-12-10Remove some extra blank lines.Guy Harris1-4/+1
svn path=/trunk/; revision=4374
2001-12-10The packet length is an unsigned quantity; print it with "%u".Guy Harris1-2/+3
If we get an illegal column type in "fill_in_columns()", crash. svn path=/trunk/; revision=4373
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"Guy Harris8-201/+190
structure to the "packet_info" structure; only stuff that's permanently stored with each frame should be in the "frame_data" structure, and the "column_info" structure is not guaranteed to hold the column values for that frame at all times - it was only in the "frame_data" structure so that it could be passed to dissectors, and, as all dissectors are now passed a pointer to a "packet_info" structure, it could just as well be put in the "packet_info" structure. That saves memory, by shrinking the "frame_data" structure (there's one of those per frame), and also lets us clean up the code a bit. svn path=/trunk/; revision=4370
2001-12-08Clean up indentation.Guy Harris1-20/+20
svn path=/trunk/; revision=4362
2001-12-08Attach a descriptive name field type and base to dissector tables; thatGuy Harris2-7/+58
specifies how the selector values used as keys in those tables are to be displayed, and the title to use when displaying the table. Use that information in the code to display the initial and current entries of various dissector tables. Have the dissector for BACnet APDUs register itself by name, and have the BACnet NPDU dissector call it iff the BAC_CONTROL_NET bit isn't set, rather than doing it with a dissector table. svn path=/trunk/; revision=4358
2001-12-07Use "-no-cpp-precomp" rather than "-traditional-cpp" on MacOS X, as perGuy Harris1-3/+17
the "The Compiler and Tools" section on http://fink.sourceforge.net/doc/porting/basics.php Do so on MacOS X regardless of whether the compiler is called "gcc" or not, as that page also indicates that the compiler is installed as "cc". svn path=/trunk/; revision=4354
2001-12-07Dfilter code finds field under *any* parent's subtree, not justGilbert Ramirez2-32/+9
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-06Remove proto_tree from capture_file and PacketWinData, since theyGilbert Ramirez2-6/+16
already contain a pointer to an epan_dissect_t, which contains the proto_tree. Routines calling epan_dissect_new() do not create their own proto_tree via proto_tree_create_root(); instead, they pass a boolean to epan_dissect_new() telling it whether it should create the root proto_tree. svn path=/trunk/; revision=4343
2001-12-03Remove the no-longer-extant "conv_dissector_add()" from the list ofGuy Harris1-2/+2
plugin APIs, and add the new "dissector_add_handle()". Add an entry in the dissector table structure for "create_dissector_handle". svn path=/trunk/; revision=4314
2001-12-03A "dissector_table_t" is no longer a pointer to a hash table, it's aGuy Harris1-4/+4
pointer to a "struct dissector_table", containing a pointer to a hash table and a pointer to a list of handles. Fix "dissector_all_tables_foreach_func()" to understand that. svn path=/trunk/; revision=4312
2001-12-03Get rid of the lists of conversation dissectors; instead, have aGuy Harris2-142/+105
dissector table contain both a hash table, to use to look up port numbers to find a dissector, and a list of all dissectors that *could* be assigned to ports in that hash table, to be used by user interface code. Make the "Decode As" dialog box code use that. Also make it *not* let you choose whether to set the dissector for both the UDP and TCP versions of a port; some protocols run only atop TCP, some run only atop UDP, and even those that can run atop both may have different dissector handles to use over TCP and UDP, so handling a single merged list would be a mess. (If the user is setting the dissector for a TCP port, only those protocols that Ethereal can handle over TCP should be listed; if the user is setting the dissector for a UDP port, only those protocols that Ethereal can handle over TCP should be listed; if the user is setting a dissector for both, only those protocols that Ethereal can handle over *both* TCP *and* UDP should be listed, *and* there needs to be a way to let the "Decode As" code get both the TCP handle *and* the UDP handle and use the right ones. If somebody really wants that, they need to implement all of the above if they want the code to be correct.) Fix the code that handles setting the dissection for the IP protocol number to correctly update the lists of protocols being dissected as TCP and as UDP; the code before this change wasn't updating the single such list to add new protocols. svn path=/trunk/; revision=4311
2001-12-03Add a routine tro look for a given port in a given dissector table and,Guy Harris2-6/+23
if found, return the dissector handle for that port. Use that routine in the X.25 dissector; revert to attaching a dissector handle to an X.25 virtual circuit. svn path=/trunk/; revision=4310
2001-12-03Make "dissector_add()", "dissector_delete()", and "dissector_change()"Guy Harris5-119/+81
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-12-03Rename another routine to get rid of an unnecessary "1" in its name.Guy Harris1-3/+3
svn path=/trunk/; revision=4305
2001-12-03Don't bother saving or restoring "can_desegment" until you actually callGuy Harris1-13/+14
a subdissector. svn path=/trunk/; revision=4304
2001-12-03Rename and re-comment some routines to make it clearer what they do.Guy Harris1-18/+27
svn path=/trunk/; revision=4303
2001-11-29Update from Ronnie Sahlberg:Guy Harris3-7/+48
1. Changes how can_desegment works so that can_desegment is only != 0 for whichever dissector is running immediately on top of whoever offers the can_desegment service. Thus DCERPC needs no special handling to see if it can trust can_desegment (which is currently only available ontop of TCP and not ontop of tcp->nbss->smb). 2. Changes fragment reassembly of transaction smb to only show the defragmented packet for the transaction smb holding the first fragment. To see why, test it with a transaction SMB containing a ~60kb PDU or larger. The old behaviour had approximately quadratic behaviour regarding runtime for dissecting such PDUs. (example: NetShareEnum is a command which can grow really really large if the number of shares and comments are large) svn path=/trunk/; revision=4296
2001-11-27Change "conversation_set_dissector()" to take a dissector handle, ratherGuy Harris4-12/+32
than a pointer to a dissector function, as an argument. This means that the conversation dissector is called through "call_dissector()", so the dissector itself doesn't have to worry about checking whether the protocol is enabled or setting "pinfo->current_proto", so get rid of the code that does that in conversation dissectors. Also, make the conversation dissectors static. Get rid of some direct calls to dissectors; replace them with calls through handles, and, again, get rid of code to check whether a protocol is enabled and set "pinfo->current_proto" where that code isn't needed. Make those dissectors static if they aren't already static. Add a routine "create_dissector_handle()" to create a dissector handle without registering it by name, if the dissector isn't used outside the module in which it's defined. svn path=/trunk/; revision=4281
2001-11-26This should be the final bit of removing the dissect_data symbolEd Warnicke4-18/+9
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-24Update the Makefile.nmake files to reflect the move of "int-64bit.c" toGuy Harris1-0/+1
the "epan" subdirectory. Include "strptime.obj" in the list of object files used to build "text2pcap.exe". svn path=/trunk/; revision=4258
2001-11-22Moved int-64bit.{c,h} into epan/Ed Warnicke5-5/+619
svn path=/trunk/; revision=4248
2001-11-21Remove the pointer to the global packet_info from the table ofGilbert Ramirez1-3/+1
pointers used for plugins on win32. svn path=/trunk/; revision=4247
2001-11-21Remove the global packet_info called "pi". Dissectors now onlyGilbert Ramirez10-100/+62
access their own "pinfo". A packet_info is stored in epan_dissect_t, which is created for the dissection of a single packet. GUI functions which need to access the packet_info of the currently selected packet used to use "pi"; now they use cfile.edt->pi. cfile's "edt" member is the epan_dissect_t of the currently-selected packet. The functionality of blank_packetinfo() was moved into dissect_packet(), as that's the only place that called blank_packetinfo(), after a spurious call to blank_packetinfo() was removed from packet_list_select_cb(). svn path=/trunk/; revision=4246
2001-11-21Get rid of some unused variables.Guy Harris3-11/+3
svn path=/trunk/; revision=4239