# We pretend to do EDNS with a 4096 buffer size
response.use_edns(payload=4096)
- # What we use to fill the TXT records
- # Test number + 64, so 01 = 'A', 02 = 'B' etc...
- value = chr(testnum + 64)
-
# Each pre-RDATA answer RR is 12 bytes
# NAME: 2 (ptr to begin of packet, 0xC00C)
# TYPE: 2
# CLASS: 2
# TTL: 4
# RDLEN: 2
+ loop = 0
while packet_size > 0:
+ # What we use to fill the TXT records
+ # Test number + 64 + loop iteration, so 01 = 'A', 02 = 'B' etc...
+ # We take the loop iteration to not generate duplicate records
+ value = chr(testnum + 64 + loop)
+ loop += 1
# Remove the pre-RDATA length
packet_size -= 12
# And the TXT size indicator (first byte in the TXT record)