How to Use VxWorks pcap Command for Network Packet Capture

If you forward this, please indicate the source!Those researching network communication should have used packet capture tools like Wireshark. A friend reminded me that VxWorks also provides a packet capture command – pcap, so I’ll give it a try today. This should be a feature integrated into the Interpeak protocol stack by Wind River, so version 6.4 and older probably don’t have this command.

VxWorks

This screenshot is of version 6.9. A small regret: this command can only be used in cmd mode. If you want to use it in C mode, you need to encapsulate parameters yourself, which is a bit more troublesome. First, enter cmd, and simply call pcap to view its help information.

VxWorks

As you can see, the parameters for pcap are not many, so it’s very easy to use.

Perform some network operations at will between start and stop, then check the captured data file. This file uses the same format as Wireshark, so next, download the Wireshark tool from the official website. https://www.wireshark.org/download.html

You can then open the captured data file directly with Wireshark.

Since pcap was invoked through Telnet just now, there’s a lot of Telnet-related information in the captured data.

It’s just that simple.