aboutsummaryrefslogtreecommitdiffstats
path: root/capture_sync.c
AgeCommit message (Collapse)AuthorFilesLines
2013-01-14Declare count as ssize_t instead of size_t, since read(), and thus ↵Chris Maynard1-1/+1
ws_read(), can return a negative number. If that were to happen, then assigning the return value to an unsigned variable and then comparing that variable against 0 will yield incorrect/unintended results. Fixes Coverity CID 761910: Negative array index write. svn path=/trunk/; revision=47069
2012-12-29Add a few consts to fix some compiler (GCC) errors.Bill Meier1-1/+1
svn path=/trunk/; revision=46849
2012-12-26Make sure we don't sign-extend the (binary) bytes of the message length.Guy Harris1-1/+1
svn path=/trunk/; revision=46792
2012-12-26Use casts rather than changing the prototype of pipe_convert_header.Evan Huus1-9/+9
It has to be unsigned or else certain headers get misread due to signedness. svn path=/trunk/; revision=46790
2012-12-26Squash some sign-conversion warnings that g++ picks up but gcc doesEvan Huus1-3/+3
not. QtShark now builds warning-free (for me at least). svn path=/trunk/; revision=46786
2012-12-26Fix a bunch of warnings.Guy Harris1-22/+23
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
2012-12-12Make the "-g" argument to tshark actually work (by passing it to dumpcap).Jeff Morriss1-0/+4
svn path=/trunk/; revision=46515
2012-12-05Fix numerous instances of a variable/parameter name "shadowing" a library ↵Bill Meier1-3/+3
function name; (At least some (gcc ?) compilers give a "shadow" warning for these). svn path=/trunk/; revision=46402
2012-11-05From Bill Parker:Anders Broman1-0/+4
code fails to check/test return value from select() https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7861 svn path=/trunk/; revision=45917
2012-10-11Make sure sync_interface_stats_close calls sync_pipe_kill on allGerald Combs1-0/+7
platforms. This ham-fistedly fixes a delay when moving from the "Capture" item to the "Open" and "Learn" items on the welcome screen in the Qt version. svn path=/trunk/; revision=45475
2012-10-08Add a cast.Gerald Combs1-1/+1
svn path=/trunk/; revision=45407
2012-10-08Log the time we spend waiting for the capture child to exit.Gerald Combs1-1/+13
Add breadcrumbs so that we can switch from g_get_current_time to g_get_real_time when our minimum GLib version is >= 2.28. svn path=/trunk/; revision=45399
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45015
2012-08-24Revert r44644 and 44645. g_source_*, g_timeout_, and g_io_* all dependGerald Combs1-1/+0
on the GLib main loop which isn't portable (unless you want to want to manage the main loop yourself). svn path=/trunk/; revision=44655
2012-08-23Move the pipe input routines to the common UI directory.Gerald Combs1-0/+1
svn path=/trunk/; revision=44644
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-20Comment back in the body of tb80211_do_set_channel to avoid warnings aboutJörg Mayer1-0/+47
unused parameters. Add the missing functions by applying the skipped patches to capture_sync.[hc] svn path=/trunk/; revision=43414
2012-06-09Undo an accidental portion of the last commit.Chris Maynard1-1/+1
svn path=/trunk/; revision=43173
2012-06-09Be sure to specify FORMAT_MESSAGE_IGNORE_INSERTS in the dwFlags arg to all ↵Chris Maynard1-3/+3
FormatMessage() calls where FORMAT_MESSAGE_FROM_SYSTEM is also specified. (Ref: http://blogs.msdn.com/b/oldnewthing/archive/2007/11/28/6564257.aspx) svn path=/trunk/; revision=43172
2012-04-13From Evan Huus: fix memory leak. Fixes bug 7081.Guy Harris1-0/+3
svn path=/trunk/; revision=42057
2012-03-11If the length is bogus in a message received from the sync pipe, dumpGuy Harris1-2/+3
out all 4 bytes we read, to provide more information about the message that was sent so it's easier to see if something was spewing extra output to the standard output or error in the child. svn path=/trunk/; revision=41489
2012-01-25Third try. This time pipes and stdin are supported and theMichael Tüxen1-0/+2
test scripts are passed. Use a global list containing all interfaces and only change properties of the entries when changes are made in the GUI. Do not misuse the list of interfaces specified on the command line anymore. This patch does not provide any new functionality, it just provides the base for future extensions like removing remote interface, mulitple airpcap devices and multiple pipes. This patch was provided by Irene Ruengeler. svn path=/trunk/; revision=40715
2012-01-24We need a 3rd try. (After learning how to run the testuite on Windows locally).Michael Tüxen1-2/+0
svn path=/trunk/; revision=40695
2012-01-24Second try. This time pipes and stdin are supported.Michael Tüxen1-0/+2
Use a global list containing all interfaces and only change properties of the entries when changes are made in the GUI. Do not misuse the list of interfaces specified on the command line anymore. This patch does not provide any new functionality, it just provides the base for future extensions like removing remote interface, mulitple airpcap devices and multiple pipes. This patch was provided by Irene Ruengeler. svn path=/trunk/; revision=40693
2012-01-16Move some headers for UI stuff, and the alert_box.c UI-specific file, toGuy Harris1-1/+3
the ui directory. (Perhaps some other files that would be used by all flavors of Wireshark, for any GUI toolkit or for someting such as ncurses, and not for any command-line tool such as TShark, should be moved there as well.) Shuffle some #includes to put the "ui/XXX.h" includes together. svn path=/trunk/; revision=40529
2012-01-04Expand, and fix, a comment. Change a function argument name to matchGuy Harris1-7/+16
the name in the definition of the function it calls. svn path=/trunk/; revision=40367
2011-11-16Get rid of unnecessary assignment (the code below it always assigns aGuy Harris1-1/+0
value to the variable). Praise be to Clang Cat. svn path=/trunk/; revision=39877
2011-10-20Back out infrastructure change. We missed supportingMichael Tüxen1-2/+0
stdin and pipes. svn path=/trunk/; revision=39498
2011-10-20Use a global list containing all interfaces and only changeMichael Tüxen1-0/+2
properties of the entries when changes are made in the GUI. Do not misuse the list of interfaces specified on the command line anymore. This patch does not provide any new functionality, it just provides the base for future extensions like removing remote interface, mulitple airpcap devices and multiple pipes. This patch was provided by Irene Ruengeler. svn path=/trunk/; revision=39495
2011-08-24Fix prematurely-terminated comment.Guy Harris1-1/+1
svn path=/trunk/; revision=38696
2011-08-24Fix a comment; this includes describing an additional way in which weGuy Harris1-5/+13
could fail to open the capture file. svn path=/trunk/; revision=38695
2011-08-23Hopefully fixMichael Tüxen1-0/+2
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6256. svn path=/trunk/; revision=38694
2011-08-05Fix Windows build.Michael Tüxen1-3/+3
svn path=/trunk/; revision=38352
2011-08-05Simplification suggested by Guy.Michael Tüxen1-3/+1
svn path=/trunk/; revision=38351
2011-08-05Generate the capure sync pipe correctly.Michael Tüxen1-15/+37
Fix obtained from Irene Ruengeler. svn path=/trunk/; revision=38349
2011-06-28Replace all strerror() with g_strerror().Stig Bjørlykke1-15/+15
Remove our local strerror implementation. Mark strerror as locale unsafe API. This fixes bug 5715. svn path=/trunk/; revision=37812
2011-06-27Fix the bug reported by Guy. NowMichael Tüxen1-6/+0
tshark -i en0 icmpp returns a correct error message. svn path=/trunk/; revision=37806
2011-06-27Report the correct interface when there is a problem with a capture filter.Michael Tüxen1-5/+11
This patch is from Irene Ruengeler. svn path=/trunk/; revision=37804
2011-06-27Get rid of old non-interface specific settings which are now interfaceMichael Tüxen1-57/+8
specifc. This finalizes the change of the infrastructure. This patch is based on work by Irene Ruengeler. svn path=/trunk/; revision=37794
2011-06-17Make pcap-ng the default. Add a compile-time option to prefer pcap-ng orGerald Combs1-0/+2
pcap. Add a "-P" capture option which tries to use pcap instead of pcap-ng ("-P" seemed to be the best option but we may want to use a different letter). Update the documentation and release notes. svn path=/trunk/; revision=37696
2011-06-07Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings;Bill Meier1-684/+684
Also: whitespace cleanup. svn path=/trunk/; revision=37603
2011-05-21Fix the capturing from the GUI. Honor the iface variable.Michael Tüxen1-0/+7
The next step is to retire the iface variable and use the ifaces array only. This should simplify things and fix the cases, where you start wireshark with command line arguments and also use the GUI. svn path=/trunk/; revision=37342
2011-05-19In case we have no interface information in the array, use the global value.Michael Tüxen1-0/+48
This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5935. svn path=/trunk/; revision=37307
2011-05-19Move the debug output for the generated command line arguments to the ↵Michael Tüxen1-3/+3
correct place. svn path=/trunk/; revision=37276
2011-05-19Only declare a variable if its going to be used.Martin Mathieson1-0/+4
svn path=/trunk/; revision=37273
2011-05-18We don't have the ability to set the capture buffer size on all platforms.Guy Harris1-0/+2
svn path=/trunk/; revision=37255
2011-05-18Use the interface specific parameter array.Michael Tüxen1-69/+75
This enables the capturing from mulitple interfaces using tshark and wireshark (at the command line). (tshark -i lo0 -i en0) or (wireshark -k -i lo0 -i en0) works. You can capture from multiple remote and local interfaces. Based on work from Irene Ruengeler. svn path=/trunk/; revision=37248
2011-04-11Back out Jeff Morris's change to make the autostop file size 64-bit - itGuy Harris1-2/+2
didn't change the GUI code for setting the autostop file size, and that broke the build. svn path=/trunk/; revision=36552
2011-04-11Jeff Morris's change to make the autostop file size 64-bit. Fixes bugGuy Harris1-2/+2
5691. svn path=/trunk/; revision=36551
2010-07-02STATUS_UNWIND_CONSOLIDATE "should not happen", so don't include it -Guy Harris1-2/+0
we'd have to include some other headers to get it defined. Get rid of the include of Winbase.h - it doesn't define STATUS_UNWIND_CONSOLIDATE, and it's not necessary. svn path=/trunk/; revision=33413