Open sborkows opened 2 years ago
PTF provides a lot of very convenient functions to form test packets (simple_*_packet())
simple_*_packet()
One thing that they do not allow is specifying the actual payload. Not only that, different functions use different payload for whatever reason.
For example, simple_tcp_packet uses:
pkt = pkt / codecs.decode("".join(["%02x" % (x % 256) for x in range(pktlen - len(pkt))]), "hex")
whereas simple_tcpv6_packet uses:
pkt /= "D" * (pktlen - len(pkt))
This makes direct comparisons a little difficult.
Here are two things which can changed:
Good idea 👍 The code of the testutils.py is in many places redundant. In the beginning, we can extract a "payload method", and standardize it.
testutils.py
PTF provides a lot of very convenient functions to form test packets (
simple_*_packet()
)One thing that they do not allow is specifying the actual payload. Not only that, different functions use different payload for whatever reason.
For example, simple_tcp_packet uses:
whereas simple_tcpv6_packet uses:
This makes direct comparisons a little difficult.
Here are two things which can changed: