aboutsummaryrefslogtreecommitdiffstats
path: root/capture_loop.c
AgeCommit message (Collapse)AuthorFilesLines
2006-01-07move output_to_pipe flag from tethereal's loop_data into capture_opts, so it ↵Ulf Lamping1-2/+5
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-1/+1
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-04Handle a null-string file name in "capture_loop_open_output()" - that'sGuy Harris1-12/+25
what indicates that we're supposed to write to the standard output (Tethereal turns "-" into ""). svn path=/trunk/; revision=16941
2005-12-31Ooops, remove a debug message in the Win32 code part of the capturing loop.Ulf Lamping1-1/+1
It might (very slightly) slow down capturing in the 0.10.14 release :-( svn path=/trunk/; revision=16923
2005-12-17Win32 bugfix: peeking the signal_pipe at capture_loop start seems to be ↵Ulf Lamping1-10/+5
unreliable Instead, simply keep the signal_pipe setting directly from the command line which is working well svn path=/trunk/; revision=16833
2005-12-14Constify a bunch of arguments and variables, to squelch compilerGuy Harris1-3/+2
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-125/+81
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-05I've forgot to put one line under _WIN32, should fix the unix buildUlf Lamping1-5/+5
svn path=/trunk/; revision=16679
2005-12-05Win32: fix signal_pipe handling if we run dumpcap as a standalone ↵Ulf Lamping1-22/+39
application (no signal_pipe) svn path=/trunk/; revision=16677
2005-12-04move the complete functionality of the capture info dialog from ↵Ulf Lamping1-55/+6
capture_loop.c to capture_info.c and call it from capture.c (instead of capture_loop.c). This way, the capture child don't need to now any of the packet_counter things (no epan/packet.h and all alike). Currently the capture_info code will always open another wiretap file instance to build it's own counter values. This isn't optimized for now (next step: use data from cf_continue_tail() somehow). svn path=/trunk/; revision=16669
2005-12-03split some parts of the packet counting functions into their own files ↵Ulf Lamping1-102/+14
capture_info(.c/.h), so we can use it from the main program svn path=/trunk/; revision=16668
2005-12-03split capture.h into capture.h, capture_loop.h and capture_opts.h and place ↵Ulf Lamping1-0/+1
the parts into the corresponding files svn path=/trunk/; revision=16664
2005-12-03the function capture_loop_popup_errmsg seems to be useless and misleading, Ulf Lamping1-17/+8
simply call sync_pipe_errmsg_to_parent directly instead svn path=/trunk/; revision=16662
2005-12-02performance improvement: if the packet info dialog is hidden, we don't need ↵Ulf Lamping1-0/+7
to call the capture_... packet count functions svn path=/trunk/; revision=16647
2005-11-28dumpcap.c doesn't need to link with file.c!Ulf Lamping1-1/+8
this fortunately removes *a lot* of dependencies and make the resulting binary a lot smaller (and hopefully faster to load :-) some more cleanup (like replacing // by /**/) svn path=/trunk/; revision=16620
2005-11-28first steps towards a separated capture tool, working title "dumpcap"Ulf Lamping1-0/+2
personal backup only, not meant for public testing! I've copied main.c into dumpcap.c and carved out all things not needed currently won't work as a command line tool, capture_loop.c wants an input pipe console output is also very ugly and the whole code needs a lot of further cleanup shouldn't break the unix build as I've only changed the nmake files so far, but who knows ... svn path=/trunk/; revision=16615
2005-11-25rephrase the error dialog if an interface couldn't be opened.Ulf Lamping1-7/+9
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-07Fix a typo.Guy Harris1-1/+1
svn path=/trunk/; revision=16408
2005-11-06replace *a lot* of file related calls by their GLib counterparts. This is ↵Ulf Lamping1-11/+7
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-30Make capture filter (and capture filter error message) strings "safe" asGuy Harris1-4/+10
necessary before putting them into an error message dialog. Fixes bug 564. svn path=/trunk/; revision=16365
2005-10-07fix Ethereal so command line capture parameter will work with kilobytes (again)Ulf Lamping1-3/+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-06bugfix: reset the packet counter to zero, if switching to the next "multiple ↵Ulf Lamping1-0/+2
file". This fixes the live update of the packet output after switching to another capture file svn path=/trunk/; revision=16135
2005-10-04Add a note about 64-bit support in WinPcap to the capture errors onGuy Harris1-0/+8
Windows, and add the URL for the CaptureSetup page to the Tethereal error. svn path=/trunk/; revision=16103
2005-09-27mention "http://wiki.ethereal.com/CaptureSetup" in the error dialog, when ↵Ulf Lamping1-0/+2
the capture interface couldn't be opened svn path=/trunk/; revision=16025
2005-09-22Libpcap uses u_char; use it in our calls to libpcap routines and in ourGuy Harris1-8/+8
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/+4
a capture device open fails. svn path=/trunk/; revision=15951
2005-09-14added compression support for capture file output. The Save/As dialog now ↵Ulf Lamping1-5/+5
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-08-06Last set of char -> const char trivial warning fixes.Jörg Mayer1-1/+1
svn path=/trunk/; revision=15244
2005-05-26fix #125: as suggested, the data in rechdr has to be kept over several calls ↵Ulf Lamping1-2/+2
to capture_loop_dispatch, so put it in the loop_data svn path=/trunk/; revision=14442
2005-05-26some cleanup of capture error notification handlingUlf Lamping1-1/+1
svn path=/trunk/; revision=14441
2005-05-26use the log features of the GLib to have verbose output of the capturing ↵Ulf Lamping1-8/+83
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. svn path=/trunk/; revision=14438
2005-05-12Use "pcap_get_selectable_fd()" if we have it, and if it returns -1,Guy Harris1-32/+52
don't do a "select()". svn path=/trunk/; revision=14358
2005-04-30(hopefully) removed various gcc warningsUlf Lamping1-1/+1
svn path=/trunk/; revision=14241
2005-04-16beautify an error messageUlf Lamping1-7/+11
svn path=/trunk/; revision=14101
2005-04-12capture engine: Ulf Lamping1-24/+38
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) svn path=/trunk/; revision=14059
2005-04-12it should now be possible to use "Update packets in real time" even if used ↵Ulf Lamping1-0/+5
with one of the "Multiple files" option. If this is used together with an option where input files changes too fast (e.g. new file every second), capturing will be (hopefully) stopped. I've replaced the former capture pipe message format into a somewhat more general format to remove a lot of confusion. svn path=/trunk/; revision=14054
2005-04-11fix some error handlingUlf Lamping1-5/+17
fflush new output file (to have at least the pcap header on disk) before sending the corresponding message to the capture parent svn path=/trunk/; revision=14052
2005-04-10fix a typoUlf Lamping1-1/+1
svn path=/trunk/; revision=14041
2005-04-10Win32 only bugfix: as using TerminateProcess is the brute force way and ↵Ulf Lamping1-0/+17
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. svn path=/trunk/; revision=14040
2005-04-10Fix indentation.Guy Harris1-10/+10
svn path=/trunk/; revision=14034
2005-03-28various (minor) capture code cleanupUlf Lamping1-0/+16
svn path=/trunk/; revision=13957
2005-03-28fix Solaris build (I've removed O_BINARY)Ulf Lamping1-13/+10
rename sync_mode to real_time_mode, as we using sync_mode all the time now, so the name is misleading svn path=/trunk/; revision=13956
2005-03-28remove capture_child flag from capture_opts as it's no longer requiredUlf Lamping1-37/+8
svn path=/trunk/; revision=13954
2005-03-28a lot more capture engine code cleanupUlf Lamping1-21/+76
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) svn path=/trunk/; revision=13953
2005-03-28major capture engine rework: use two task model for EVERY capture modeUlf Lamping1-0/+26
rework of the -b command line parameter (for Ethereal and Tethereal) svn path=/trunk/; revision=13949
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-21Add a capture_fr() routine when capturing on Frame Relay.Guy Harris1-0/+5
svn path=/trunk/; revision=13845
2005-02-23pass child capture filename to parent process (name currently unused) and ↵Ulf Lamping1-0/+1
some fork_child cleanup svn path=/trunk/; revision=13482
2005-02-15WinPcap 3.0 might support PPP/WAN capturing on Windows OT, so lump itGuy Harris1-7/+11
together with the pre-3.0 releases. Mention 3.1 beta's support, noting that it's a beta. svn path=/trunk/; revision=13406