On May 27, 2004, at 5:22 AM, Gisle Vanem wrote:
Since pcap_dump_close() doesn't have a pcap_t argument, where should
the oldmode come from? Can we have two module globals; oldmode_stdin,
oldmode_stdout, assuming stdin/stdout won't be opened for capture more
than once?
If it's opened for capture or
> Since pcap_dump_close() doesn't have a pcap_t argument, where should
> the oldmode come from? Can we have two module globals; oldmode_stdin,
> oldmode_stdout, assuming stdin/stdout won't be opened for capture more
> than once?
I've added a 'long filemode' to 'struct pcap' (long since O_BINARY
"Guy Harris" <[EMAIL PROTECTED]> said:
> Also, should we save the mode returned by "setmode()" and restore it
> when we close a "pcap_t" or "pcap_dumper_t" that refers to the standard
> input or output?
Since pcap_dump_close() doesn't have a pcap_t argument, where should
the oldmode come from?
On May 26, 2004, at 2:35 PM, Guy Harris wrote:
Also, that means that if it's writing to the standard output it won't
do a "setbuf()" even on Windows.
...which, of course, it isn't doing now, either - but now writing to
the standard output won't work right on Windows as it's writing in text
mode.
On May 26, 2004, at 2:16 PM, Gisle Vanem wrote:
I wasn't sure why either. Maybe reducing the chance of a file with
truncated packets. I just moved setbuf() further up.
Actually, you moved the "if (f == NULL)" check down, leaving the
"setbuf()" where it was, and also removed the "#ifdef WIN32"/"#en
"Guy Harris" <[EMAIL PROTECTED]> said:
> Also, is "setmode()" sufficient with all the compilers that could be
> used to compile libpcap/WinPcap on Windows (MSVC++, MinGW, etc.), or is
> "_setmode()" needed with some compilers? (The code currently uses
> "_setmode()".)
MSVC/MingW/CygWin have b
On May 26, 2004, at 1:55 AM, Gisle Vanem wrote:
I feel it's high time we cleanup some of the sources. I'd start
with savefile.c. Currently it doesn't work for offline data from stdin.
--gv
--- libpcap-2004.05.20/savefile.c Tue Mar 23 21:18:08 2004
+++ savefile.c Wed Mar 24 16:29:06 2004
@@ -
I feel it's high time we cleanup some of the sources. I'd start
with savefile.c. Currently it doesn't work for offline data from stdin.
--gv
--- libpcap-2004.05.20/savefile.c Tue Mar 23 21:18:08 2004
+++ savefile.c Wed Mar 24 16:29:06 2004
@@ -52,6 +52,12 @@
#define TCPDUMP_MAGIC 0xa1b2c3d