简体   繁体   中英

How can I pipe tsharks output in realtime to c# program

Like the title says, I am wondering how I can output tshark(wireshark command line) packets directly to my c# application.

I would like to output the packets so I can process the individual packets in my application.

For instance redirect output, and add a callback to handle each packet and then process each individual packet.

Could anyone with similar experience or even any idea how to do this help me out? It would be very appreciated.

You can use the -l option of tshark . From the documentation:

-l

[....]

This may be useful when piping the output of TShark to another program, as it means that the program to which the output is piped will see the dissected data for a packet as soon as TShark sees the packet and generates that output, rather than seeing it only when the standard output buffer containing that data fills up.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM