aboutsummaryrefslogtreecommitdiffstats
path: root/tethereal.c
AgeCommit message (Collapse)AuthorFilesLines
2002-03-12Get rid of the "--enable-snmp" option; instead, use "--with-ucdsnmp".Guy Harris1-5/+3
Make the directory option to "--with-ucdsnmp" optional. Handle "--with-ucdsnmp" similar to the way "--with-pcap" is handled. Get rid of unnecessary #defines in "packet-cops.c". Get rid of no-longer-necessary include of "dlfcn.h" in "packet-snmp.c". svn path=/trunk/; revision=4930
2002-03-10Remove code to show the presence, and version number, of the CMU SNMPGuy Harris1-14/+3
library, as we no longer support linking with that library. svn path=/trunk/; revision=4917
2002-03-06Don't say "without SNMP"; that can confuse people into thinking it meansGuy Harris1-2/+2
Ethereal doesn't dissect SNMP if not linked with an SNMP library (and *did* confuse at least one person into thinking that). Say "without SNMP MIB support", instead, as you only lose the ability to read SNMP MIBs and interpret OIDs and variable bindings according to those MIBs. svn path=/trunk/; revision=4894
2002-02-28In follow.c, initialize data_out_file to NULL, as it used toGilbert Ramirez1-2/+1
be initialized in gtk/follow_dlg.c In gtk/follow_dlg.c, declare data_out_file as 'extern'. In tethereal.c, no longer define 'data_out_file', as the storage for it is now in follow.c. svn path=/trunk/; revision=4830
2002-02-27From Joerg Mayer: remove unused variables and declarations ofGuy Harris1-3/+1
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-24Put all the capture options into a structure.Guy Harris1-46/+66
Move the ringbuffer capture options from the "capture_file" structure to the structure for capture options, as they're a property of an in-progress capture, not a property of a particular capture file. svn path=/trunk/; revision=4799
2002-02-24Get rid of "init_all_protocols()"; instead, have a routineGuy Harris1-24/+5
"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-24Have "get_positive_int()" really check for positive integers, not justGuy Harris1-10/+10
non-negative integers. Get rid of unused "get_positive_int()" routine in "gtk/capture_dlg.c". svn path=/trunk/; revision=4796
2002-02-24"autostop_filesize" and "autostop_duration" don't need to be in theGuy Harris1-18/+33
"capture_file" structure - they're a property of an in-progress capture, not a property of an open capture file. Make them just variables. The maximum number of packets to be captured should be a variable separate from the "count" field in the "capture_file" structure - the latter is a count of the packets in the capture file in question. Have Boolean variables indicating whether a maximum packet count, maximum capture file size, and maximum capture duration were specified. If an option isn't set, and we're doing an "update list of packets in real time" capture, don't pass the option to the child process with a command-line argument. Don't create "stop when the capture file reaches this size" or "stop when the capture's run for this long" conditions if a maximum capture file size or a maximum capture duration, respectively, haven't been specified. Don't test or free a condition if it wasn't created. Don't allow a 0 argument to the "-c" flag - the absence of a "-c" flag is the way you specify "no limit on the number of packets". Initialize the check boxes and spin buttons for the "maximum packets to capture", "maximum capture size", and "maximum capture duration" options to the values they had in the last capture. If an option wasn't specified, don't read its value from the dialog box and set the variable. svn path=/trunk/; revision=4795
2002-02-24From Peter Valchev: fix editcap to assign the result of "getopt()" to anGuy Harris1-2/+2
"int" and to check "getopt()"s return value with -1 rather than EOF. Fix other "getopt()" loops to check against -1 as well (EOF is -1 on most if not all platforms, but the Single UNIX Specification says "getopt()" returns -1, so we should check against -1, not EOF). svn path=/trunk/; revision=4793
2002-02-18Don't give tvbuffs names; instead, give data sources names, where aGuy Harris1-4/+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-08Have Wiretap set the snapshot length to 0 if it can't be derived fromGuy Harris1-8/+22
reading the capture file. Have callers of "wtap_snapshot_length()" treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so that, when writing a capture file in a format that *does* store the snapshot length, we can at least put *something* in the file). If we don't know the snapshot length of the current capture file, don't display a value in the summary window. Don't use "cfile.snap" as the snapshot length option when capturing - doing so causes Ethereal to default, when capturing, to the snapshot length of the last capture file that you read in, rather than to the snapshot length of the last capture you did (or the initial default of "no snapshot length"). Redo the "Capture Options" dialog box to group options into sections with frames around them, and add units to the snapshot length, maximum file size, and capture duration options, as per a suggestion by Ulf Lamping. Also add units to the capture count option. Make the snapshot length, capture count, maximum file size, and capture duration options into a combination of a check box and a spin button. If the check box is not checked, the limit in question is inactive (snapshot length of 65535, no max packet count, no max file size, no max capture duration); if it's checked, the spinbox specifies the limit. Default all of the check boxes to "not checked" and all of the spin boxes to small values. Use "gtk_toggle_button_get_active()" rather than directly fetching the state of a check box. svn path=/trunk/; revision=4709
2002-01-29The ring buffer code only supports libpcap format captures; print anGuy Harris1-2/+7
error message and quit if the user tries to use ring buffering with another capture file format, and put a note about that in the Tethereal man page. svn path=/trunk/; revision=4615
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-8/+8
"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-15Tethereal needs to allocate space for col_expr[] and col_expr_val[] too.Gilbert Ramirez1-1/+4
Capturing with non-verbose output being printed segfaulted w/o this. svn path=/trunk/; revision=4551
2002-01-13Add a preferences page for the name resolution flags.Guy Harris1-5/+8
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-11Declare "capture()" appropriately.Guy Harris1-2/+2
svn path=/trunk/; revision=4527
2002-01-10Fix some problems with building Ethereal/Tethereal without libpcap.Guy Harris1-1/+7
Get rid of a #include I'd #if 0'ed out. svn path=/trunk/; revision=4513
2002-01-10Add a preferences page for capture preferences, so that the user canGuy Harris1-17/+23
directly edit the capture preferences, rather than only being able to set them implicitly from the values for the most recent capture. Add a preferences item for the interface on which to capture. Get rid of some unused variables. svn path=/trunk/; revision=4510
2002-01-03Make the "go" member of the "loop_data" structure in Ethereal aGuy Harris1-10/+18
"gboolean", as it's a Boolean value, and move it to the beginning of the structure in Tethereal, as it is in Ethereal. From Graeme Hewson: Check for "pcap_dispatch()" returning -1, meaning an error occurred; if it does, stop capturing, and report the error. If we get a signal in tethereal, stop the capture with a "longjmp()", rather than by clearning the "go" flag; "pcap_dispatch()", on many platforms, keeps reading rather than returning a captured packet count of 0 if the system call to read packets returns -1 with an errno of EINTR, so the "pcap_dispatch()" won't be broken out of if the signal handler returns. Fix a typo in an error message. svn path=/trunk/; revision=4471
2001-12-21Clean up the comments for the ring buffer checks.Guy Harris1-7/+6
svn path=/trunk/; revision=4438
2001-12-21There is no such thing as an optional parameter to a command-line flagGuy Harris1-8/+2
if you're using "getopt" - if a flag requires a parameter, not specifying the parameter is an error. svn path=/trunk/; revision=4437
2001-12-21If the user requested a ring buffer but didn't specify a capture file orGuy Harris1-16/+18
maximum capture file size, treat that as an error. svn path=/trunk/; revision=4436
2001-12-21Don't let the user specify a maximum capture file size if they're notGuy Harris1-2/+9
saving the capture to a file. svn path=/trunk/; revision=4435
2001-12-21It's not possible to check whether the capture file has reached itsGuy Harris1-3/+5
maximum size if there is no capture file; in fact, if you do, you get a core dump. Skip the capture file size test if not capturing to a file. svn path=/trunk/; revision=4434
2001-12-18Provide for per-protocol-tree data in the proto_tree code.Gilbert Ramirez1-6/+13
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 Harris1-10/+7
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-10Don't fill in the columns if we're writing to a capture file.Guy Harris1-3/+5
Don't fill in the columns if we're in verbose mode. svn path=/trunk/; revision=4372
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"Guy Harris1-12/+5
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-06Remove proto_tree from capture_file and PacketWinData, since theyGilbert Ramirez1-14/+7
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-04In the NetMon capture file reading code, if we get a short read whenGuy Harris1-2/+2
trying to read the frame table, return -1 with "*err" set to WTAP_ERR_SHORT_READ, don't return 0 - we've already decided that the file is a NetMon file, so we shouldn't return a "this isn't a NetMon file" indication, we should return a "this file is too short" error, as that's what the problem is. Fix up the error messages for WTAP_ERR_SHORT_READ to indicate that the read might have gotten cut short in the middle of data other than a packet. svn path=/trunk/; revision=4331
2001-12-04Make the bytes-written information from Wiretap a long, as we allowGuy Harris1-8/+84
files to get that big. From Thomas Wittwer and Matthias Nyffenegger: Support for "ring buffer mode", wherein there's a ring buffer of N capture files; as each capture file reaches its maximum size (the ring buffer works only with a maximum capture file size specified), Ethereal rolls over to the next capture file in the ring buffer, replacing whatever packets might be in it with new packets. svn path=/trunk/; revision=4323
2001-12-04Support for stopping capture at specified capture file size or captureGuy Harris1-19/+108
duration, from Thomas Wittwer and Matthias Nyffenegger. svn path=/trunk/; revision=4322
2001-11-21Remove the global packet_info called "pi". Dissectors now onlyGilbert Ramirez1-3/+2
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-13Hopefully the last time I have to change my e-mail address.Gilbert Ramirez1-2/+3
svn path=/trunk/; revision=4199
2001-11-09Wrap calls to "pcap_datalink()" in a routine that attempts to compensateGuy Harris1-2/+6
for AIX 5.x's non-standard libpcap, where "pcap_datalink()" doesn't return DLT_ values, it returns RFC 1573 ifType values. Put that wrapper, and the routine to get the interface list, in a separate file, for packet-capture utility routines, so not everybody who includes "util.h" needs to include <pcap.h>. Fix up the Wiretap hack for dealing with said incompatibility to use the correct ifType value for Token Ring. svn path=/trunk/; revision=4184
2001-11-04Allow a dissector to register preferences that it no longer supports asGuy Harris1-1/+2
obsolete; we silently ignore attempts to set those in a preferences file, so that we don't spam the user with error messages caused by them having saved preferences in an earlier release that contained those preferences. Make the Diameter and iSCSI dissectors register obsolete preferences. Crash if some code tries to register a preferences module with a name that contains something other than lower-case ASCII letters, numbers, or underscores, or that has already been registered, or if some code tries to register a preference with a name that contains something other than lower-case ASCII letters, numbers, underscores, or periods, or that has already been registered, so that we don't put code like that in a release and have to shovel code into "prefs.c" to fix it up later. (The problem with multiple modules or preferences with the same name should be obvious; the problem with names with blanks, or upper-case letters, or punctuation, is that they're a pain to type on the command line.) svn path=/trunk/; revision=4148
2001-10-26Fix the rest of the signed/unsigned comparison warnings.Gilbert Ramirez1-3/+3
svn path=/trunk/; revision=4088
2001-10-25Handle "pcap_open_live()" succeeding but returning a warning; print theGuy Harris1-9/+20
warning before the capture starts. svn path=/trunk/; revision=4074
2001-10-22Add a routine to get the directory in which personal configuration filesGuy Harris1-2/+3
reside. Use it, rather than concatenating the user's home directory and ".ethereal" in a number of files. Fix up some additional places to use G_DIR_SEPARATOR_S as the pathname separator. svn path=/trunk/; revision=4061
2001-10-04Use longs as file offsets, so that on platforms with 64-bit "long" weGuy Harris1-8/+8
can handle capture files bigger than 2GB. svn path=/trunk/; revision=3993
2001-09-05Close the file to which we're writing before exiting, so that:Guy Harris1-1/+11
buffered data is written out to the file; headers are written if the capture file header depends on the number or sizes of the packets; etc.. svn path=/trunk/; revision=3909
2001-07-27Fix AC_ETHEREAL_PCAP_CHECK so that, if a directory was specified withGuy Harris1-12/+10
"--with-pcap", it adds the "include" subdirectory of that directory to the list of directories to search for include files, rather than adding the directory itself. Check whether libpcap defines "pcap_version", and define HAVE_PCAP_VERSION if it does. Use "pcap_version" iff HAVE_PCAP_VERSION is defined, rather than special-casing MacOS X. Don't #define a string for the WinPcap version; just leave HAVE_PCAP_VERSION undefined on Windows, as WinPcap 2.2beta is out, so we can no longer assume that the Windows version of Ethereal is using WinPcap 2.1. svn path=/trunk/; revision=3792
2001-07-26MacOS support changes, from Michael Tuexen (with some modifications):Guy Harris1-1/+5
replace "--with-plugindir" with "--with-plugins", and have the plugin directory optional - this allows plugins to be disabled; add "--traditional-cpp" on MacOS X/Darwin (Apple's "cc" compiler requires it, for some annoying reason, even though it is, as far as I know, GCC-based, and other GCC's don't require it); on MacOS X, don't use "pcap_version[]", as, for some annoying reason, libpcap on MacOS X doesn't define it. Clean up some whitespace in the help messages for the configure script. Move the AM_CONDITIONAL for SETUID_INSTALL after the point at which "enable_setuid_install" is set, as it tests "enable_setuid_install". svn path=/trunk/; revision=3788
2001-07-17Added a "Suppress Unmarked" option to the print dialog toEd Warnicke1-1/+2
allow you to suppress the printing of unmarked packets. This allows a user to mark the packets they wish to print and print ONLY those packets by suppressing all other unmarked packets. This may seem like a bit of a convoluted way of expressing things, as usually the desired behavior would be to print the marked packets. However, we do NOT print marked packets that are not displayed under the current filter. To be maximally explicite I've expressed this as suppressing unmarked frames. svn path=/trunk/; revision=3736
2001-07-05"open_cap_file()" in Ethereal and Tethereal don't use the FILE_T theyGuy Harris1-3/+5
get from calling "wtap_file()", so get rid of the call and the (otherwise unused) variable to which its result gets assigned. That lets us get rid of "wtap_file()" in Wiretap. It also lets us get rid of the include of "zlib.h" in "file.h"; the #defines of "file_open()", "filed_open()", and "file_close()" are also unnecessary, so we get rid of those as well. However, that means we need to include <zlib.h> in "gtk/main.c" and "tethereal.c", so that the version number of libz is defined and can show up in the version string. svn path=/trunk/; revision=3652
2001-06-08When printing the contents of a raw-data field, don't use the raw dataGuy Harris1-2/+2
of the current frame as the source, use the raw data of the tvbuff that's the data source of that field. svn path=/trunk/; revision=3531
2001-06-08Move the fragment reassembly code into "reassemble.c" andGuy Harris1-1/+14
"reassemble.h", and remove IPv4 dependencies from it. Use it for OSI CLNP segment reassembly as well. svn path=/trunk/; revision=3525
2001-06-05Enable "Match Selected" only if there's a field selected *and* we can doGuy Harris1-3/+2
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-05-31Support for "-N" flag enabling selected forms of name resolution, fromGuy Harris1-12/+23
Joerg Meyer. Support for saving to the preferences file the settings for all types of name resolution. Do a case-insensitive check for "true" and "false" in Boolean preference settings. svn path=/trunk/; revision=3489