forked from FreeRTOS/FreeRTOS-Plus-TCP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc12b07
commit cd051a4
Showing
2 changed files
with
190 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,50 @@ | ||
# 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)", | ||
|
||
################################################################ | ||
|
||
"ENTRY": "DNS_ParseDNSReply", | ||
"TEST_PAYLOAD_SIZE": 5, | ||
"TEST_IPV4_PACKET_SIZE": 59, | ||
"TEST_IPV6_PACKET_SIZE": 79, | ||
"CBMCFLAGS": | ||
[ | ||
"--unwind 1", | ||
"--unwindset {PARSELOOP0}:{PARSELOOP0_UNWIND},{PARSELOOP1}:{PARSELOOP1_UNWIND},prvProcessDNSCache.0:5" | ||
"--unwindset DNS_ParseDNSReply.0:{TEST_PAYLOAD_SIZE}", | ||
"--unwindset DNS_ReadNameField.0:{TEST_PAYLOAD_SIZE}", | ||
"--unwindset DNS_ReadNameField.1:{TEST_PAYLOAD_SIZE}", | ||
"--unwindset parseDNSAnswer.0:{TEST_PAYLOAD_SIZE}", | ||
"--unwindset strncpy.0:{TEST_PAYLOAD_SIZE}" | ||
], | ||
"OPT": | ||
[ | ||
"--export-file-local-symbols" | ||
], | ||
|
||
"OBJS": | ||
[ | ||
"$(ENTRY)_harness.goto", | ||
"$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS.goto", | ||
"$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/tasks.goto" | ||
"$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS_Parser.goto", | ||
"$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto" | ||
], | ||
|
||
"DEF": | ||
[ | ||
"NETWORK_BUFFER_SIZE={NETWORK_BUFFER_SIZE}", | ||
"NAME_SIZE={NAME_SIZE}" | ||
{ | ||
"IPv4": | ||
[ | ||
"TEST_PACKET_SIZE={TEST_IPV4_PACKET_SIZE}", | ||
"ipconfigUSE_LLMNR=1", | ||
"ipconfigUSE_MDNS=1", | ||
"IS_TESTING_IPV6=0" | ||
] | ||
}, | ||
{ | ||
"IPv6": | ||
[ | ||
"TEST_PACKET_SIZE={TEST_IPV6_PACKET_SIZE}", | ||
"ipconfigUSE_LLMNR=1", | ||
"ipconfigUSE_MDNS=1", | ||
"IS_TESTING_IPV6=1" | ||
] | ||
} | ||
], | ||
"INC": | ||
[ | ||
"$(FREERTOS_PLUS_TCP)/test/cbmc/include" | ||
] | ||
} | ||
} |