Tony,
> So ... a user script, (in python? or QtScript?) to generate a packet,
> compute the CRC, send it, receive it on a second interface, re-do the CRC
> and pass/fail the packet.
Yes, a python script which configures a stream, one of whose protocols
is a userscript. However, looking at the current support in
userscript, I see that you can't do a CRC32 - only a IP checksum.
Ideally, the userscript protocol should be the last protocol of the
stream and contain cksum of *all* the previous protocols . However, a
limitation of protocolFrameHeaderCksum() userscript function is that
it calculates the cksum of only the adjacent protocol, whereas
protocolFramePayloadCksum() userscript function does it for *all*
subsequent protocols, so you'll have to put the userscript protocol as
at least the second protocol in the stream (if possible) and combine
that result with result of protocolFramePayloadCksum() to calculate
the final cksum to be able to do a checksum over the entire packet.
> Alternatively, send a flow (possibly hundreds or thousands of packets), save
> the capture on the Tx side, then also save the capture on the Rx side, and
> post-process the entire capture files to locate any differences. The
> significant issue with directly diffing wireshark ascii capture files is the
> timestamps ... a pre-process would have to strip out timestamps and just
> compare the remaining bytes.
See if this pcapdiff tool helps -
http://sourceforge.net/projects/pcapdif/ (more tools on the wireshark
wiki -
https://wiki.wireshark.org/Tools)
Alternatively, Ostinato has some code to do a pcap diff when it
imports a pcap file using standard tools - tshark/awk/diff - ostinato
calls these tools through C++ code
(
http://code.google.com/p/ostinato/source/browse/common/pcapfileformat.cpp#256)
but that can easily be converted to a shell script
If you want to go with the original idea of just using the TCP/UDP
checksum - you can look at some sample code in
http://code.google.com/p/ostinato/source/browse/test/vftest.py which
tests that the checksum is valid.
Srivats