aboutsummaryrefslogtreecommitdiffstats
path: root/capture.h
AgeCommit message (Collapse)AuthorFilesLines
2005-12-03split capture.h into capture.h, capture_loop.h and capture_opts.h and place ↵ulfl1-117/+1
the parts into the corresponding files git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16664 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-03add missing functions (to complete/cleanup of interface):ulfl1-0/+10
capture_input_drops capture_input_error_message and move the functionality from capture_sync.c to capture.c (just where it belongs) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16663 f5534014-38df-0310-8fa8-9805f1628bb7
2005-11-17Handle "-G" only in Tethereal - it doesn't work in Ethereal, and isn'tguy1-1/+1
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16526 f5534014-38df-0310-8fa8-9805f1628bb7
2005-05-26use the log features of the GLib to have verbose output of the capturing ↵ulfl1-0/+6
engine, e.g. GLib provides different domains for different submodules. Output more verbose than warning level will be disabled by default (just like before). use the console_log_handler in main.c for win32 AND unix now Currently use the log for the capturing engine (only), as I desperately needed a log output for debugging. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14438 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-27add a state member to the capture_opts, and set it according to the capture ↵ulfl1-0/+10
engine git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14205 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-16rename capture_clear() to capture_restart()ulfl1-2/+2
statusbar update should work now even in capture error case git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14105 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-12capture engine: ulfl1-2/+6
add a new feature to clear the currently captured packets and restart the capture with the previous parameters various code cleanup and minor bugfixes Win32: use millisecond resolution in capture_loop, to smooth screen update a bit (500ms instead of 1000ms) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14059 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-10Win32 only bugfix: as using TerminateProcess is the brute force way and ↵ulfl1-0/+3
sometimes clipped packets in the middle, now using a pipe called signal_pipe from the parent to the child for this. On unix we're using kill() for this, which simply signals the child, but this isn't available on win32. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14040 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28various (minor) capture code cleanupulfl1-17/+9
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13957 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28fix Solaris build (I've removed O_BINARY)ulfl1-2/+1
rename sync_mode to real_time_mode, as we using sync_mode all the time now, so the name is misleading git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13956 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28remove capture_child flag from capture_opts as it's no longer requiredulfl1-5/+9
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13954 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-28a lot more capture engine code cleanupulfl1-4/+12
most notably: - moved opening of safe_file to the capture child (capture_loop.c) - removed save_file_fd from capture_opts (no longer need to have it global) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13953 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-07- pcap.h needs to be included before capture.hjmayer1-4/+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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13648 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-28Another step towards using the parent/child mode for ALL captures.ulfl1-0/+6
This is currently still disabled, as we cannot pass all required capture flags to the child process (lack of command line parameters). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13558 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-27some clarification of the capture child thingulfl1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13535 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-27minor comment additionsulfl1-2/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13533 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-23CHILD_NAME is only used #ifdef HAVE_LIBPCAPulfl1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13481 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-23use the applications name (currently "ethereal" or "tethereal") in ↵ulfl1-1/+1
capture_opts, instead of hardcoded "ethereal" for both. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13476 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-06Clean up indentation.guy1-24/+24
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13323 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-06another two steps towards privilege seperation:ulfl1-3/+8
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13320 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-06instead of initializing the capture_options in main.c, use the new function ↵ulfl1-0/+4
capture_opts_init git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13315 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-05rename kill_capture_child to capture_kill_child to have a common prefixulfl1-1/+1
split drag and drop support out of main.c into new file drag_and_drop.c, to reduce the size of main.c a bit. Hopefully this won't break unix builds because of missing #include's, I will keep an eye on the buildbot git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13308 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-05updated some commentsulfl1-4/+8
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13301 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-04(some) redesign of capture data structures.ulfl1-2/+7
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 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13276 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-03move capture_file_fd field from capture_file to capture_opts type, as this ↵ulfl1-0/+1
is the place where it should be git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13268 f5534014-38df-0310-8fa8-9805f1628bb7
2004-12-29move global capture_child flag into capture_optionsulfl1-3/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12855 f5534014-38df-0310-8fa8-9805f1628bb7
2004-12-29Don't use a global capture_opts in the capturing engine (this isn't a good ↵ulfl1-11/+8
idea). Do some more "housekeeping" in the capturing part. Hopefully the unspecified forward declaration of capture_options_t in main.h is portable, but buildbot will tell me. This way I need the internals of that struct only at the places I really use it. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12853 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-30split capture_loop from capture.c, some more code cleanupulfl1-10/+16
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12451 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-30move quit_after_cap into capture_optsulfl1-4/+8
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12449 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18Set the svn:eol-style property on all text files to "native", so thatguy1-1/+1
they have LF at the end of the line on UN*X and CR/LF on Windows; hopefully this means that if a CR/LF version is checked in on Windows, the CRs will be stripped so that they show up only when checked out on Windows, not on UN*X. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11400 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-06Make sure child processes don't create a splash screen. Make the verbs ingerald1-3/+3
the splash screen messages present participles. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11321 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-20added an option to "avoid" the capture info dialog completely.ulfl1-1/+2
This matters for "update of list in real time" (sync_mode) only, as in normal mode you wouldn't otherwise have the possibility to stop the capture. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11194 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-04add more details for doxygenulfl1-37/+46
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11107 f5534014-38df-0310-8fa8-9805f1628bb7
2004-04-13From Jon Oberheide: Add interface name to the capture and ethereal windowtuexen1-2/+3
while capturing. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10594 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-13experimental: make usage of pcap_setbuff to increase the kernel buffer sizeulfl1-1/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10377 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-04fixed differences between capture GUI frontend and backendulfl1-13/+12
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10303 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-02implemented capture dialog 3rd (+x) proposalulfl1-8/+16
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10279 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-28Capturing: "Number of files" switches between normal and multiple mode,ulfl1-2/+2
"Use ring buffer" switches between multiple single run and real ring buffer git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10257 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-21quit_after_cap should be a gboolean, not an int, and it should be initializedulfl1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10169 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-21rework of capture.c: better seperation of sync and capture pipe by usingulfl1-5/+1
explicit names and seperated functionality of do_capture(), but no functional change! git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10168 f5534014-38df-0310-8fa8-9805f1628bb7
2003-11-15seperated capture dialog from capture.c and put into new gtk/capture_info_dlg.culfl1-1/+34
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8968 f5534014-38df-0310-8fa8-9805f1628bb7
2003-11-01Based on a patch from Brian Fundakowski Feldman, add support for settingguy1-1/+3
link-layer type when capturing, using the "pcap_set_datalink()" and related APIs. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8848 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-15Don't pop up tap windows specified with "-z" options until we have aguy1-5/+5
capture file open. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8480 f5534014-38df-0310-8fa8-9805f1628bb7
2003-05-15Implement a ring buffer switch duration:deniel1-1/+3
when the new "Rotate capture file every n second(s)" checkbox or the -b <# of file>[:<duration>] argument are used, [t]ethereal will skip to the next ring buffer file if the specified duration has elapsed (even if the specified capture size is not reached). This is useful when you want to have separate capture files per hour or day for instance. I let the autostop filesize parameter mandatory (i.e. the "rotate capture file after n kilobytes") but this could be no longer strictly necessary when that new feature is used ... Another point: it might be interesting to really truncate the file at the switch and not the closure ... According to user comments and my own real case tests, I might plan to enhance this point and others (still ring buffer related) in the future. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7678 f5534014-38df-0310-8fa8-9805f1628bb7
2003-01-09From Albert Chin: "sync_pipe[]" isn't exported by "capture.c", so itguy1-2/+1
shouldn't be declared in "capture.h". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6886 f5534014-38df-0310-8fa8-9805f1628bb7
2002-09-09From Graeme Hewson:guy1-2/+2
Currently Ethereal sets and uses a default directory for reading and writing, but only in some places. This set of patches extends the setting of the default directory to the -w option as well as the -r option, and causes all file dialogs to use and set the default consistently. (I haven't changed the Preferences/Printing/File dialog, though, as that's a special case.) There's also a fix for a bug where Ethereal was issuing the message "Ring buffer requested, but capture isn't being saved to a permanent file" even though a file was specified with -w. There also appear to be some other cleanups in his patch. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6238 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28Removed trailing whitespaces from .h and .c files using thejmayer1-4/+4
winapi_cleanup tool written by Patrik Stridvall for the wine project. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6117 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-24Put all the capture options into a structure.guy1-11/+22
Move the ringbuffer capture options from the "capture_file" structure to the structure for capture options, as they're a property of an in-progress capture, not a property of a particular capture file. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4799 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-24"autostop_filesize" and "autostop_duration" don't need to be in theguy1-1/+8
"capture_file" structure - they're a property of an in-progress capture, not a property of an open capture file. Make them just variables. The maximum number of packets to be captured should be a variable separate from the "count" field in the "capture_file" structure - the latter is a count of the packets in the capture file in question. Have Boolean variables indicating whether a maximum packet count, maximum capture file size, and maximum capture duration were specified. If an option isn't set, and we're doing an "update list of packets in real time" capture, don't pass the option to the child process with a command-line argument. Don't create "stop when the capture file reaches this size" or "stop when the capture's run for this long" conditions if a maximum capture file size or a maximum capture duration, respectively, haven't been specified. Don't test or free a condition if it wasn't created. Don't allow a 0 argument to the "-c" flag - the absence of a "-c" flag is the way you specify "no limit on the number of packets". Initialize the check boxes and spin buttons for the "maximum packets to capture", "maximum capture size", and "maximum capture duration" options to the values they had in the last capture. If an option wasn't specified, don't read its value from the dialog box and set the variable. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4795 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-08Have Wiretap set the snapshot length to 0 if it can't be derived fromguy1-1/+3
reading the capture file. Have callers of "wtap_snapshot_length()" treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so that, when writing a capture file in a format that *does* store the snapshot length, we can at least put *something* in the file). If we don't know the snapshot length of the current capture file, don't display a value in the summary window. Don't use "cfile.snap" as the snapshot length option when capturing - doing so causes Ethereal to default, when capturing, to the snapshot length of the last capture file that you read in, rather than to the snapshot length of the last capture you did (or the initial default of "no snapshot length"). Redo the "Capture Options" dialog box to group options into sections with frames around them, and add units to the snapshot length, maximum file size, and capture duration options, as per a suggestion by Ulf Lamping. Also add units to the capture count option. Make the snapshot length, capture count, maximum file size, and capture duration options into a combination of a check box and a spin button. If the check box is not checked, the limit in question is inactive (snapshot length of 65535, no max packet count, no max file size, no max capture duration); if it's checked, the spinbox specifies the limit. Default all of the check boxes to "not checked" and all of the spin boxes to small values. Use "gtk_toggle_button_get_active()" rather than directly fetching the state of a check box. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4709 f5534014-38df-0310-8fa8-9805f1628bb7