aboutsummaryrefslogtreecommitdiffstats
path: root/tethereal.c
AgeCommit message (Collapse)AuthorFilesLines
2005-09-14fix wtap_dump_flush function name and don't check for it's return value. We ↵Ulf Lamping1-4/+1
don't do this check in Ethereal either and we will recognize problems at next write anyway ... svn path=/trunk/; revision=15805
2005-09-14added compression support for capture file output. The Save/As dialog now ↵Ulf Lamping1-3/+3
has a checkbox "Compress with gzip" currently limited to Ethereal and all the variants of libpcap filetypes only. We might want to add output compression support to the other tools as well (tethereal, mergecap, ...). We might also want to add support for the other filetypes, but this is only possible if the filetype functions doesn't use special output operations like fseek. One bug is still left: if the input and output filetypes while saving are the same, Ethereal currently optimizes this by simply copy the binary file instead of using wiretap (so it will be faster but it will ignore the compress setting). Don't know a good workaround for this, as I don't know a way to find out if the input file is currently compressed or not. One idea might be to use a heuristic on the filesize (compared to the packet size summmary). Another workaround I see is to remove this optimization, which is of course not the way I like to do it ... svn path=/trunk/; revision=15804
2005-09-03Make usage messages fit within 80 characters.Guy Harris1-8/+9
svn path=/trunk/; revision=15676
2005-09-03As with Ethereal, so with Tethereal; we're not a GNU program, don't sayGuy Harris1-1/+1
we are. svn path=/trunk/; revision=15675
2005-08-31Fix a typo.Guy Harris1-1/+1
svn path=/trunk/; revision=15637
2005-08-27Set the time stamp precision; we need it when printing packet summaryGuy Harris1-34/+63
lines. Clean up indentation. svn path=/trunk/; revision=15569
2005-08-25timestamp display precision:Ulf Lamping1-5/+6
- automatic adjustment depending on file format - manual adjustment through menu items save the setting in the recent file svn path=/trunk/; revision=15534
2005-08-24EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry! Ulf Lamping1-24/+16
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ... What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere. As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon. Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way... As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number... svn path=/trunk/; revision=15520
2005-08-20Rename epan/stat.[ch] to epan/stat_cmd_args.[ch] - it only deals withGuy Harris1-1/+1
implementing the "-z" command-line arguments, it doesn't deal with *all* issues for stats. svn path=/trunk/; revision=15483
2005-08-20Get rid of f_len field in capture_file structure - we can just keepGuy Harris1-1/+0
the length locally. within cf_read(). svn path=/trunk/; revision=15454
2005-08-19Add APIs to Wiretap to return the file of the size as supplied by the OSGuy Harris1-1/+0
(so if the file's gzipped, it's *NOT* the size of the file after uncompressing), and an approximation of the amount of that data read sequentially so far. Use those for various progress bars and the like. Make the fstat() in the Ascend trace reader directly use wth->fd, as it's inside Wiretap; that gets rid of the last caller of wtap_fd() (as we're no longer directly using fstat() or lseek() in Ethereal), so get rid of wtap_fd(). svn path=/trunk/; revision=15437
2005-08-19Move the stats.[ch] stuff into epan, so plugins can use it.Guy Harris1-0/+1
svn path=/trunk/; revision=15429
2005-08-19Move the APIs for registering and processing "-z" command-line argumentsGuy Harris1-7/+7
and "Statistics" menu items into "stat.h" and "stat.c", to separate them from the core tapping APIs. A tap could conceivably not register as a "-z" command-line argument or "Statistics" menu item, and a stat could conceivably not be implemented as a tap, and dissectors that implement tapping points don't need the UI-related stuff from "stat.h", they just want the tap-related stuff in <epan/tap.h>. svn path=/trunk/; revision=15427
2005-08-19Have "f_datalen" keep track of the number of bytes of uncompressed fileGuy Harris1-0/+1
data, so that "f_len" still keeps the size of the underlying file (which is necessary in order to make the progress bar when files are being read work correctly). svn path=/trunk/; revision=15415
2005-08-16Move SVNVERSION handling into version_info. That way, we won't haveJörg Mayer1-13/+4
to recompile tethereal.o etc each time the svn version has changed, relinking is sufficient. I'm not sure what to do about mergecap, as it currently doesn't link against version_info, so it's "overhead" either way. svn path=/trunk/; revision=15371
2005-08-12Add beginning of seasonal allocation in addition to the existing ephemeral ↵Ronnie Sahlberg1-0/+1
ones. svn path=/trunk/; revision=15301
2005-08-08various code cleanup:Ulf Lamping1-29/+25
-use g_snprintf instead of sprintf and snprintf -use g_strdup_printf where appropriate -remove #include "snprintf.h" (as only g_snprintf should be used) -replace some more alloc/realloc/calloc/free with their glib pendants svn path=/trunk/; revision=15264
2005-08-06Squelch more const pointer warnings.Guy Harris1-2/+2
svn path=/trunk/; revision=15242
2005-07-24Constify to remove a bunch of warnings. Add some casts to squelchGuy Harris1-1/+2
(presumably-)harmless-but-otherwise-unremovable const-to-nonconst warnings. In the TACACS dissector, clean up the variables used in option parsing to avoid some const-to-nonconst warnings. Clean up some white space. svn path=/trunk/; revision=15043
2005-07-23More 'char*' -> 'const char*' changes to fix warnings.Jörg Mayer1-4/+4
svn path=/trunk/; revision=15015
2005-07-22EMEM : a simple and FAST api to allocate memory that will be automatically ↵Ronnie Sahlberg1-1/+4
freed() when the next packet is dissected. This offesr memory allocation with a packet scope making memory leaks less likely and memory management faster. Add initialization calls for both tethereal and ethereal. Convert the ip_to_str() function to use this and avoid doing the silly rotating buffers thing it previously did. We also need an equivalent set of functions for allocation with capture file scope (free when next capture is loaded) but i dont know where to put the free_all call. svn path=/trunk/; revision=14984
2005-06-04update usage output and manual pages for both Ethereal and Tethereal to ↵Ulf Lamping1-10/+10
reflect the latest changes in the command line. clarifications of some command line parameter descriptions in the manual pages this also fixes #221 svn path=/trunk/; revision=14545
2005-05-12Don't include <pcap.h> twice.Guy Harris1-7/+3
svn path=/trunk/; revision=14357
2005-05-05make tethereal compile when plugins are disabledRonnie Sahlberg1-0/+2
svn path=/trunk/; revision=14319
2005-04-01Rename "register_ethereal_tap()" to "register_tap_listener_cmd_arg()" asGuy Harris1-59/+12
it's used to register a callback for a tap listener invoked if the specified command line argument is specified to the "-z" flag. Move it, along with routines to: look up a "-z" argument in the table constructed by "register_tap_listener_cmd_arg()" and either save the full argument to "-z" and the corresponding listener if it's found or return a failure indication if it isn't; list the available tap listeners; call the "init" routines for the tap listeners saved in the table above; and have Ethereal and Tethereal use those routines. svn path=/trunk/; revision=13993
2005-04-01Don't assume only one "-z" argument will be given on the command line;Guy Harris1-13/+26
add information for each tap to a list, and set up all the taps in the list. svn path=/trunk/; revision=13991
2005-03-23If we have "pcap_freecode()", use it to free the instructions for a BPFGuy Harris1-0/+6
filter after installing the filter. Set HAVE_PCAP_LIB_VERSION if we're building with WinPcap 3.1; it's not present in earlier versions, but is present in current 3.1 betas. Check HAVE_PCAP_LIB_VERSION when building capture-wpcap.c. svn path=/trunk/; revision=13872
2005-03-07- pcap.h needs to be included before capture.hJörg Mayer1-3/+2
- As capture.h is empty without libpcap defined, only include it in that case and don't protect the file internally against libpcap any more. svn path=/trunk/; revision=13648
2005-03-01If -z was not given as the very last argument the tap listener ↵Luis Ontanon1-4/+6
initialization might have crashed. Copy the optarg so that when the tap initialization is called it gets the right argument. svn path=/trunk/; revision=13570
2005-02-28Make sure that plugin tap listeners get registered before the non-plugin tap ↵Luis Ontanon1-1/+5
listeners that's because stat trees are registered as tap listeners by either gtk/stats_tree_stat.c or tap-stats_tree.c svn path=/trunk/; revision=13545
2005-02-27The stats tree stuff should ultimately allow us to have plugin taps, soGuy Harris1-0/+1
add infrastructure for them, and display the plugin type (which could be both dissector *and* tap) in the list of plugins. svn path=/trunk/; revision=13543
2005-02-23in tetherealLuis Ontanon1-1/+1
list_link_layer_types was not being initialized causing the "-r" option to fail svn path=/trunk/; revision=13480
2005-02-23use the applications name (currently "ethereal" or "tethereal") in ↵Ulf Lamping1-44/+2
capture_opts, instead of hardcoded "ethereal" for both. svn path=/trunk/; revision=13476
2005-02-23move capture_opts related things (init, command line, ...) from capture.c to ↵Ulf Lamping1-236/+38
a new file capture_opts.c and let both ethereal and tethereal use it. svn path=/trunk/; revision=13474
2005-02-22Do not call the tap's initialization as soon as the -z option is read,Luis Ontanon1-3/+14
postpone it after the preferences callback has being called. That way mate's fields, which are registered by the preferences callback can be used as part of the tap's filter. svn path=/trunk/; revision=13469
2005-02-13change nmake makefiles in /trunk and /trunk/epan so thatLars Roland1-4/+0
object code for libethereal.dll isn't generated by the makefile in /trunk. Having no code in /trunk linked into libethereal.dll anymore, the definition of the macro _NEED_VAR_IMPORT_ can be moved from various source files in /trunk to /trunk/Makefile.nmake . So do that, too. svn path=/trunk/; revision=13389
2005-02-07Fix up the suppression of packet printing and packet count printing soGuy Harris1-13/+22
that: packets are printed iff we're not saving packets to a file and "-q" wasn't specified; packet counts are printed iff we're capturing (i.e., not reading from a file) and "-q" wasn't specified. svn path=/trunk/; revision=13348
2005-02-07Make Ethereal and Tethereal compile if we're building without libpcap.Guy Harris1-1/+4
svn path=/trunk/; revision=13346
2005-02-07Suppress the packet counts when we're reading from a file.Guy Harris1-0/+1
svn path=/trunk/; revision=13342
2005-02-07Tethereal can write to a file in binary even if not built with libpcap.Guy Harris1-40/+41
svn path=/trunk/; revision=13341
2005-02-07Clean up indentation.Guy Harris1-39/+37
The default for "capture_options.save_file" is a null pointer, meaning we're not writing to a save file, we're writing out the dissection as text. svn path=/trunk/; revision=13340
2005-02-06"iface" is now a member of "capture_opts", not "cfile".Guy Harris1-1/+2
svn path=/trunk/; revision=13326
2005-02-06another two steps towards privilege seperation:Ulf Lamping1-20/+28
move another two capture related fields (iface and cfilter) from cfile to capture_opts also move the handling of capture related command line options from main.c to capture.c, that way a future privilege seperated capture program can use the same code to parse it's command line than Ethereal. It might be even possible to share this parser code even with Tethereal, didn't took a closer look at this. svn path=/trunk/; revision=13320
2005-02-05Put "cf_status_t" back.Guy Harris1-3/+3
svn path=/trunk/; revision=13303
2005-02-05Make "cf_open()" match the prototype in "file.h".Guy Harris1-1/+1
svn path=/trunk/; revision=13302
2005-02-04Instead of having a single enumerated type for status return values fromGuy Harris1-3/+3
cf_ functions, have separate ones for different classes of routines, and use gboolean when the return value is just "success" or "failure" - that way you don't get compiler warnings if a case statement isn't handling a particular status value if the routine in question won't return it. svn path=/trunk/; revision=13293
2005-02-04huge cleanup of capture file API (functions in file.c/file.h).Ulf Lamping1-9/+7
This includes: all functions in file.h now have a cf_ prefix, will have doxygen tags, will have the capture_file *cf as the first parameter and I tried to generalize the return values for non trivial functions. Hopefully, I didn't introduced any new bugs, as I had to change a lot of files... svn path=/trunk/; revision=13289
2005-02-04(some) redesign of capture data structures.Ulf Lamping1-74/+79
don't use global cfile at all but only an untpyed handle to call the cf_... functions in file.c move the save_file member from capture_file to capture_opts, as it's only used while capturing and while preparing it svn path=/trunk/; revision=13276
2005-02-03move capture_file_fd field from capture_file to capture_opts type, as this ↵Ulf Lamping1-4/+6
is the place where it should be svn path=/trunk/; revision=13268
2005-02-03prevent ringbuffer from having to know about capture_file type at all ↵Ulf Lamping1-3/+3
(decoupling dependencies) svn path=/trunk/; revision=13266