aboutsummaryrefslogtreecommitdiffstats
path: root/tethereal.c
AgeCommit message (Collapse)AuthorFilesLines
2006-02-10remove all calls to exit() from the capture_opts.c and replace them by ↵Ulf Lamping1-5/+9
status return values (0,1 or 2). This way makes it much easier to debug, e.g. to set a common breakpoint if a command line parameter fails. svn path=/trunk/; revision=17240
2006-02-07eXtenstion options access to the -X command line optionsLuis Ontanon1-3/+8
svn path=/trunk/; revision=17207
2006-02-06Move the code to relinquish set-UID and set-GID privileges to a routineGuy Harris1-15/+10
in epan/privileges.c. svn path=/trunk/; revision=17181
2006-02-06Add code to check whether the app was started with special privilegesGuy Harris1-0/+6
(e.g., set-UID or set-GID), and don't load user plugs if it is. svn path=/trunk/; revision=17174
2006-01-21add matched coloring rule name and string to the frame dissector output (or ↵Ulf Lamping1-0/+1
nothing if no coloring rule matched or none was set) svn path=/trunk/; revision=17068
2006-01-12minor changesUlf Lamping1-4/+4
svn path=/trunk/; revision=17012
2006-01-12fix usage output Ulf Lamping1-38/+83
fix -F command option handling (output list of available formats if missing of invalid) svn path=/trunk/; revision=17011
2006-01-07move output_to_pipe flag from tethereal's loop_data into capture_opts, so it ↵Ulf Lamping1-67/+26
can be used by dumpcap (capture_loop.c) as well svn path=/trunk/; revision=16972
2006-01-06code cleanup: use "-" for all places, where stdin/stdout is meantUlf Lamping1-10/+9
tethereal internally converted the stdout capture filename "-" into "" which doesn't make any real sense and only complicated things. To make things even more confusing, wiretap expected "" for dump output and "-" for offline reading ... svn path=/trunk/; revision=16962
2006-01-05Catch a combination of "-S" and "-w -" - you'll just getGuy Harris1-4/+13
non-human-readable and non-machine-readable garbage from that combination. Use an exit code of 1 for command-line argument syntax errors in some more cases. svn path=/trunk/; revision=16961
2006-01-04Set "ld.save_file" when we start capturing, so we can report captureGuy Harris1-21/+46
errors. Display output errors with either 'the file "XXX"' or 'the standard output". svn path=/trunk/; revision=16943
2006-01-04Distinguish between "writing to the standard output" and "writing to aGuy Harris1-17/+26
pipe"; there's not much point in writing to the standard output if you're *not* writing to a pipe, but.... "-b" doesn't necessarily imply a ring buffer - you can just request that Tethereal keep switching files forever. Standardize on an exit status of 1 for all those errors (there's a sort-of convention, adhered to by many apps, that an exit status of 1 means a command-line argument error (as in "illegal flag" or "you combined two flags that don't make sense together") and an exit status of 2 is for other "run-time" errors. svn path=/trunk/; revision=16942
2005-12-21Provide not only copyright information, but a GPL blurb, in all theGuy Harris1-7/+19
version/usage messages. Put newlines at the end of various version strings. svn path=/trunk/; revision=16870
2005-12-16some minor fixes: logging and comments fixedUlf Lamping1-0/+4
svn path=/trunk/; revision=16819
2005-12-14Constify a bunch of arguments and variables, to squelch compilerGuy Harris1-3/+3
warnings. Include "wiretap/libpcap.h" in "capture_loop.h", to get its declarations of data structures for headers in libpcap files. This lets us remove the includes of "wiretap/libpcap.h from files including "capture_loop.h". Make "log_func_ignore()" in "tethereal.c" static, and declare some of its arguments unused. Also get rid of an unused variable. Include <pcap.h> before including "wiretap/wtap-capture.h", to declare "struct pcap_pkthdr". svn path=/trunk/; revision=16791
2005-12-13HUGE STEP (hopefully toward the right direction):Ulf Lamping1-730/+188
remove a lot of redundant code from tethereal and use (move) stuff from capture_loop.c instead. concentrate common capture related code in capture_opts.c, e.g. trying to find the right interface to capture from (command line option, preference, first usable) instead of duplicating this code over several files. remove redundant code from dumpcap.c this also implements command line option -D (and indexed interfaces at -i) for Ethereal and Dumpcap (as we have it in Tethereal already for a while) svn path=/trunk/; revision=16787
2005-12-06rename pcap-....c/.h files to capture-pcap-....c/.hUlf Lamping1-1/+1
this way, the capture prefix will "logically" group the files together and file browsers will also group them we may want to move the files into a subdir capture later svn path=/trunk/; revision=16691
2005-12-05fixed a typoUlf Lamping1-1/+1
svn path=/trunk/; revision=16688
2005-12-05replace all appearances of 'fprintf(stderr, "tethereal: ' with ↵Ulf Lamping1-154/+117
'cmdarg_err("', this is: a) smaller b) makes it possible to use some functions for Ethereal too c) is the wrong name now, as some outputs are not command line related :-( use capture_opts_trim() svn path=/trunk/; revision=16685
2005-12-01fix alphabetical order of OPTINIT string, v seems to be a controversial ↵Ulf Lamping1-1/+1
character :-) svn path=/trunk/; revision=16642
2005-11-25rephrase the error dialog if an interface couldn't be opened.Ulf Lamping1-8/+12
made the CaptureSetup wiki page more prominent added some "headings" so some of the help subtopics are easier for "human grep" IMHO svn path=/trunk/; revision=16592
2005-11-18Add support for the "-B" flag to Tethereal on Windows.Guy Harris1-2/+36
svn path=/trunk/; revision=16542
2005-11-17Handle "-G" only in Tethereal - it doesn't work in Ethereal, and isn'tGuy Harris1-4/+63
necessary there. Add a "cmdarg_err()" routine to report command-line option errors; it creates a console if necessary, and prints the command name and the trailing newline. Also add "cmdarg_err_cont()", which also creates a console if necessary, and prints a trailing newline but no command name; it's used to continue the message. Use those, rather than "g_warning()", for errors. That means that we no longer need to pass the command name to various command-line argument parsing routines. svn path=/trunk/; revision=16526
2005-11-07Include <wiretap/file_util.h> to declare the eth_ routines.Guy Harris1-0/+1
svn path=/trunk/; revision=16407
2005-11-06replace *a lot* of file related calls by their GLib counterparts. This is ↵Ulf Lamping1-5/+5
necessary for the switch to GTK 2.6 (at least on WIN32). to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place. deleted related things from config.h.win32 As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon. svn path=/trunk/; revision=16403
2005-10-07fix Ethereal so command line capture parameter will work with kilobytes (again)Ulf Lamping1-1/+1
remove Byte(s) from the dropdown list of filesizes, this doesn't make sense replace 1000 with 1024, as all (modern?) file managers are based on 1024 bytes for a kilobyte (the old KB vs. KiB controversy) svn path=/trunk/; revision=16149
2005-10-06add missing #include "capture_errs.h"Ulf Lamping1-0/+1
svn path=/trunk/; revision=16137
2005-10-04Add a "capture_errs.c" routine to cough up error messages for captureGuy Harris1-1/+6
problems, and use the first routine in it in multiple places. Get rid of DISSECTOR_SUPPORT_INCLUDES - just add its contents to ETHEREAL_COMMON_INCLUDES. svn path=/trunk/; revision=16109
2005-10-04Add a note about 64-bit support in WinPcap to the capture errors onGuy Harris1-1/+12
Windows, and add the URL for the CaptureSetup page to the Tethereal error. svn path=/trunk/; revision=16103
2005-09-22Libpcap uses u_char; use it in our calls to libpcap routines and in ourGuy Harris1-6/+6
libpcap callback routine (if it's not getting defined, <pcap.h> doesn't work). svn path=/trunk/; revision=15952
2005-09-22Update to current reality (WinPcap 3.1) the messages shown on Windows ifGuy Harris1-7/+8
a capture device open fails. svn path=/trunk/; revision=15951
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