aboutsummaryrefslogtreecommitdiffstats
path: root/tethereal.c
Commit message (Collapse)AuthorAgeFilesLines
* Pull the code to set the fields in the "cfile.cinfo" structure into aGuy Harris2000-12-031-8/+2
| | | | | | | common routine to initialize a "column_info()" structure, shared by Ethereal and Tethereal. svn path=/trunk/; revision=2739
* Tethereal includes no GUI stuff, so it doesn't need to includeGuy Harris2000-11-211-2/+1
| | | | | | "ui_util.h". svn path=/trunk/; revision=2691
* Initialize winsock as we do in Ethereal.Gilbert Ramirez2000-11-201-1/+11
| | | | svn path=/trunk/; revision=2680
* For each column, have both a buffer into which strings for that columnGuy Harris2000-11-191-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | can be put, and a pointer to the string for the column, which might or might not point to that buffer. Add a routine "col_set_str()", which sets the string for the column to the string passed to it as an argument; it should only be handed a static string (a string constant would be ideal). It doesn't do any copying, so it's faster than "col_add_str()". Make the routines that append to columns check whether the pointer to the string for the column points to the buffer for the column and, if not, copy the string for the column to the buffer for the column so that you can append to it (so you can use "col_set_str()" and then use "col_append_str()" or "col_append_fstr()"). Convert a bunch of "col_add_str()" calls that take a string constant as an argument to "col_set_str()" calls. Convert some "col_add_fstr()" calls that take a string constant as the only argument - i.e., the format string doesn't have any "%" slots into which to put strings for subsequent arguments to "col_set_str()" calls (those calls are just like "col_add_str()" calls). Replace an END_OF_FRAME reference in a tvbuffified dissector with a "tvb_length(tvb)" call. svn path=/trunk/; revision=2670
* Move a "putchar('\n')" that caused an extra newline to be printed afterGuy Harris2000-11-091-2/+2
| | | | | | the protocol tree was printed. svn path=/trunk/; revision=2586
* In Tethereal, when printing summary lines, print the fields specified inGuy Harris2000-11-061-32/+182
| | | | | | | the preferences file, don't just print a wired-in list of fields. Always print the time stamp. svn path=/trunk/; revision=2573
* Add a fourth choice of time format in the packet list display, whichGuy Harris2000-11-011-2/+4
| | | | | | | shows the date (in YYYY-MM-DD format) as well as the time of day when the packet arrived. svn path=/trunk/; revision=2547
* Instead of failing if we can't find a netmask for the interface on whichGuy Harris2000-11-011-4/+9
| | | | | | | | | | we're capturing, just use a netmask of 0, and warn the user in Tethereal (doing it in Ethereal would be more disruptive, and doing so only once per interface in a session is a bit of work, as, in an "Update list of packets in real time" capture the child process would have to tell the parent that it couldn't get the netmask). svn path=/trunk/; revision=2546
* Get rid of a statement that should've been deleted when we started usingGuy Harris2000-10-311-2/+1
| | | | | | | | "compute_timestamp_diff()" to compute the difference betwen time stamps but that wasn't deleted, causing the time difference between a frame and the previous frame to be computed incorrectly in Tethereal. svn path=/trunk/; revision=2543
* Give libethereal its own configuration file, and have that configurationGuy Harris2000-10-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | file, rather than the top-level Ethereal configuration file, check for "inet_aton()", "inet_pton()", and "inet_ntop()". Then make its Makefile.am include the appropriate object files if necessary. Otherwise, they don't get built and put into libethereal, and therefore attempts to link with anything in libethereal that uses them fail on platforms that lack ethem, causing the build to fail. That means a bunch of things need to be fixed to cope with libethereal having its own "config.h" file; this means removing the include of "config.h" from some libethereal header files. Move the definitions of the path names used only by "resolv.c" to "resolv.c" from "resolv.h" (so "resolv.h" doesn't need "config.h", define HAVE_PLUGINS in the configure script (so we don't have to include it in "plugins.h" to check whether HAVE_DLFCN_H is defined). Unfortunately, stuff outside libethereal needs to know PLUGIN_DIR; for now, define that in the top-level configuration file, and have Ethereal and Tethereal pass it as an argument to "epan_init()" - that should be cleaned up at some point. Remove from the top-level configure script checks for things used only in libethereal. svn path=/trunk/; revision=2498
* Change addresses from ethereal.zing.org to www.ethereal.com.Gerald Combs2000-10-081-2/+2
| | | | svn path=/trunk/; revision=2481
* Implement epan_dissect_new() and epan_dissect_free(). These are theGilbert Ramirez2000-10-061-3/+10
| | | | | | | | | | | | | | | | | | | "top-level" dissectors that libepan-users call, instead of dissect_packet(). The epan_dissect_t holds the tvbuff after dissection so that the tvbuff's memory is not cleared until after the proto_tree is freed. (I might stuff the proto_tree into the epan_dissect_t, too). What remains of dissect_packet() in packet.c handles the tvbuff initialiation. The real meat of dissect_packet() is now in dissect_frame(), in packet-frame.c This means that "packet.c" is no longer a dissector, os it is no longer passed to make-reg-dotc. Once dissect_fddi() gets two wrapper functions (dissect_fddi_swapped() and dissect_fddi_nonswapped()), the a dissector handoff routine could be used instead of the switch statement in dissect_frame(). I'd register a field like "wtap.encap" svn path=/trunk/; revision=2478
* First step in moving core Ethereal routines to libepan.Gilbert Ramirez2000-09-271-8/+11
| | | | svn path=/trunk/; revision=2458
* Give Tethereal a "-l" flag, as tcpdump has, to make the standard outputGuy Harris2000-09-201-4/+7
| | | | | | line-buffered. svn path=/trunk/; revision=2451
* Add a "-p" command-line option, and a checkbox in the "CaptureGuy Harris2000-09-151-4/+13
| | | | | | | Preferences" dialog box, to control whether to put the interface in promiscuous mode or not; Debian bug #34376 asked for this. svn path=/trunk/; revision=2439
* Compute and display negative relative and delta time stamps correctly,Guy Harris2000-09-101-18/+14
| | | | | | | just in case time goes backwards (yes, it sometimes does happen in captures). svn path=/trunk/; revision=2407
* Remove the -D option.Laurent Deniel2000-08-231-6/+3
| | | | svn path=/trunk/; revision=2349
* Initialize all the fields of the "frame_data" structure, so that, forGuy Harris2000-08-221-6/+8
| | | | | | | | example, "fdata->pfd" doesn't contain junk that upsets dissectors that try to attach data to the frame (not that it does them much good in Tethereal, as the frame is never revisited). svn path=/trunk/; revision=2331
* Fix potential buffer overflows.Laurent Deniel2000-08-191-3/+4
| | | | svn path=/trunk/; revision=2298
* PPP/WAN captures work on Windows 9x, so speak of them not working onlyGuy Harris2000-08-141-8/+9
| | | | | | | | | on NT/2000. Refer to Tethereal, not to Ethereal, in the long explanations of capture problems in Tethereal. svn path=/trunk/; revision=2270
* On Win32, if the attempt to open the capture device fails, don't talkGuy Harris2000-08-131-7/+43
| | | | | | | | | | | | | | | | about checking permissions, as the capture devices are probably available to all users, and talking about permissions will only confuse the user. Do, however, warn that Ethereal can't capture on Token Ring or PPP/WAN interfaces. On UNIX, if the attempt to open the capture device fails, and the error message starts with "can't find PPA for ", they are probably running on HP-UX with a version of libpcap not patched to properly look up PPAs for network interfaces given the interface name; give them a detailed warning about this, telling them that they'll have to fix libpcap and build Ethereal from source, and pointing them at the "README.hpux" file. svn path=/trunk/; revision=2265
* Miscellaneous code cleaningLaurent Deniel2000-08-111-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add <stdarg.h> or <varargs.h> in snprintf.h and remove those inclusions in the other #ifdef NEED_SNPRINTF_H codes - remove the check of multiple inclusions in source (.c) code (there is a bit loss of _cpp_ performance, but I prefer the gain of code reading and maintenance; and nowadays, disk caches and VM are correctly optimized ;-). - protect all (well almost) header files against multiple inclusions - add header (i.e. GPL license) in some include files - reorganize a bit the way header files are included: First: #include <system_include_files> #include <external_package_include_files (e.g. gtk, glib etc.)> Then #include "ethereal_include_files" with the correct HAVE_XXX or NEED_XXX protections. - add some HAVE_XXX checks before including some system header files - add the same HAVE_XXX in wiretap as in ethereal Please forgive me, if I break something (I've only compiled and regression tested on Linux). svn path=/trunk/; revision=2254
* Add a "Save As" feature to the TCP Follow dialogue, to save the streamGilbert Ramirez2000-08-031-2/+1
| | | | | | | | | | | file to a user-specified file. Move the file-copy routine in save_cap_file() to an indepenent function in file.c (copy_binary_file()) so that follow_dlg.c can use it. Remove #include "follow.h" from the C files that don't need it. svn path=/trunk/; revision=2200
* Correct packet count displayed while capturing with -w option. (there wasGilbert Ramirez2000-07-241-2/+6
| | | | | | | | | an extra increment of cfile.count). Print a newline to stdout at the end of a capture with "-w" so that the final packet count isn't obliterated by the shell prompt. svn path=/trunk/; revision=2156
* In Tethereal:Guy Harris2000-07-201-37/+9
| | | | | | | | | | | | | | | | | | | | | | | | When capturing, report errors trying to create the output file with "file_open_error_message()". Make the "for_writing" argument to "file_open_error_message()" a "gboolean", as it's either TRUE (if the file is being opened for writing) or FALSE (if it's being opened for reading). Report EISDIR as "XXX is a directory (folder), not a file.". When checking whether an "open()" of a capture file succeeded, check whether "open()" returns a negative number, not whether it returns 0. In "wtap_open_offline()", if the file to be opened is a directory, return EISDIR, not WTAP_ERR_NOT_REGULAR_FILE, so that the error message can say "that's a directory, not a file". If "wtap_open_offline()" returns WTAP_ERR_NOT_REGULAR_FILE, don't just say the file is "invalid", say it's a "special file" or socket or some other weird type of file. svn path=/trunk/; revision=2144
* Turn the code of "colorize_packet()" into a static routine that is givenGuy Harris2000-07-091-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a word to use in the progress dialog, and a flag indicating whether the display filter is to be reevaluated or not, and: have "colorize_packet()" call that routine with "Colorizing" and FALSE as those arguments; have the filtering code call that routine with "Filtering" and TRUE as those arguments; add an exported routine to call that routine with "Reprocessing" and TRUE as those arguments, to use to re-generate the packet list and to re-filter the packets if a protocol preference has been changed. Keep track of whether preferences are changed from their initial value by a preferences file or a command-line option, or from their previous value by the "Preferences" dialog box; have "prefs_apply_all()" only call the "apply" callback for a module if they have. Call "prefs_apply_all()" after the command-line arguments have been parsed and after "OK" has been clicked in the "Preferences" dialog box, to notify modules of preference changes if they've registered a callback for that. After "OK" has been clicked in the "Preferences" dialog box, if any preferences have changed, call the reprocessing routine, as the summary line for some frames and/or the current display filter's value when applied to some frames may have changed as a result of a preference change. Do the same after "OK" or "Apply" has been clicked in the "Display Options" dialog box (as it controls a protocol preferences item. svn path=/trunk/; revision=2126
* Add support for a global "ethereal.conf" preferences file, stored in theGuy Harris2000-07-051-15/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | same directory as the "manuf" file ("/etc" or "/usr/local/etc", most likely). Add a mechanism to allow modules (e.g., dissectors) to register preference values, which: can be put into the global or the user's preference file; can be set from the command line, with arguments to the "-o" flag; can be set from tabs in the "Preferences" dialog box. Use that mechanism to register the "Decode IPv4 TOS field as DiffServ field" variable for IP as a preference. Stuff that still needs to be done: documenting the API for registering preferences; documenting the "-o" values in the man page (probably needs a flag similar to "-G", and a Perl script to turn the output into documentation as is done with the list of field); handling error checking for numeric values (range checking, making sure that if the user changes the variable from the GUI they change it to a valid numeric value); using the callbacks to, for example, update the display when preferences are changed (could be expensive); panic if the user specifies a numeric value with a base other than 10, 8, or 16. We may also want to clean up the existing wired-in preferences not to take effect the instant you tweak the widget, and to add an "Apply" button to the "Preferences" dialog. svn path=/trunk/; revision=2117
* Set the locale for Tethereal to the native environment; Ethereal alreadyGuy Harris2000-07-051-1/+5
| | | | | | does so, as a side-effect of calling "gtk_set_locale()". svn path=/trunk/; revision=2111
* Remove the progress bar from the status line, and, instead, for anyGuy Harris2000-07-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | potentially long-running operation that has a progress indicator, pop up a modal dialog box with an indication of what is being done; a progress bar; a "Cancel" button to stop the operation. This: leaves more room on the status line for a filter expression; provides a mechanism to allow the user to cancel long-running operations (although the way we do so may not back out of them as nicely as the user might like, if it's not obvious what the "right" way is or if the "right" way is difficult to implement or involves doing as much work as letting the operation continue); means that, because the dialog box is modal, we don't have to worry about the user performing arbitrary UI operations out from under the operation and changing arbitrary bits of state being used by that operation. svn path=/trunk/; revision=2103
* Patch from Ben Fowler to rename the global variable "cf" to "cfile", toGuy Harris2000-06-271-60/+60
| | | | | | | | make it easier to use grep to find all references to it without getting a lot of false hits and to check, after allocating the memory chunk for "frame_data" structures, that the allocation succeeded. svn path=/trunk/; revision=2092
* Patch from Joerg Mayer:Guy Harris2000-06-151-5/+5
| | | | | | | Make "tethereal -h" look as similar to "ethereal -h" as possible. The ethereal help was the "better" of the two. svn path=/trunk/; revision=2073
* Add wtap-int.h. Move definitions relevant to the internal workins of wiretapGilbert Ramirez2000-05-191-6/+6
| | | | | | | | | to that file, leave public definitions in wtap.h. Rename "union pseudo_header" to "union wtap_pseudo_header". Make the wtap_pseudo_header pointer available in packet_info struct. svn path=/trunk/; revision=1989
* Remove the "union pseudo_header" from the "frame_data" structure;Guy Harris2000-05-181-17/+15
| | | | | | | | | | | | | | | | | | | | there's no need to keep it around in memory - when the frame data is read in when handing a frame, read in the information, if any, necessary to reconstruct the frame header, and reconstruct it. This saves some memory. This requires that the seek-and-read function be implemented inside Wiretap, and that the Wiretap handle remain open even after we've finished reading the file sequentially. This also points out that we can't really do X.25-over-Ethernet correctly, as we don't know where the direction (DTE->DCE or DCE->DTE) flag is stored; it's not clear how the Ethernet type 0x0805 for X.25 Layer 3 is supposed to be handled in any case. We eliminate X.25-over-Ethernet support (until we find out what we're supposed to do). svn path=/trunk/; revision=1975
* Have "proto_tree_is_visible" false except when we're in the middle ofGuy Harris2000-05-181-1/+7
| | | | | | | | | | | | | | | | | | | | | doing something that requires that the text for protocol tree entries be generated, i.e. 1) initialize it to FALSE; 2) have every routine that sets it clear it when it's done; 3) when printing packets, set it to TRUE only if we're not just printing packet summary lines; and then get rid of settings to FALSE made unnecessary as a result of those changes. This makes sure it's not set when it doesn't have to be (which causes the protocol tree code to format the text when it doesn't have to, wasting CPU time). svn path=/trunk/; revision=1973
* Change dfilter_apply() to 4-argument function. 4th argument is not yet used,Gilbert Ramirez2000-04-141-3/+3
| | | | | | | | | | but will be in the future, and it's easier for me to keep my local branch in sync with the source with the calls to dfilter_apply() already modified tothe 4-arg format. Add a CPP macro to ipv4.h to define ipv4_addr_ne(). Use it in dfilter.c svn path=/trunk/; revision=1854
* Consolidate flags in struct frame_data, and add "visited" flag. UseGilbert Ramirez2000-04-131-3/+4
| | | | | | | | | it in SOCKS dissector. (Okay, how many times am I going to modify packet.h today, forcing you to re-compile everything? :-) svn path=/trunk/; revision=1850
* Turn "ethereal_proto_init()" and "ethereal_proto_cleanup()" intoGuy Harris2000-04-041-23/+7
| | | | | | | | | "dissect_init()" and "dissect_cleanup()", in "packet.c", so that we don't duplicate those routines in Ethereal and Tethereal (and so on), and don't have to remember to update N different versions of them if we have to change the way we do one-time initialization and cleanup. svn path=/trunk/; revision=1790
* Use the new split between protocol registration and protocol handoffGuy Harris2000-04-041-2/+1
| | | | | | | | | | | | | | | | registration routines to get rid of the special handling of ONC RPC protocols - dissectors for ONC RPC-based protocols should register their protocol, fields, and ETT values in a protocol registration routine, and register themselves with the ONC RPC dissector in their protocol handoff routine, so that the latter is done after the ONC RPC dissector's protocol registration routine is called, so that the data structures needed when dissectors for ONC RPC protocols register themselves with the ONC RPC dissector have been initialized. Get rid of "init_dissect_rpc()", which initializes said data structures; do that in "proto_register_rpc()" instead. svn path=/trunk/; revision=1789
* Move the creation of, and registration of protocols known to UDP in, theGuy Harris2000-04-031-2/+1
| | | | | | | | hash table attached to "udp.port" out of "init_dissect_udp()" into "proto_register_udp()", so that it's done the way TCP does it, and then get rid of "init_dissect_udp()". svn path=/trunk/; revision=1781
* Add getopt.c (from GNU libc) for use on Win32.Gilbert Ramirez2000-03-281-1/+11
| | | | | | | | Ethereal/win32 now supports command-line options. Tethereal now compiles on win32, except for the fact that I haven't put the Makefile.nmake changes in for that yet. svn path=/trunk/; revision=1758
* In Tethereal, allow capture filters and read filters either to beGuy Harris2000-02-221-1/+29
| | | | | | | specifies with "-f" and "-R" flags, respectively, or specified with non-flag command-line arguments, as tcpdump and snoop allow. svn path=/trunk/; revision=1663
* Use WTAP_ERR_UNSUPPORTED_ENCAP for all attempts to open or read aGuy Harris2000-02-191-3/+10
| | | | | | | | capture file for an unsupported link-layer encapsulation type (as the nettl reader does), and report it correctly if it occurs on an open or read attempt rather than a save attempt. svn path=/trunk/; revision=1647
* Allow for non-"struct timeval" ts's in phdr just like we didGilbert Ramirez2000-02-161-2/+3
| | | | | | in capture.c. Copy the members of the struct instead of the entire struct. svn path=/trunk/; revision=1640
* Say "Tethereal", rather than "Ethereal", in messages from Tethereal.Guy Harris2000-02-111-6/+6
| | | | svn path=/trunk/; revision=1617
* Initialize per-dissection data structures before doing a capture, asGuy Harris2000-01-261-1/+7
| | | | | | | well as before reading a capture file - if the user didn't specify that the capture should be saved to a file, it'll be dissected as it arrives. svn path=/trunk/; revision=1568
* Make the Tethereal usage message reflect whether libpcap support wasGuy Harris2000-01-241-3/+8
| | | | | | compiled in or not. svn path=/trunk/; revision=1536
* Keep the sample command line in the usage message within 80 characters.Guy Harris2000-01-241-4/+5
| | | | svn path=/trunk/; revision=1534
* Heikki Vatiainen's patch to add a flag to control whether to interpretGuy Harris2000-01-241-4/+7
| | | | | | | | the IPv4 TOS field as a TOS field or as a DiffServ field, and allow that field to be controlled by a command-line option or an option in the "Display:Options" dialog box. svn path=/trunk/; revision=1532
* Allow "-w" and/or "-R" to be specified either when doing a live captureGuy Harris2000-01-221-80/+181
| | | | | | | | | | or when reading a saved capture file; if "-w" is specified, the packets captured or read from the file are written to the specified file rather than being dissected and printed, and if "-R" is specified, only packets that pass the specified read filter are dissected and printed or written. svn path=/trunk/; revision=1523
* Fix files that had Gilbert's old e-mail address or that didn't have myGuy Harris2000-01-221-2/+2
| | | | | | forwarding e-mail address. svn path=/trunk/; revision=1522