tcpdump mailing list archives

pipeline buffering


From: jedge <d1m_bu1b () yahoo com>
Date: Sat, 10 Mar 2012 06:18:28 -0800 (PST)

When using the (-w) option in conjunction with the (-l) option, sending the binary network packets to stdout still 
buffers.
I am using tcpdump and all its glorious features as a front end filter to a similar process that handles the 
presentation layer.

I modified tcpdump.c near lines 822 (-i) and 956 (-w) to detect the need to flush stdout when utilizing the pipeline by 
adding
setvbuf(stdout, NULL, _IONBF, 0);
This allows my application to process and display theĀ  presentation layer as they come in, while still being able to do 
things such as
tcpdump -w - | tee <fileName> | <downstreamApp>


Hopefully this helps somebody.

Team,
Please consider adding this feature to the baseline.
Respectfully,
Bubbah
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: