aboutsummaryrefslogtreecommitdiffstats
path: root/tethereal.c
AgeCommit message (Collapse)AuthorFilesLines
2000-11-01Instead of failing if we can't find a netmask for the interface on whichGuy Harris1-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
2000-10-31Get rid of a statement that should've been deleted when we started usingGuy Harris1-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
2000-10-16Give libethereal its own configuration file, and have that configurationGuy Harris1-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
2000-10-08Change addresses from ethereal.zing.org to www.ethereal.com.Gerald Combs1-2/+2
svn path=/trunk/; revision=2481
2000-10-06Implement epan_dissect_new() and epan_dissect_free(). These are theGilbert Ramirez1-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
2000-09-27First step in moving core Ethereal routines to libepan.Gilbert Ramirez1-8/+11
svn path=/trunk/; revision=2458
2000-09-20Give Tethereal a "-l" flag, as tcpdump has, to make the standard outputGuy Harris1-4/+7
line-buffered. svn path=/trunk/; revision=2451
2000-09-15Add a "-p" command-line option, and a checkbox in the "CaptureGuy Harris1-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
2000-09-10Compute and display negative relative and delta time stamps correctly,Guy Harris1-18/+14
just in case time goes backwards (yes, it sometimes does happen in captures). svn path=/trunk/; revision=2407
2000-08-23Remove the -D option.Laurent Deniel1-6/+3
svn path=/trunk/; revision=2349
2000-08-22Initialize all the fields of the "frame_data" structure, so that, forGuy Harris1-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
2000-08-19Fix potential buffer overflows.Laurent Deniel1-3/+4
svn path=/trunk/; revision=2298
2000-08-14PPP/WAN captures work on Windows 9x, so speak of them not working onlyGuy Harris1-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
2000-08-13On Win32, if the attempt to open the capture device fails, don't talkGuy Harris1-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
2000-08-11Miscellaneous code cleaningLaurent Deniel1-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
2000-08-03Add a "Save As" feature to the TCP Follow dialogue, to save the streamGilbert Ramirez1-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
2000-07-24Correct packet count displayed while capturing with -w option. (there wasGilbert Ramirez1-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
2000-07-20In Tethereal:Guy Harris1-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
2000-07-09Turn the code of "colorize_packet()" into a static routine that is givenGuy Harris1-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
2000-07-05Add support for a global "ethereal.conf" preferences file, stored in theGuy Harris1-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
2000-07-05Set the locale for Tethereal to the native environment; Ethereal alreadyGuy Harris1-1/+5
does so, as a side-effect of calling "gtk_set_locale()". svn path=/trunk/; revision=2111
2000-07-03Remove the progress bar from the status line, and, instead, for anyGuy Harris1-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
2000-06-27Patch from Ben Fowler to rename the global variable "cf" to "cfile", toGuy Harris1-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
2000-06-15Patch from Joerg Mayer:Guy Harris1-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
2000-05-19Add wtap-int.h. Move definitions relevant to the internal workins of wiretapGilbert Ramirez1-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
2000-05-18Remove the "union pseudo_header" from the "frame_data" structure;Guy Harris1-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
2000-05-18Have "proto_tree_is_visible" false except when we're in the middle ofGuy Harris1-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
2000-04-14Change dfilter_apply() to 4-argument function. 4th argument is not yet used,Gilbert Ramirez1-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
2000-04-13Consolidate flags in struct frame_data, and add "visited" flag. UseGilbert Ramirez1-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
2000-04-04Turn "ethereal_proto_init()" and "ethereal_proto_cleanup()" intoGuy Harris1-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
2000-04-04Use the new split between protocol registration and protocol handoffGuy Harris1-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
2000-04-03Move the creation of, and registration of protocols known to UDP in, theGuy Harris1-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
2000-03-28Add getopt.c (from GNU libc) for use on Win32.Gilbert Ramirez1-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
2000-02-22In Tethereal, allow capture filters and read filters either to beGuy Harris1-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
2000-02-19Use WTAP_ERR_UNSUPPORTED_ENCAP for all attempts to open or read aGuy Harris1-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
2000-02-16Allow for non-"struct timeval" ts's in phdr just like we didGilbert Ramirez1-2/+3
in capture.c. Copy the members of the struct instead of the entire struct. svn path=/trunk/; revision=1640
2000-02-11Say "Tethereal", rather than "Ethereal", in messages from Tethereal.Guy Harris1-6/+6
svn path=/trunk/; revision=1617
2000-01-26Initialize per-dissection data structures before doing a capture, asGuy Harris1-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
2000-01-24Make the Tethereal usage message reflect whether libpcap support wasGuy Harris1-3/+8
compiled in or not. svn path=/trunk/; revision=1536
2000-01-24Keep the sample command line in the usage message within 80 characters.Guy Harris1-4/+5
svn path=/trunk/; revision=1534
2000-01-24Heikki Vatiainen's patch to add a flag to control whether to interpretGuy Harris1-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
2000-01-22Allow "-w" and/or "-R" to be specified either when doing a live captureGuy Harris1-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
2000-01-22Fix files that had Gilbert's old e-mail address or that didn't have myGuy Harris1-2/+2
forwarding e-mail address. svn path=/trunk/; revision=1522
2000-01-17Add a "-F" flag, to allow the format of a file being written to beGuy Harris1-16/+43
specified. This will be of more use when I allow "-w" to be used when reading an existing capture file rather than doing a live capture (which will also allow you to specify a read filter, and thus to write a capture file containing those packets from an existing capture file that match a given display filter). Fix up some messages to say "tethereal" rather than "ethereal". svn path=/trunk/; revision=1499
2000-01-17Add a "-x" flag to Tethereal, to make it print a hex and ASCII dump ofGuy Harris1-5/+19
the packet data. svn path=/trunk/; revision=1497
2000-01-16Move the routine to get a list of the network interfaces on the systemGuy Harris1-6/+18
to "util.c", and provide a routine to free that list as well. When picking an interface on which to do a capture (if no "-i" flag was specified), use that routine, and pick the first interface on the list. svn path=/trunk/; revision=1495
2000-01-15Add a call to init_plugins() in order to read the plugins.status file andOlivier Abad1-1/+5
enable plugins if their saved status is "active". svn path=/trunk/; revision=1487
2000-01-15Pass the number of packets to be captured to "capture()" as an argument,Guy Harris1-8/+9
rather than making it static. Don't print the "Capturing on <interface>" message until you actually start capturing, and print it regardless of whether the interface was explicitly specified or not (that's what snoop and tcpdump do). svn path=/trunk/; revision=1485
2000-01-15If no "-i" flag is specified to Tethereal when no file is to be read,,Guy Harris1-8/+24
or to Ethereal when the "-k" flag is specified, i.e. when a capture is to be started immediately, use "pcap_lookupdev()" to pick an interface, just as tcpdump does. svn path=/trunk/; revision=1482
2000-01-14better command line syntax descriptionNathan Neulinger1-4/+5
svn path=/trunk/; revision=1478