aboutsummaryrefslogtreecommitdiffstats
path: root/tethereal.c
AgeCommit message (Collapse)AuthorFilesLines
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2006-04-29Have the ring buffer routines take a pointer to a "bytes written" countGuy Harris1-2/+5
as an argument, rather than keeping the count to themselves, so the count kept by the capturing program can be updated correctly - including getting reset when files are switched. Fixes bug 895. svn path=/trunk/; revision=18032
2006-04-03Put the low-level sync routines into a common file so they can be sharedGuy Harris1-20/+20
by dumpcap and Ethereal (so that, on UN*X, the child process can report a detailed "can't exec dumpcap" error). Rename most of the "sync_pipe_XXX_to_parent()" routines, as they're also in Tethereal, which doesn't have a sync pipe. svn path=/trunk/; revision=17789
2006-04-03In Tethereal, don't save to a temporary file if "-w" isn't specified,Guy Harris1-26/+28
even if doing a live capture; just print the packets without saving them. In dumpcap: default to the capturing the entire packet; don't do the "Press any key" stuff when debugging on UN*X; do console logging (to the standard error) even when we're running as the capture child (the sync pipe should only be the standard output, not the standard error). svn path=/trunk/; revision=17786
2006-03-24Various code cleanup in the capture pipe stuffUlf Lamping1-1/+3
svn path=/trunk/; revision=17714
2006-03-21Simplify the argument list to cap_pipe_dispatch().Guy Harris1-3/+2
svn path=/trunk/; revision=17690
2006-03-05In the capture_loop.c code, open the capture device for input beforeGuy Harris1-6/+6
doing anything with the output file, so that 1) if the attempt to open the capture device fails, we don't bother creating any output files; 2) we could relinquish privileges permanently as soon as we finish opening the capture device, so we don't have to give them up temporarily when opening the output file, reclaim them to open the input device, and then give them up permanently; (we already do that in Tethereal). While we're at it, set the capture filter immediately after opening the capture device, so we quit before opening capture devices if that fails. svn path=/trunk/; revision=17468
2006-03-05Pass two strings in capture child messages, so the child can sendGuy Harris1-52/+74
primary and secondary error messages and let the parent worry about how to display them. This means dumpcap doesn't need stub routines for generating the formatting tags for the primary and secondary messages. Have a separate message for capture filter errors, so that the parent can check whether the capture filter looks like a display filter and report the appropriate message. This means that dumpcap doesn't need a stub routine for compiling display filters (a stub routine also means that Ethereal won't do the check for capture filters that look like display filters!). svn path=/trunk/; revision=17465
2006-03-04When capturing, we only support writing to libpcap files. Given that,Guy Harris1-62/+84
bypass Wiretap; that means we don't have to run the packet through wtap_process_pcap_packet() and then undo that conversion in Wiretap if we're just going to write it out, shortening the code path. svn path=/trunk/; revision=17461
2006-03-03Clean up white space.Guy Harris1-149/+151
Don't warn about a live capture format other than libpcap format if you're not capturing to a file. Do warn about a maximum capture file specification if you're not capturing to a file. svn path=/trunk/; revision=17456
2006-03-01Reject attempts to use packet capture options when we're reading a savedGuy Harris1-32/+78
capture file. We don't support saving live captures in any format other than libpcap format (and probably don't want to - we really want to avoid using Wiretap in that case, as it requires us to Wiretapify captured packets, which adds extra processing to the capture path); reject attempts to do that. svn path=/trunk/; revision=17436
2006-02-24finish adding the tethereal's funnel.Luis Ontanon1-0/+4
svn path=/trunk/; revision=17397
2006-02-17remove dependencies to pcap.h, so getting an idea what needs to be done by ↵Ulf Lamping1-0/+17
dumpcap in addition to the things already done now various dumpcap related code cleanup: mainly #include's and capture engine related stuff svn path=/trunk/; revision=17327
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