aboutsummaryrefslogtreecommitdiffstats
path: root/capture_sync.c
AgeCommit message (Collapse)AuthorFilesLines
2006-05-28Ethereal->WiresharkAnders Broman1-4/+4
svn path=/trunk/; revision=18235
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2006-05-01Handle the case where we *can't* determine the pathname in which to findGuy Harris1-2/+9
programs, by reporting it with a dialog box that at least attempts to indicate what the problem is, and by giving up early on running dumpcap. svn path=/trunk/; revision=18051
2006-04-03Clean up if CreateProcess() fails. Guy Harris1-0/+3
svn path=/trunk/; revision=17790
2006-04-03Put the low-level sync routines into a common file so they can be sharedGuy Harris1-7/+9
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-03-24disable the call to sync_pipe_errmsg_to_parent for now, if execv failed (so ↵Ulf Lamping1-2/+3
at least the *NIX versions compile again) svn path=/trunk/; revision=17719
2006-03-24Dumpcap probably has *no* windows.Guy Harris1-1/+3
svn path=/trunk/; revision=17716
2006-03-24Various code cleanup in the capture pipe stuffUlf Lamping1-223/+140
svn path=/trunk/; revision=17714
2006-03-19Fix pipe_read_bytes() to return the total number of bytes read, not justGuy Harris1-2/+2
the number of bytes read in the last read() call done. svn path=/trunk/; revision=17675
2006-03-13fix bug #803: sync pipe on Win32 wasn't set to binary mode, so error message ↵Ulf Lamping1-33/+58
transport failed between Ethereal and dumpcap. I've also changed the way the secondary error message is transported from former "header message 0 secondary 0" to "header header message 0 header secondary 0" as that might be a bit more clearer, and I'll need it for further development anyway. I was using this while debugging and not recognizing the real problem - for about four hours :-(. I'll need this feature when doing the interface (and link layer type) browsing later (transferring this data from dumpcap to Ethereal) to get a full blown privilege seperation. svn path=/trunk/; revision=17608
2006-03-09debugging helper: if (for whatever reason) the message from dumpcap was ↵Ulf Lamping1-0/+5
invalid, try to print it. This was already helpful e.g. as a GLib warning was confusing the pipe handling svn path=/trunk/; revision=17559
2006-03-09Take care of one last UTF-8 <-> UTF-16 conversion (assuming there aren't anyGerald Combs1-13/+14
hiding behind casts). Fixes bug 798. Clean up whitespace. svn path=/trunk/; revision=17550
2006-03-05Pass two strings in capture child messages, so the child can sendGuy Harris1-30/+59
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-02-17fix some bugs introduced with command line encapsulationUlf Lamping1-25/+12
svn path=/trunk/; revision=17341
2006-02-17We now quote args as necessary on Windows when constructing the commandGuy Harris1-19/+5
line, so there's no need to quote them when adding the arguments. svn path=/trunk/; revision=17332
2006-02-17On Windows. quote arguments as necessary before sticking them into theGuy Harris1-3/+81
command line passed to Create_Process(). On UN*X, use "execv()", not "execvp()", as we now construct the absolute pathname of "dumpcap". svn path=/trunk/; revision=17330
2006-02-17remove dependencies to pcap.h, so getting an idea what needs to be done by ↵Ulf Lamping1-3/+8
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-12At least on UN*X, the first argument - argv[0] - is supposed to be theGuy Harris1-4/+7
name of the program as used to run it (command name/path name). Pass that - otherwise, we pass "-i" as argv[0], and dumpcap ignores it and treats the capture device as the first argument and doesn't handle it correctly (i.e., it doesn't capture on that device). svn path=/trunk/; revision=17277
2006-02-12Distinguish between pipe_read_block() returning 0 (EOF) or a negativeGuy Harris1-2/+10
value (error reading). svn path=/trunk/; revision=17276
2006-02-12Instead of using (commented-out) g_warning() calls to log errors readingGuy Harris1-9/+26
and writing the sync pipe, using g_log() calls at the G_LOG_LEVEL_DEBUG or G_LOG_LEVEL_WARNING levels, so we can get at them if necessary. Add some messages for errors for which we had no logging. svn path=/trunk/; revision=17275
2006-02-12add a minor commentUlf Lamping1-0/+1
svn path=/trunk/; revision=17270
2006-02-12Add a routine to attempt to get the absolute pathname of the executableGuy Harris1-4/+2
file, strip off the last component to get the pathname of the directory containing the executable file, and save it for future use. On Windows, you can get that from the OS, but, on UN*X, you have to look at argv[0] and derive the absolute path from that (argv[0] is not guaranteed to be an absolute path, or even a path at all). (In addition, if you're running from the build directory, you might have to strip off a ".libs/" added to argv[0] as an artifact of the libtoolizing script.) Use that in the About dialog, and use it to construct the path of dumpcap. Don't put quotes into the path of dumpcap; you don't have to quote strings with spaces in them when handing them to execvp and, in fact, you *mustn't* quote them, as the quotes will be treated as part of the pathname. svn path=/trunk/; revision=17267
2006-02-12Fix up indentation.Guy Harris1-6/+2
svn path=/trunk/; revision=17262
2006-02-12we still need sync_pipe_errmsg_to_parent() for the *NIX buildUlf Lamping1-0/+12
svn path=/trunk/; revision=17260
2006-02-11the point of no return ...Ulf Lamping1-164/+117
using dumpcap as the capture child for Ethereal. dumpcap is a plain console application now, even for Win32 (so no WinMain, create_console and special piping stuff reguired). The undocumented command line option -Z will switch dumpcap into "child mode", using binary instead of plain text output messages to communicate with a parent Ethereal. Ethereal's main.c no longer needs to distinguish between child mode or not, so some simplifying here. capture_sync.c has to call dumpcap in a "hidden window" mode using CreateProcess instead of spawnvp, otherwise an uggly console window would appear. The handles created by _pipe doesn't seem to be inheritable for this function, using CreatePipe instead. The file capture_loop.c is only needed by dumpcap, removed from Ethereal link objects. Some debugging aid added and other minor cleanup done. svn path=/trunk/; revision=17256
2006-02-10only a backup, nothing changed for now.Ulf Lamping1-2/+50
second try to bring dumpcap to life. Currently it's working, but the child (dumpcap) will show an annoying Win32 console window while running. svn path=/trunk/; revision=17239
2005-12-15remove the setting of no longer required command line options:Ulf Lamping1-14/+18
-H (Hide capture info dialog) -m (font to use) svn path=/trunk/; revision=16807
2005-12-13we don't use the command line option -W any longer, remove it from a commentUlf Lamping1-1/+0
svn path=/trunk/; revision=16786
2005-12-04move the complete functionality of the capture info dialog from ↵Ulf Lamping1-18/+1
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-03add missing functions (to complete/cleanup of interface):Ulf Lamping1-7/+3
capture_input_drops capture_input_error_message and move the functionality from capture_sync.c to capture.c (just where it belongs) svn path=/trunk/; revision=16663
2005-12-03precise some pipe message commentsUlf Lamping1-2/+6
svn path=/trunk/; revision=16660
2005-11-18Make the message length in the sync pipe message header 3 bytes ofGuy Harris1-18/+29
binary data, so the maximum message length can be up to 2^24-1. Add a #define for that message size, and have it be 4096, for now, as that was the size of the buffer used to read sync pipe messages. Clean up white space. When displaying an error message from the capture child, don't use it as a format string - it could conceivably contain "%"s. Instead, format it with "%s". svn path=/trunk/; revision=16541
2005-11-06replace *a lot* of file related calls by their GLib counterparts. This is ↵Ulf Lamping1-19/+11
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-2/+0
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-08-20capture_sync.c(290) : warning C4090: 'function' : different 'const' qualifiersUlf Lamping1-4/+4
capture_sync.c(290) : warning C4022: 'g_realloc' : pointer mismatch for actual parameter 1 capture_sync.c(431) : warning C4090: 'function' : different 'const' qualifiers capture_sync.c(431) : warning C4022: 'g_free' : pointer mismatch for actual parameter 1 capture_sync.c(442) : warning C4090: 'function' : different 'const' qualifiers capture_sync.c(442) : warning C4022: 'g_free' : pointer mismatch for actual parameter 1 capture_sync.c(549) : warning C4090: 'function' : different 'const' qualifiers capture_sync.c(549) : warning C4022: 'g_free' : pointer mismatch for actual parameter 1 svn path=/trunk/; revision=15487
2005-08-14Some 'no previous declararion' warning fixesJörg Mayer1-1/+1
svn path=/trunk/; revision=15355
2005-08-08various code cleanup:Ulf Lamping1-33/+19
-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-06Last set of char -> const char trivial warning fixes.Jörg Mayer1-6/+6
svn path=/trunk/; revision=15244
2005-05-30fix #148: (win32 only) use command line parameter -B to set capture buffer sizeUlf Lamping1-0/+5
svn path=/trunk/; revision=14484
2005-05-26some cleanup of capture error notification handlingUlf Lamping1-6/+10
svn path=/trunk/; revision=14441
2005-05-26use the log features of the GLib to have verbose output of the capturing ↵Ulf Lamping1-4/+26
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-25forgot to init savefilestring = NULL;Ulf Lamping1-0/+1
svn path=/trunk/; revision=14435
2005-05-25fix #199: encapsulate capture filename, to avoid problems with spaces in the ↵Ulf Lamping1-5/+16
filename (win32 only) svn path=/trunk/; revision=14432
2005-04-30(hopefully) removed various gcc warningsUlf Lamping1-2/+1
svn path=/trunk/; revision=14241
2005-04-12capture engine: Ulf Lamping1-46/+34
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-198/+151
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-11various capture code cleanup and fixes: Ulf Lamping1-61/+54
display filename in statusbar while capturing print_usage banner fixed cf_cb_live_capture_prepare no longer needed rename sync_pipe_do_capture -> sync_pipe_start bugfix: sync_pipe_input_wait_for_start replaced by former implementation fix cleanup of old file in capture_input_new_file fix a tempfile detection bug (named file showed up as tempfile after capture) svn path=/trunk/; revision=14053
2005-04-10Win32 only bugfix: as using TerminateProcess is the brute force way and ↵Ulf Lamping1-21/+55
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-10refactoring of the capture startup (while the capture parent waits for the ↵Ulf Lamping1-81/+104
child to start) svn path=/trunk/; revision=14038
2005-04-10Clean up white space, and tweak a comment slightly ("message" in theGuy Harris1-6/+6
error message case referred to the error message text, not the message on the pipe). svn path=/trunk/; revision=14035