aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
AgeCommit message (Collapse)AuthorFilesLines
2004-01-31Pass ESD_BTN_OK rather than NULL as a second argument toGuy Harris1-20/+21
"simple_dialog()"; NULL might be #defined to be a pointer expression on some platforms, causing compiler warnings (and, on platforms where a null pointer doesn't have all its bits 0, possibly causing misbehavior, although I don't think there are any such platforms on which Ethereal runs). Don't allow 0 as button mask argument to "simple_dialog()". Squelch a compiler warning. Report fatal problems as errors, not warnings. Report file I/O errors with "file_open_error_message()". Report file write errors (including those reported by "close()", e.g. some errors writing to an NFS server) when saving raw packet data to a file. svn path=/trunk/; revision=9915
2004-01-31Add some more information to the error message for invalid captureGuy Harris1-3/+5
filters that look like display filters. svn path=/trunk/; revision=9914
2004-01-31renamed ESD_TYPE_CRIT to ESD_TYPE_ERROR toUlf Lamping1-9/+9
better reflect the real error text svn path=/trunk/; revision=9913
2004-01-31If "pcap_compile()" fails to compile an empty filter string (because,Guy Harris1-2/+2
for example, the libpcap code generator doesn't support the link-layer type for the capture), "dfilter_compile()" will succeed but return a null rfcode pointer. In that case, instead of telling people that it looks like a valid display filter (which it does, but it also looks like a complete list of all the Basque words likely to be known by Hammurabi :-)), and then crashing when we try to "free" that non-existent dfilter code, we just report it as a "sorry, couldn't compile that capture filter. svn path=/trunk/; revision=9912
2004-01-25Have the Wiretap open, read, and seek-and-read routines return, inGuy Harris1-2/+2
addition to an error code, an error info string, for WTAP_ERR_UNSUPPORTED, WTAP_ERR_UNSUPPORTED_ENCAP, and WTAP_ERR_BAD_RECORD errors. Replace the error messages logged with "g_message()" for those errors with g_strdup()ed or g_strdup_printf()ed strings returned as the error info string, and change the callers of those routines to, for those errors, put the info string into the printed message or alert box for the error. Add messages for cases where those errors were returned without printing an additional message. Nobody uses the error code from "cf_read()" - "cf_read()" puts up the alert box itself for failures; get rid of the error code, so it just returns a success/failure indication. Rename "file_read_error_message()" to "cf_read_error_message()", as it handles read errors from Wiretap, and have it take an error info string as an argument. (That handles a lot of the work of putting the info string into the error message.) Make some variables in "ascend-grammar.y" static. Check the return value of "erf_read_header()" in "erf_seek_read()". Get rid of an unused #define in "i4btrace.c". svn path=/trunk/; revision=9852
2004-01-24Add a new "file_open_error_message()" routine in "epan/filesystem.c", toGuy Harris1-2/+3
translate UNIX errno values to a somewhat friendly message format string. Rename "file_open_error_message()" in "file.c" to "cf_open_error_message()", make "cf_open_error_message()" use the new "file_open_error_message()" for UNIX errno values, have "do_capture()" in "capture.c" use "file_open_error_message()" to report errors from "open()", and make "cf_open_error_message()" static as nothing outside "file.c" uses it. Do similar stuff in "tethereal.c". svn path=/trunk/; revision=9821
2004-01-22Use "fork_child" rather than "child_process" - on Win32, "child_process"Guy Harris1-12/+6
tracks "fork_child", and, on UNIX, "child_process" doesn't exist. svn path=/trunk/; revision=9783
2004-01-22bugfix: wrong parameter nameUlf Lamping1-2/+2
svn path=/trunk/; revision=9778
2004-01-22moved GTK specific parts from capture.c to ui_util.c,Ulf Lamping1-103/+38
implemented Win32 "Capture Stop" when using "update list of packets in realtime" while capturing svn path=/trunk/; revision=9777
2004-01-20a.) saving GTK1 and GTK2 fontnames in different preference setting, to ↵Ulf Lamping1-3/+3
prevent problems when switching between GTK1 and GTK2 ethereal versions b.) added new feature "Edit->Go To First Packet" "Edit->Go To Last Packet" with corresponding menu and toolbar items c.) added new feature "View->Zoom In" / "View->Zoom Out" / View->Normal Size" with corresponding menu and toolbar items This feature will act as a "size offset" to the current fontsize, so that the packet list/tree view/... will have a larger/smaller font size. The value is stored inside the recent file. d.) Win32 only: Try to get the win32 system font and fontsize at program startup and show the menus/dialogs and such with the same font and fontsize like other win32 windows. This makes the program make a *lot* more feel like a normal win32 program. svn path=/trunk/; revision=9753
2004-01-18Update the Win32 information given when we fail to open a capture deviceGuy Harris1-3/+5
to note that the 3.0 and later versions of WinPcap don't support PPP/WAN captures even on Windows OT. svn path=/trunk/; revision=9709
2004-01-05removed some MSVC warnings (level 3)Ulf Lamping1-3/+5
svn path=/trunk/; revision=9561
2003-12-21removed some MSVC warnings (moved pcap.h before glib.h)Ulf Lamping1-3/+3
svn path=/trunk/; revision=9393
2003-12-18Top-of-tree and top-of-0.8-branch libpcap support limited filtering onGuy Harris1-3/+3
DLT_LINUX_IRDA (empty expression and "link[M:N]" expressions), so don't special-case IRDA adapters. svn path=/trunk/; revision=9349
2003-12-18From Jan Kiszka: IrDA support.Guy Harris1-3/+3
svn path=/trunk/; revision=9345
2003-11-17Fix a typo.Guy Harris1-2/+2
svn path=/trunk/; revision=8983
2003-11-17Get rid of a no-longer-used variable.Guy Harris1-2/+1
svn path=/trunk/; revision=8980
2003-11-15seperated capture dialog from capture.c and put into new gtk/capture_info_dlg.cUlf Lamping1-142/+24
svn path=/trunk/; revision=8968
2003-11-14When it comes to whether to use "select()" or not, even if you'reGuy Harris1-13/+10
building in Cygwin's pretend-it's-UNIX environment, we need to treat the platform as Windows. Get rid of the BSD #define - just check for the platforms on which we mustn't use "select()". svn path=/trunk/; revision=8967
2003-11-01Based on a patch from Brian Fundakowski Feldman, add support for settingGuy Harris1-2/+20
link-layer type when capturing, using the "pcap_set_datalink()" and related APIs. svn path=/trunk/; revision=8848
2003-10-11Part 3 of display vs. capture syntax confusion patches: Detect probableJörg Mayer1-3/+15
use of display filter syntax where capture filter syntax need to be used in Ethereal. svn path=/trunk/; revision=8677
2003-09-15Make sure we return FALSE in all the failure paths in "do_capture()".Guy Harris1-89/+111
svn path=/trunk/; revision=8483
2003-09-15Don't pop up tap windows specified with "-z" options until we have aGuy Harris1-10/+12
capture file open. svn path=/trunk/; revision=8480
2003-09-15Rename various capture file routines to have names starting with "cf_".Guy Harris1-16/+15
svn path=/trunk/; revision=8479
2003-07-23Give a more detailed message when WSAStartup fails.Guy Harris1-9/+42
svn path=/trunk/; revision=8069
2003-05-15Implement a ring buffer switch duration:Laurent Deniel1-1/+21
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. svn path=/trunk/; revision=7678
2003-04-24Don't ignore SIGCHLD - doing so means that, on many platforms, we don'tGuy Harris1-2/+1
get any status information from the child process when it terminates, and we want that status information (e.g., death due to a signal). svn path=/trunk/; revision=7549
2003-01-23From a look at the Linux ARCNET code, it appears that no frame deliveredGuy Harris1-3/+3
to the networking stack will have an exception frame header. Note, however, that on the BSD's ARCNET might be a bit of a mess. svn path=/trunk/; revision=6986
2003-01-23Add a "capture_arcnet()" routine and use it when capturing.Guy Harris1-1/+8
In "dissect_arcnet_common()", fetch the protocol ID using the correct offset rather than a hardwired 4. svn path=/trunk/; revision=6982
2003-01-03Rename WTAP_ENCAP_ATM_SNIFFER to WTAP_ENCAP_ATM_PDUS, as it's not justGuy Harris1-2/+2
used for the DOS-based ATM Sniffer. (That's not a great name, but I couldn't think of a better one.) Add a new WTAP_ENCAP_ATM_PDUS_UNTRUNCATED encapsulation type for capture files where reassembled frames don't have trailers, such as the AAL5 trailer, chopped off. That's what at least some versions of the Windows-based ATM Sniffer appear to have. Map the ATM capture file type for NetXRay captures to WTAP_ENCAP_ATM_PDUS_UNTRUNCATED, and put in stuff to fill in what we've reverse-engineered, so far, for the pseudo-header; there's more that needs to be done on it, e.g. getting the channel, AAL type, and traffic type (or inferring them if they're not in the packet header). svn path=/trunk/; revision=6840
2003-01-01Re-word-wrap the "you can't capture on PPP/WAN interfaces on NT"Guy Harris1-3/+3
message, to make the margins more even and to bring the second line under 80 characters. (It's amazing how long Herman Hollerith's legacy has lasted....) svn path=/trunk/; revision=6835
2002-12-31Use _WIN32 rather than WIN32 throughout (both of them appear to work - IGuy Harris1-4/+4
don't know whether one is the "right" one to use and, if one is, which one it is - and they're both used in Ethereal, but let's at least be consistent within a given file). svn path=/trunk/; revision=6828
2002-12-31Clean up the comments a bit.Guy Harris1-2/+3
svn path=/trunk/; revision=6827
2002-12-29Fix a typo.Guy Harris1-2/+2
svn path=/trunk/; revision=6821
2002-12-29"&magic" is a "guint32 *", so adding a byte count to it points thatGuy Harris1-2/+2
number of *32-bit words* into the magic number, not that number of *bytes* into the magic number; cast it to "char *" before adding the byte count. svn path=/trunk/; revision=6820
2002-12-18Correctly compute the minutes portion of the elapsed time.Guy Harris1-2/+2
svn path=/trunk/; revision=6797
2002-12-08Add a capture routine for IP-over-FC, and call it from the capture code.Guy Harris1-1/+5
svn path=/trunk/; revision=6767
2002-10-19Suppress compiler warnings on platforms where "time_t" is a "long",Guy Harris1-3/+4
without introducing warnings where it's an "int". svn path=/trunk/; revision=6459
2002-10-16From Ulf Lamping: show total running time of capture in capture progressGuy Harris1-5/+35
dialog box. svn path=/trunk/; revision=6440
2002-10-14From Ulf Lamping: count ARP packets in capture progress dialog box.Guy Harris1-1/+3
svn path=/trunk/; revision=6416
2002-10-09From Ulf Lamping: keep "Update list of packets in real time" fromGuy Harris1-2/+5
crashing on Windows. svn path=/trunk/; revision=6387
2002-09-22From Graeme Hewson:Gerald Combs1-23/+22
It can sometimes happen that capturing is stopped just after Ethereal has switched to a new ring buffer. The result is that no frames are displayed. The patch to ringbuffer.c displays the previous ring buffer if the current buffer is empty on close. The patch to capture.c fixes a bug where an error return from ringbuf_wtap_dump_close was ignored, and tidies up the code around the call. svn path=/trunk/; revision=6315
2002-09-09From Graeme Hewson:Guy Harris1-5/+15
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. svn path=/trunk/; revision=6238
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-35/+35
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-13Not all compilers allow labels that don't have a statement followingGuy Harris1-3/+3
them. Put a "break;" statement after a case label that didn't have it. svn path=/trunk/; revision=5990
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-16/+12
equivalents for the toplevel directory. The removal of winsock2.h will hopefully not cause any problems under MSVC++, as those files using struct timeval still include wtap.h, which still includes winsock2.h. svn path=/trunk/; revision=5932
2002-07-16From Graeme Hewson:Guy Harris1-2/+2
Allow "-" as the output file name in Wiretap, referring to the standard error. Optimize the capture loop. Fix some of the error-message printing code in Ethereal and Tethereal. Have Wiretap check whether it can seek on a file descriptor, and pass the results of that test to the file-type-specific "open for output" routine. Have the "open for output" routines for files where we need to seek when writing the file return an error if seeks don't work. svn path=/trunk/; revision=5884
2002-07-16From Graeme Hewson:Guy Harris1-6/+3
In sync mode, if the capture file written by the child can't be opened by the parent, ethereal will write two identical popup error messages. This patch fixes the problem. svn path=/trunk/; revision=5883
2002-07-15Update the "NT sucks for PPP capture" note to include NT 5.1 (XP andGuy Harris1-25/+24
.NET Server). Fix indentation. svn path=/trunk/; revision=5882
2002-06-22On Windows, there's no "pipe_fd", so don't refer to it.Guy Harris1-17/+20
svn path=/trunk/; revision=5734