diff options
Diffstat (limited to 'FreeRTOS-Plus/Test/CBMC/proofs/ParseDNSReply/Makefile.json')
-rw-r--r-- | FreeRTOS-Plus/Test/CBMC/proofs/ParseDNSReply/Makefile.json | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/FreeRTOS-Plus/Test/CBMC/proofs/ParseDNSReply/Makefile.json b/FreeRTOS-Plus/Test/CBMC/proofs/ParseDNSReply/Makefile.json new file mode 100644 index 000000000..f372c41da --- /dev/null +++ b/FreeRTOS-Plus/Test/CBMC/proofs/ParseDNSReply/Makefile.json @@ -0,0 +1,68 @@ +# The proof depends on one parameter: +# NETWORK_BUFFER_SIZE is the size of the network buffer being parsed +# The buffer size must be bounded because we must bound the number of +# iterations loops iterating over the buffer. + +{ + "ENTRY": "ParseDNSReply", + +################################################################ +# This is the network buffer size. +# Reasonable values are size > 12 = sizeof(xDNSMessage) + "NETWORK_BUFFER_SIZE": 40, + +################################################################ +# This is the size of the buffer into which the name is copied. +# Set to any positive value. +# In the source, NAME_SIZE=254 and NETWORK_BUFFER_SIZE >> NAME_SIZE +# In the proof, NAME_SIZE >= 4 required for good coverage. + "NAME_SIZE": "10", + +################################################################ +# Loop prvParseDNSReply.0: +# file lib/FreeRTOS-Plus-TCP/source/FreeRTOS_DNS.c line 915 + "PARSELOOP0": "prvParseDNSReply.0", + +# M = sizeof( DNSMessage_t ) = 12 +# U = sizeof( uint32_t) = 4 +# Loop bound is (NETWORK_BUFFER_SIZE - M) div (U+1) + 1 tight for SIZE >= M +# Loop bound is 1 for 0 <= SIZE < M + "PARSELOOP0_UNWIND": + "__eval 1 if {NETWORK_BUFFER_SIZE} < 12 else ({NETWORK_BUFFER_SIZE} - 12) / 5 + 1", + +################################################################ +# Loop prvParseDNSReply.1: +# file lib/FreeRTOS-Plus-TCP/source/FreeRTOS_DNS.c line 989 + "PARSELOOP1": "prvParseDNSReply.1", + +# A = sizeof( DNSAnswerRecord_t ) = 10 +# M = sizeof( DNSMessage_t ) = 12 +# U = sizeof( uint32_t) = 4 +# Loop bound is (NETWORK_BUFFER_SIZE - M - A) div (A+1) + A + 1 tight +# for SIZE >= M + A +# Loop bound is (NETWORK_BUFFER_SIZE - M) + 1 for M <= SIZE < M + A +# Loop bound is 1 for 0 <= SIZE < M + "PARSELOOP1_UNWIND": + "__eval 1 if {NETWORK_BUFFER_SIZE} < 12 else ({NETWORK_BUFFER_SIZE} - 11 if {NETWORK_BUFFER_SIZE} < 22 else ({NETWORK_BUFFER_SIZE} - 12 - 10) / 11 + 11)", + +################################################################ + + "CBMCFLAGS": + [ + "--unwind 1", + "--unwindset {PARSELOOP0}:{PARSELOOP0_UNWIND},{PARSELOOP1}:{PARSELOOP1_UNWIND},prvProcessDNSCache.0:5" + ], + + "OBJS": + [ + "$(ENTRY)_harness.goto", + "$(FREERTOS)/../FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_DNS.goto", + "$(FREERTOS)/Source/tasks.goto" + ], + + "DEF": + [ + "NETWORK_BUFFER_SIZE={NETWORK_BUFFER_SIZE}", + "NAME_SIZE={NAME_SIZE}" + ] +} |