aboutsummaryrefslogtreecommitdiffstats
path: root/capture_loop.h
AgeCommit message (Collapse)AuthorFilesLines
2007-04-13fix gcc warning about qualifier types (const) which are discarded when arrivingstandel1-1/+1
at the pcap interface. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21417 f5534014-38df-0310-8fa8-9805f1628bb7
2006-10-08from Richard van der Hoff:ulfl1-4/+3
> [tshark from a fifo] > Ulf - I notice you made the relevant change here (r16787) - is there any reason why tshark shouldn't use capture_loop_dispatch to do its processing, rather than attempting to use cap_pipe_dispatch or pcap_dispatch directly? well, there didn't seem to be, so I've made a patch which does exactly this, and which fixes the problem. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19456 f5534014-38df-0310-8fa8-9805f1628bb7
2006-09-22Add support for reading from stdin under Windows. Based on a patch sentgerald1-11/+5
in last year by Gianluca Varenni. Add partial support for reading from named pipes (currently disabled). Move utf_8to16() and utf_16to8() to a separate module (unicode-utils.[ch]) so that we don't have to cut and paste code in dumpcap.c. Fix up whitespace. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19291 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-31Tethereal/tethereal -> TShark/tshark.gerald1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18268 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-28Ethereal->Wiresharketxrab1-3/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18235 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-21Fix the only gerald@ethereal.com references left.guy1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18203 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-21If we have pcap_breakloop(), at least on UN*X we can stop the captureguy1-14/+35
with a pcap_breakloop() call - we don't need to call select() before calling pcap_dispatch(). Even if we do need to call select(), we don't need to supply it with a timeout - it's OK if we block indefinitely, as the signal will interrupt select(). That also means we can pass -1 as the count to pcap_dispatch(), as pcap_breakloop() will terminate the loop in pcap_dispatch(). Use sigaction() to catch SIGUSR1, so we can make sure that the signal handler doesn't get reset when the signal is delivered, and that system calls don't restart when we return from the signal handler. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18201 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-20The timeout is needed if you don't have pcap_breakloop(), so we'll putguy1-0/+26
it back for now; I'll fix it later not to do the timeout if we have pcap_breakloop(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18195 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-20Dumpcap doesn't need to ensure that it doesn't block indefinitely, as itguy1-26/+0
has no UI, nor does it need to ensure it processes only one packet at a time; get rid of the select stuff, and pass a count of -1 to pcap_dispatch() so it processes a single bufferfull of packets rather than just one packet at a time. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18194 f5534014-38df-0310-8fa8-9805f1628bb7
2006-04-03Put the low-level sync routines into a common file so they can be sharedguy1-0/+25
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17789 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-21Simplify the argument list to cap_pipe_dispatch().guy1-2/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17690 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-05Make some routines not used outside capture_loop.c static.guy1-7/+0
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17466 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-05Pass two strings in capture child messages, so the child can sendguy1-3/+11
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!). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17465 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-04When capturing, we only support writing to libpcap files. Given that,guy1-3/+5
bypass Wiretap; that means we don't have to run the packet through wtap_process_pcap_packet() and then undo that conversion in Wiretap if we're just going to write it out, shortening the code path. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17461 f5534014-38df-0310-8fa8-9805f1628bb7
2006-01-07move output_to_pipe flag from tethereal's loop_data into capture_opts, so it ↵ulfl1-2/+1
can be used by dumpcap (capture_loop.c) as well git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16972 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-14Constify a bunch of arguments and variables, to squelch compilerguy1-0/+8
warnings. Include "wiretap/libpcap.h" in "capture_loop.h", to get its declarations of data structures for headers in libpcap files. This lets us remove the includes of "wiretap/libpcap.h from files including "capture_loop.h". Make "log_func_ignore()" in "tethereal.c" static, and declare some of its arguments unused. Also get rid of an unused variable. Include <pcap.h> before including "wiretap/wtap-capture.h", to declare "struct pcap_pkthdr". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16791 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-13HUGE STEP (hopefully toward the right direction):ulfl1-0/+110
remove a lot of redundant code from tethereal and use (move) stuff from capture_loop.c instead. concentrate common capture related code in capture_opts.c, e.g. trying to find the right interface to capture from (command line option, preference, first usable) instead of duplicating this code over several files. remove redundant code from dumpcap.c this also implements command line option -D (and indexed interfaces at -i) for Ethereal and Dumpcap (as we have it in Tethereal already for a while) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16787 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-03split some parts of the packet counting functions into their own files ↵ulfl1-28/+0
capture_info(.c/.h), so we can use it from the main program git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16668 f5534014-38df-0310-8fa8-9805f1628bb7
2005-12-03split capture.h into capture.h, capture_loop.h and capture_opts.h and place ↵ulfl1-0/+71
the parts into the corresponding files git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16664 f5534014-38df-0310-8fa8-9805f1628bb7