Commit Graph

39 Commits

Author SHA1 Message Date
Jörg Mayer 62b7cc3043 Last set of char -> const char trivial warning fixes.
svn path=/trunk/; revision=15244
2005-08-06 14:03:14 +00:00
Ulf Lamping 2c672ff840 fix #125: as suggested, the data in rechdr has to be kept over several calls to capture_loop_dispatch, so put it in the loop_data
svn path=/trunk/; revision=14442
2005-05-26 19:38:26 +00:00
Ulf Lamping 6a853e1bc3 some cleanup of capture error notification handling
svn path=/trunk/; revision=14441
2005-05-26 19:06:01 +00:00
Ulf Lamping 5d404864f2 use the log features of the GLib to have verbose output of the capturing 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-26 17:50:27 +00:00
Guy Harris d5bad28951 Use "pcap_get_selectable_fd()" if we have it, and if it returns -1,
don't do a "select()".

svn path=/trunk/; revision=14358
2005-05-12 03:31:33 +00:00
Ulf Lamping be9bdd1fee (hopefully) removed various gcc warnings
svn path=/trunk/; revision=14241
2005-04-30 15:39:40 +00:00
Ulf Lamping 4fee14e326 beautify an error message
svn path=/trunk/; revision=14101
2005-04-16 19:22:15 +00:00
Ulf Lamping 7e9cedfed8 capture engine:
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-12 21:44:55 +00:00
Ulf Lamping 06ef0a3b52 it should now be possible to use "Update packets in real time" even if used 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-12 00:54:52 +00:00
Ulf Lamping fbace0592c fix some error handling
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-11 18:39:31 +00:00
Ulf Lamping 70f1945084 fix a typo
svn path=/trunk/; revision=14041
2005-04-10 17:08:32 +00:00
Ulf Lamping 7b7f7e7f9a Win32 only bugfix: as using TerminateProcess is the brute force way and 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-10 16:43:22 +00:00
Guy Harris 39836021f7 Fix indentation.
svn path=/trunk/; revision=14034
2005-04-10 08:31:27 +00:00
Ulf Lamping 2d1981f08b various (minor) capture code cleanup
svn path=/trunk/; revision=13957
2005-03-28 18:04:09 +00:00
Ulf Lamping b64ebb05c2 fix Solaris build (I've removed O_BINARY)
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-28 16:14:34 +00:00
Ulf Lamping 9d6ac60cef remove capture_child flag from capture_opts as it's no longer required
svn path=/trunk/; revision=13954
2005-03-28 15:31:13 +00:00
Ulf Lamping daa67c79ba a lot more capture engine code cleanup
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-28 14:39:31 +00:00
Ulf Lamping 7e78ef354e major capture engine rework: use two task model for EVERY capture mode
rework of the -b command line parameter (for Ethereal and Tethereal)

svn path=/trunk/; revision=13949
2005-03-28 00:19:02 +00:00
Guy Harris 46e1907f13 If we have "pcap_freecode()", use it to free the instructions for a BPF
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-23 01:25:01 +00:00
Guy Harris 839dd9002c Add a capture_fr() routine when capturing on Frame Relay.
svn path=/trunk/; revision=13845
2005-03-21 03:55:50 +00:00
Ulf Lamping b6ab688e0a pass child capture filename to parent process (name currently unused) and some fork_child cleanup
svn path=/trunk/; revision=13482
2005-02-23 22:04:31 +00:00
Guy Harris 1aa4357464 WinPcap 3.0 might support PPP/WAN capturing on Windows OT, so lump it
together with the pre-3.0 releases.  Mention 3.1 beta's support, noting
that it's a beta.

svn path=/trunk/; revision=13406
2005-02-15 03:49:12 +00:00
Guy Harris 60ad11d708 Get rid of a few cf_get_ references missed by the previous checkin.
svn path=/trunk/; revision=13325
2005-02-06 22:19:53 +00:00
Ulf Lamping 3a63719e38 another two steps towards privilege seperation:
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.

svn path=/trunk/; revision=13320
2005-02-06 21:20:35 +00:00
Ulf Lamping 10ee9093c8 remove #include "globals.h" and access to global cfile, use access functions and capture_opts instead
svn path=/trunk/; revision=13284
2005-02-04 08:42:39 +00:00
Ulf Lamping dd71ad695f (some) redesign of capture data structures.
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

svn path=/trunk/; revision=13276
2005-02-04 01:29:29 +00:00
Ulf Lamping 9ff19a4c94 move capture_file_fd field from capture_file to capture_opts type, as this is the place where it should be
svn path=/trunk/; revision=13268
2005-02-03 22:48:20 +00:00
Ulf Lamping be0e6a0631 prevent ringbuffer from having to know about capture_file type at all (decoupling dependencies)
svn path=/trunk/; revision=13266
2005-02-03 21:58:33 +00:00
Ulf Lamping cb9be2d997 fix a bug (reported by Greg Morris) caused by code cleanup (blame it on me):
as the total packet count wasn't updated, the capture_info dialog wasn't updated accordingly

svn path=/trunk/; revision=13021
2005-01-13 20:19:49 +00:00
Guy Harris 3defa3be20 From Thomas Boehne: fix a call to use errmsg_len rather than sizeof
errmsg - errmsg is a pointer, so sizeof errmsg is the size of the
pointer, not the size of what it points to.

svn path=/trunk/; revision=12983
2005-01-07 13:33:21 +00:00
Guy Harris 4c4d5783d0 Pass "capture_opts" to "capture_loop_dispatch()", as
"capture_loop_dispatch()" uses it.

svn path=/trunk/; revision=12859
2004-12-29 21:29:53 +00:00
Ulf Lamping d9be4670a7 move global capture_child flag into capture_options
svn path=/trunk/; revision=12855
2004-12-29 12:37:06 +00:00
Ulf Lamping 2ed93e96bd Don't use a global capture_opts in the capturing engine (this isn't a good 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.

svn path=/trunk/; revision=12853
2004-12-29 09:09:35 +00:00
Guy Harris f1deabed56 Make the tone of the error messages a bit less formal, by using
contractions.  (Safari does, at least when you're trying to open a file
to which you don't have read access.)

svn path=/trunk/; revision=12852
2004-12-29 01:08:20 +00:00
Guy Harris 85a6bea56e Use the "errmsg_len" argument to "capture_loop_open_output()" -
"sizeof(errmsg)', when "errmsg" is a "char *", doesn't give the size of
the string to which "errmsg" points, it gives the size of the pointer
itself, which is too small.

svn path=/trunk/; revision=12851
2004-12-29 00:51:29 +00:00
Ulf Lamping e321859a86 some code cleanup (comments changed)
svn path=/trunk/; revision=12848
2004-12-28 00:36:06 +00:00
Ulf Lamping 7f666b77a5 a lot of code cleanup/refactoring
svn path=/trunk/; revision=12846
2004-12-27 22:04:49 +00:00
Guy Harris a522ab7fad Move some #defines and #includes around, and add some other #includes,
to make it compile on UN*X.  Get rid of some #includes that don't appear
to be needed, at least on OS X 10.3 (they might be needed on other
platforms).

svn path=/trunk/; revision=12453
2004-10-30 23:26:47 +00:00
Ulf Lamping 7445ecfd05 split capture_loop from capture.c, some more code cleanup
svn path=/trunk/; revision=12451
2004-10-30 17:50:51 +00:00