aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
AgeCommit message (Collapse)AuthorFilesLines
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
2002-06-13From Graeme Hewson: fix capture-from-pipe not to block when reading fromGuy Harris1-157/+333
the pipe, and clean up various other things. svn path=/trunk/; revision=5670
2002-06-07Add a Wiretap routine to process packets captured via libpcap, possiblyGuy Harris1-11/+18
extracting a pseudo-header, for the use of SunATM captures. Add support for SunATM capture. svn path=/trunk/; revision=5652
2002-06-07Just have "pcap_dispatch()" cons up a "strut pcap_pkthdr" and callGuy Harris1-46/+38
"capture_pcap_cb()", so it duplicates even less of the latter routine. svn path=/trunk/; revision=5648
2002-06-07Have a common routine for doing the packet counter stuff, rather thanGuy Harris1-68/+37
having two different versions, both broken in different ways. Bump the count of total packets in the capture-from-pipe routine. svn path=/trunk/; revision=5647
2002-06-07Pass the captured length, not the full length, to the "capture_"Guy Harris1-10/+17
routines. Call the 802.11 and Cisco HDLC capture routines for those packet types. svn path=/trunk/; revision=5646
2002-06-06From Michael Tuexen: remove the old workaround for "select()"s notGuy Harris1-14/+1
working on MacOS X. It appears that the underlying problem with the timeout was that we weren't treating MacOS X as a BSD, and the "select()" we were doing presumably wasn't working as it doesn't work on BPF devices on many BSDs; the workaround no longer appears to be necessary, with Michael's fix to treat MacOS X as BSD. (Presumably a select timeout with "tv_usec" set to 1000*1000 microseconds was treated as an error, or otherwise treated in such a way that it didn't block waiting for the BPF device to say it could be read.) svn path=/trunk/; revision=5637
2002-06-04From Michael Tuexen: treat Darwin/MacOS X like the other BSDs, as itsGuy Harris1-3/+3
BPF, in at least some OS versions, acts like the other BPFs in some versions of other BSDs, and doesn't work with "select()". svn path=/trunk/; revision=5620
2002-06-04From Graeme Hewson:Guy Harris1-53/+48
This fixes some bugs: 1. With the -S option under Linux, Capture/Stop or ^E was ignored until the next packet was read. This is because capture.c wasn't checking for EINTR from select(), which is returned when the child receives SIGUSR1 from the parent. 2. When reading from a pipe, a spurious error message from pcap_open_live() was written to stderr. 3. Error messages from the child in Sync mode were displayed in a Warning alert box. Also, there's a new subroutine, popup_errmsg(), to replace several instances of duplicate code. svn path=/trunk/; revision=5616
2002-05-04From Joerg Mayer: get rid of some unused arguments, and mark others asGuy Harris1-9/+16
unused. Put in a comment to note that if we fail to open the interface either as a device or as a pipe, we report the error from the failed "pcap_open_live()" (which explains why "pipe_open_live()" doesn't return an error string). svn path=/trunk/; revision=5381
2002-04-24From Joerg Mayer: get rid of extra arguments to capture routines.Guy Harris1-3/+3
svn path=/trunk/; revision=5233
2002-04-08Add an encapsulation type for "802.11 with radio information"; that typeGuy Harris1-1/+2
returns radio information such as signal strength, channel, and data rate in a pseudo-header. Add that pseudo-header. Use the "802.11 with radio information" encapsulation type for Wireless Sniffer files; extract the radio information from where it appears to be in the header. Add dissector code for that encapsulation type. Fix an error in the code to put radio information into the AiroPeek tree. Make the "wrapped" flag for NetXRay/Windows Sniffer captures a "gboolean". svn path=/trunk/; revision=5122
2002-02-24Put all the capture options into a structure.Guy Harris1-39/+36
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. svn path=/trunk/; revision=4799
2002-02-24"autostop_filesize" and "autostop_duration" don't need to be in theGuy Harris1-22/+43
"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. svn path=/trunk/; revision=4795
2002-02-08Have Wiretap set the snapshot length to 0 if it can't be derived fromGuy Harris1-11/+16
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. svn path=/trunk/; revision=4709
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-2/+2
"epan/..." pathnames, so as to avoid collisions with header files in any of the directories in which we look (e.g., "proto.h", as some other package has its own "proto.h" file which it installs in the top-level include directory). Don't add "-I" flags to search "epan", as that's no longer necessary (and we want includes of "epan" headers to fail if the "epan/" is left out, so that we don't re-introduce includes lacking "epan/"). svn path=/trunk/; revision=4586