├── test ├── cbmc │ ├── windows │ │ ├── WinBase.h │ │ ├── Windows.h │ │ ├── direct.h │ │ └── README.md │ ├── windows2 │ │ ├── timeapi.h │ │ ├── windows.h │ │ ├── winsock.h │ │ ├── mmsystem.h │ │ └── winbase.h │ ├── patches │ │ ├── __init__.py │ │ ├── .gitignore │ │ ├── .gitattributes │ │ ├── __pycache__ │ │ │ ├── patch.cpython-36.pyc │ │ │ ├── compute_patch.cpython-36.pyc │ │ │ └── patches_constants.cpython-36.pyc │ │ ├── README.md │ │ ├── Makefile │ │ └── patch.py │ ├── .gitignore │ ├── proofs │ │ ├── DHCP │ │ │ ├── IsDHCPSocket │ │ │ │ ├── README.md │ │ │ │ └── Makefile.json │ │ │ ├── DHCPProcessEndPoint │ │ │ │ ├── cbmc-viewer.json │ │ │ │ ├── README.md │ │ │ │ └── Makefile.json │ │ │ └── DHCPProcess │ │ │ │ └── Makefile.json │ │ ├── ARP │ │ │ ├── ARPAgeCache │ │ │ │ ├── README.md │ │ │ │ └── Makefile.json │ │ │ ├── ARP_FreeRTOS_ClearARP │ │ │ │ ├── README.md │ │ │ │ ├── Makefile.json │ │ │ │ └── ClearARP_harness.c │ │ │ ├── ARPGetCacheEntryByMac │ │ │ │ ├── README.md │ │ │ │ ├── Makefile.json │ │ │ │ └── ARPGetCacheEntryByMac_harness.c │ │ │ ├── ARPProcessPacket │ │ │ │ ├── README.md │ │ │ │ └── Makefile.json │ │ │ ├── ARPRefreshCacheEntry │ │ │ │ ├── README.md │ │ │ │ ├── Configurations.json │ │ │ │ └── ARPRefreshCacheEntry_harness.c │ │ │ ├── ARP_FreeRTOS_PrintARPCache │ │ │ │ ├── README.md │ │ │ │ ├── Makefile.json │ │ │ │ └── FreeRTOS_PrintARPCache_harness.c │ │ │ ├── ARPGenerateRequestPacket │ │ │ │ ├── README.md │ │ │ │ ├── Makefile.json │ │ │ │ └── ARPGenerateRequestPacket_harness.c │ │ │ ├── ARPSendGratuitous │ │ │ │ ├── README.md │ │ │ │ ├── ARPSendGratuitous_harness.c │ │ │ │ └── Makefile.json │ │ │ ├── ARPGetCacheEntry │ │ │ │ ├── README.md │ │ │ │ ├── Configurations.json │ │ │ │ └── ARPGetCacheEntry_harness.c │ │ │ ├── xCheckRequiresARPResolution │ │ │ │ └── Makefile.json │ │ │ ├── ulARPRemoveCacheEntryByMac │ │ │ │ ├── Makefile.json │ │ │ │ └── ulARPRemoveCacheEntryByMac_harness.c │ │ │ ├── ARP_OutputARPRequest_buffer_alloc1 │ │ │ │ └── README.md │ │ │ └── ARP_FreeRTOS_OutputARPRequest │ │ │ │ └── README.md │ │ ├── .gitignore │ │ ├── README.md │ │ ├── DNS │ │ │ ├── DNSgetHostByName │ │ │ │ └── cbmc-viewer.json │ │ │ ├── DNSHandlePacket │ │ │ │ ├── Makefile.json │ │ │ │ └── DNShandlePacket_harness.c │ │ │ ├── DNSgetHostByName_a │ │ │ │ └── cbmc-viewer.json │ │ │ ├── DNSclear │ │ │ │ ├── DNSclear_harness.c │ │ │ │ └── Makefile.json │ │ │ ├── NBNSHandlePacket │ │ │ │ ├── Makefile.json │ │ │ │ └── NBNSHandlePacket_harness.c │ │ │ ├── prepareReplyDNSMessage │ │ │ │ └── Makefile.json │ │ │ ├── CreateDNSMessage │ │ │ │ └── Makefile.json │ │ │ ├── DNSlookup │ │ │ │ ├── Makefile.json │ │ │ │ └── DNSlookup_harness.c │ │ │ ├── DNSTreatNBNS │ │ │ │ └── Makefile.json │ │ │ └── DNSgetHostByName_cancel │ │ │ │ └── Makefile.json │ │ ├── xRecv_Update_IPv4 │ │ │ └── Makefile.json │ │ ├── xRecv_Update_IPv6 │ │ │ ├── Makefile.json │ │ │ └── xRecv_Update_IPv6_harness.c │ │ ├── TCP │ │ │ ├── prvTCPReturnPacket │ │ │ │ └── README.md │ │ │ ├── prvSendData │ │ │ │ └── Makefile.json │ │ │ ├── prvTCPPrepareSend │ │ │ │ └── README.md │ │ │ ├── prvTCPHandleState │ │ │ │ └── README.md │ │ │ ├── prvHandleListen │ │ │ │ └── Makefile.json │ │ │ ├── prvHandleListen_IPv6 │ │ │ │ └── Makefile.json │ │ │ └── prvTCPReturnPacket_IPv6 │ │ │ │ └── Makefile.json │ │ ├── IP │ │ │ ├── ConsiderFrameForProcessing │ │ │ │ └── Makefile.json │ │ │ ├── HandleEthernetPacket │ │ │ │ └── Makefile.json │ │ │ ├── SendEventToIPTask │ │ │ │ ├── README.md │ │ │ │ └── Makefile.json │ │ │ └── ProcessEthernetPacket │ │ │ │ └── Makefile.json │ │ ├── ICMP │ │ │ ├── ProcessICMPPacket │ │ │ │ └── Makefile.json │ │ │ └── ProcessICMPEchoRequest │ │ │ │ └── Makefile.json │ │ ├── Socket │ │ │ ├── lTCPAddRxdata │ │ │ │ └── Makefile.json │ │ │ ├── prvRecvFrom_CopyPacket │ │ │ │ └── Makefile.json │ │ │ ├── vSocketWakeUpUser │ │ │ │ └── Makefile.json │ │ │ ├── vSocketBind │ │ │ │ ├── ALLOW_SOCKET_SEND_WITHOUT_BIND │ │ │ │ │ └── Makefile.json │ │ │ │ ├── DONT_ALLOW_SOCKET_SEND_WITHOUT_BIND │ │ │ │ │ └── Makefile.json │ │ │ │ └── ALLOW_ETHERNET_DRIVER_FILTERS_PACKETS │ │ │ │ │ └── Makefile.json │ │ │ └── vSocketClose │ │ │ │ └── Configurations.json │ │ ├── Routing │ │ │ └── MatchingEndpoint │ │ │ │ └── Makefile.json │ │ ├── TCPWin │ │ │ └── vTCPWindowDestroy │ │ │ │ └── Makefile.json │ │ ├── RA │ │ │ ├── vReceiveRA_ReadReply │ │ │ │ └── Makefile.json │ │ │ └── vReceiveRA │ │ │ │ └── Makefile.json │ │ ├── DHCPv6 │ │ │ ├── DHCPv6HandleOption │ │ │ │ └── Makefile.json │ │ │ ├── SendDHCPMessage │ │ │ │ └── Makefile.json │ │ │ ├── DHCPv6Analyse │ │ │ │ └── Makefile.json │ │ │ ├── Process_PassReplyToEndPoint │ │ │ │ └── Makefile.json │ │ │ ├── DHCPv6ProcessEndPoint │ │ │ │ └── Makefile.json │ │ │ └── DHCPv6Process │ │ │ │ └── Makefile.json │ │ ├── IPUtils │ │ │ ├── pxDuplicateNetworkBufferWithDescriptor │ │ │ │ └── Makefile.json │ │ │ ├── prvPacketBuffer_to_NetworkBuffer │ │ │ │ └── Makefile.json │ │ │ ├── pxUDPPayloadBuffer_to_NetworkBuffer │ │ │ │ └── Makefile.json │ │ │ ├── usGenerateProtocolChecksum │ │ │ │ └── Makefile.json │ │ │ └── usGenerateProtocolChecksum_IPv6 │ │ │ │ └── Makefile.json │ │ ├── MakefileLinux.json │ │ ├── ND │ │ │ ├── prvReturnICMP_IPv6 │ │ │ │ └── Makefile.json │ │ │ └── prvProcessICMPMessage_IPv6 │ │ │ │ └── Makefile.json │ │ ├── parsing │ │ │ ├── ProcessReceivedUDPPacket_IPv6 │ │ │ │ └── Makefile.json │ │ │ ├── ProcessReceivedTCPPacket_IPv6 │ │ │ │ └── Makefile.json │ │ │ ├── ProcessIPPacket_IPv6 │ │ │ │ ├── eHandleIPv6ExtensionHeaders │ │ │ │ │ └── Makefile.json │ │ │ │ └── prvAllowIPPacketIPv6 │ │ │ │ │ └── Configurations.json │ │ │ ├── ProcessReceivedUDPPacket │ │ │ │ └── Makefile.json │ │ │ ├── ProcessIPPacket │ │ │ │ └── Configurations.json │ │ │ └── ProcessReceivedTCPPacket │ │ │ │ └── Makefile.json │ │ ├── MakefileWindows.json │ │ ├── CheckOptionsOuter │ │ │ └── Makefile.json │ │ ├── CheckOptions │ │ │ └── Makefile.json │ │ ├── UDP │ │ │ ├── vProcessGeneratedUDPPacket │ │ │ │ └── Makefile.json │ │ │ └── vProcessGeneratedUDPPacket_IPv6 │ │ │ │ └── Makefile.json │ │ ├── CheckOptionsInner │ │ │ └── Makefile.json │ │ ├── SkipNameField │ │ │ ├── Makefile.json │ │ │ └── SkipNameField_harness.c │ │ ├── prvChecksumIPv6Checks │ │ │ ├── Makefile.json │ │ │ └── prvChecksumIPv6Checks_harness.c │ │ ├── CMakeLists.txt │ │ ├── MakefileCommon.json │ │ ├── utility │ │ │ └── memory_assignments.c │ │ ├── CBMCStubLibrary │ │ │ └── tasksStubs.c │ │ └── ProcessDHCPReplies │ │ │ └── ProcessDHCPReplies_harness.c │ ├── include │ │ ├── README.md │ │ ├── aws_freertos_ip_verification_access_ip_define.h │ │ ├── tasksStubs.h │ │ └── aws_freertos_tcp_verification_access_tcp_define.h │ ├── cmake │ │ ├── model-check.cmake │ │ ├── compute-coverage.cmake │ │ └── compute-property.cmake │ └── stubs │ │ └── cbmc.c ├── unit-test │ ├── ConfigFiles │ │ ├── WinBase.h │ │ ├── Windows.h │ │ ├── pack_struct_end.h │ │ └── pack_struct_start.h │ ├── FreeRTOS_TCP_WIN │ │ └── FreeRTOS_TCP_WIN_mock.h │ ├── FreeRTOS_DHCP │ │ └── FreeRTOS_DHCP_mock.h │ ├── cmock │ │ └── project.yml │ ├── FreeRTOS_ARP_DataLenLessThanMinPacket │ │ └── ARP_DataLenLessThanMinPacket_list_macros.h │ ├── FreeRTOS_TCP_State_Handling_IPv4 │ │ └── TCP_State_Handling_IPv4_list_macros.h │ ├── FreeRTOS_TCP_Transmission_IPv6 │ │ └── TCP_Transmission_IPv6_list_macros.h │ ├── FreeRTOS_TCP_Reception │ │ └── FreeRTOS_TCP_Reception_stubs.c │ └── FreeRTOS_TCP_State_Handling_IPv6 │ │ └── TCP_State_Handling_IPv6_list_macros.h ├── CMakeLists.txt └── Coverity │ └── ConfigFiles │ └── pack_struct_start.h ├── ReadMe.url ├── source └── portable │ ├── NetworkInterface │ ├── LPC18xx │ │ ├── ReadMe.txt │ │ ├── CMakeLists.txt │ │ └── README.md │ ├── STM32 │ │ ├── Legacy │ │ │ ├── STM32Fxx │ │ │ │ ├── stm32f2xx_hal_eth.h │ │ │ │ ├── stm32f4xx_hal_eth.h │ │ │ │ ├── stm32f7xx_hal_eth.h │ │ │ │ └── CMakeLists.txt │ │ │ └── STM32Hxx │ │ │ │ ├── stm32h7xx_hal_eth.h │ │ │ │ └── CMakeLists.txt │ │ └── CMakeLists.txt │ ├── MPS3_AN552 │ │ ├── CMSIS_Driver │ │ │ └── CMakeLists.txt │ │ ├── CMakeLists.txt │ │ └── Device │ │ │ └── Include │ │ │ └── system_SSE300MPS3.h │ ├── MPS4_CS315 │ │ ├── CMSIS_Driver │ │ │ └── CMakeLists.txt │ │ ├── CMakeLists.txt │ │ └── Device │ │ │ └── Include │ │ │ └── system_SSE315.h │ ├── README_DRIVER_DISCLAIMER.txt │ ├── board_family │ │ ├── ReadMe.txt │ │ └── CMakeLists.txt │ ├── NXP1060 │ │ └── CMakeLists.txt │ ├── TM4C │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── TM4C-README.md │ ├── ATSAME5x │ │ └── CMakeLists.txt │ ├── mw300_rd │ │ ├── CMakeLists.txt │ │ └── README.md │ ├── loopback │ │ └── CMakeLists.txt │ ├── RX │ │ └── CMakeLists.txt │ ├── M487 │ │ ├── CMakeLists.txt │ │ └── README.md │ ├── DriverSAM │ │ └── CMakeLists.txt │ ├── ksz8851snl │ │ └── CMakeLists.txt │ ├── Zynq │ │ ├── uncached_memory.h │ │ ├── x_emacpsif_hw.h │ │ └── x_topology.h │ ├── xilinx_ultrascale │ │ ├── uncached_memory.h │ │ ├── x_emacpsif_hw.h │ │ └── x_topology.h │ ├── ThirdParty │ │ └── MSP432 │ │ │ └── CMakeLists.txt │ ├── WinPCap │ │ └── CMakeLists.txt │ ├── ATSAM4E │ │ └── CMakeLists.txt │ ├── SH2A │ │ ├── CMakeLists.txt │ │ └── README.md │ ├── esp32 │ │ ├── CMakeLists.txt │ │ └── README.md │ ├── LPC17xx │ │ ├── CMakeLists.txt │ │ └── README.md │ ├── LPC54018 │ │ ├── CMakeLists.txt │ │ └── README.md │ ├── MPS2_AN385 │ │ ├── CMakeLists.txt │ │ └── ether_lan9118 │ │ │ └── smsc9220_emac_config.h │ ├── libslirp │ │ └── CMakeLists.txt │ ├── pic32mzef │ │ ├── CMakeLists.txt │ │ └── README.md │ └── linux │ │ └── CMakeLists.txt │ ├── Compiler │ ├── CompilerName │ │ └── ReadMe.txt │ ├── MPLAB_XC │ │ └── pack_struct_start.h │ ├── IAR │ │ └── pack_struct_end.h │ ├── CCS │ │ ├── pack_struct_end.h │ │ └── pack_struct_start.h │ ├── Tasking │ │ ├── pack_struct_end.h │ │ └── pack_struct_start.h │ ├── Keil │ │ └── pack_struct_end.h │ ├── GCC │ │ ├── pack_struct_end.h │ │ └── pack_struct_start.h │ └── MSVC │ │ ├── pack_struct_start.h │ │ └── pack_struct_end.h │ └── CMakeLists.txt ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── documentation-issue.md │ ├── feature-request.md │ └── bug_report.md ├── CODE_OF_CONDUCT.md ├── SECURITY.md ├── pull_request_template.md ├── CODEOWNERS └── workflows │ └── release-candidate.yml ├── .gitmodules ├── .gitignore ├── manifest.yml ├── cspell.config.yaml ├── readme.txt ├── tools ├── tcp_utilities │ └── tcp_netstat.md └── CMakeLists.txt └── LICENSE.md /test/cbmc/windows/WinBase.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/cbmc/windows/Windows.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/cbmc/windows/direct.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/cbmc/windows2/timeapi.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/cbmc/windows2/windows.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/cbmc/windows2/winsock.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/cbmc/patches/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/cbmc/windows2/mmsystem.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/cbmc/patches/.gitignore: -------------------------------------------------------------------------------- 1 | auto_patch* 2 | patched 3 | -------------------------------------------------------------------------------- /test/cbmc/windows2/winbase.h: -------------------------------------------------------------------------------- 1 | /* Empty file for CBMC. */ 2 | -------------------------------------------------------------------------------- /test/unit-test/ConfigFiles/WinBase.h: -------------------------------------------------------------------------------- 1 | /* Nothing to do */ 2 | -------------------------------------------------------------------------------- /test/unit-test/ConfigFiles/Windows.h: -------------------------------------------------------------------------------- 1 | /* Nothing to do */ 2 | -------------------------------------------------------------------------------- /test/cbmc/.gitignore: -------------------------------------------------------------------------------- 1 | cbmc.txt 2 | property.xml 3 | coverage.xml 4 | *.goto 5 | **/html/* -------------------------------------------------------------------------------- /test/cbmc/proofs/DHCP/IsDHCPSocket/README.md: -------------------------------------------------------------------------------- 1 | This is the memory safety proof for IsDCHPSocket. 2 | -------------------------------------------------------------------------------- /test/cbmc/patches/.gitattributes: -------------------------------------------------------------------------------- 1 | # It seems git apply does not want crlf line endings on Windows 2 | *.patch eol=lf 3 | -------------------------------------------------------------------------------- /ReadMe.url: -------------------------------------------------------------------------------- 1 | [{000214A0-0000-0000-C000-000000000046}] 2 | Prop3=19,2 3 | [InternetShortcut] 4 | URL=http://www.freertos.org/tcp 5 | IDList= 6 | -------------------------------------------------------------------------------- /test/cbmc/include/README.md: -------------------------------------------------------------------------------- 1 | This directory contains include files used by the CBMC proofs: 2 | * cbmc.h defines some macros used in the proof test harnesses 3 | -------------------------------------------------------------------------------- /test/cbmc/patches/__pycache__/patch.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeRTOS/FreeRTOS-Plus-TCP/HEAD/test/cbmc/patches/__pycache__/patch.cpython-36.pyc -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPAgeCache/README.md: -------------------------------------------------------------------------------- 1 | Assuming that xNetworkInterfaceOutput is memory safe, 2 | this harness proves the memory safety of the vARPAgeCache function. 3 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/LPC18xx/ReadMe.txt: -------------------------------------------------------------------------------- 1 | NetworkInterface.c: 2 | Requires NXP's LPCOpen library and was developed on an LPC1830 and LPC1835 Xplorer 3 | boards from NGX. -------------------------------------------------------------------------------- /test/cbmc/patches/__pycache__/compute_patch.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeRTOS/FreeRTOS-Plus-TCP/HEAD/test/cbmc/patches/__pycache__/compute_patch.cpython-36.pyc -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARP_FreeRTOS_ClearARP/README.md: -------------------------------------------------------------------------------- 1 | This proof demonstrates the memory safety of the ClearARP function in the FreeRTOS_ARP.c file. 2 | No restrictions are made. -------------------------------------------------------------------------------- /test/cbmc/patches/__pycache__/patches_constants.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FreeRTOS/FreeRTOS-Plus-TCP/HEAD/test/cbmc/patches/__pycache__/patches_constants.cpython-36.pyc -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPGetCacheEntryByMac/README.md: -------------------------------------------------------------------------------- 1 | ARPGetCacheEntryByMac is memory safe, 2 | if it is enabled. 3 | 4 | ARPGetCacheEntryByMac does not use multiple configurations internally. 5 | -------------------------------------------------------------------------------- /test/cbmc/windows/README.md: -------------------------------------------------------------------------------- 1 | This directory contains include files used by the CBMC proofs: 2 | * Windows.h and WinBase.h are include files used to build FreeRTOS (the parts we currently test) on Linux -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPProcessPacket/README.md: -------------------------------------------------------------------------------- 1 | The proofs in the subdirectories show that 2 | ARPProcessPacket is memory safe independent 3 | of the configuration value of 4 | ipconfigARP_USE_CLASH_DETECTION. -------------------------------------------------------------------------------- /test/cbmc/proofs/.gitignore: -------------------------------------------------------------------------------- 1 | # These files are generated by make_type_header_files.py 2 | *_datastructure.h 3 | 4 | Makefile 5 | Makefile.common 6 | cbmc-batch.yaml 7 | **/*.txt 8 | **/*.goto 9 | 10 | !CMakeLists.txt 11 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPRefreshCacheEntry/README.md: -------------------------------------------------------------------------------- 1 | The proofs in this directory guarantee together that 2 | ARPRefreshCacheEntry is memory safe independent 3 | of the configuration value of 4 | ipconfigARP_STORES_REMOTE_ADDRESSES. 5 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARP_FreeRTOS_PrintARPCache/README.md: -------------------------------------------------------------------------------- 1 | FreeRTOS_PrintARPCache_harness.c is memory safe, 2 | assuming vLoggingPrintf is correct and memory safe. 3 | 4 | FreeRTOS_PrintARPCache does not use multiple configurations. 5 | -------------------------------------------------------------------------------- /source/portable/Compiler/CompilerName/ReadMe.txt: -------------------------------------------------------------------------------- 1 | Update pack_struct_start.h and pack_struct_end.h for your architecture. 2 | These files define the specifiers needed by your compiler to properly pack struct data 3 | need by FreeRTOS+TCP. 4 | -------------------------------------------------------------------------------- /test/cbmc/proofs/README.md: -------------------------------------------------------------------------------- 1 | This directory contains the proofs checked by CBMC. For each entry point of FreeRTOS-Plus-TCP tested, there is a directory that contains the test harness and cbmc configuration information needed to check the proof. 2 | -------------------------------------------------------------------------------- /test/unit-test/FreeRTOS_TCP_WIN/FreeRTOS_TCP_WIN_mock.h: -------------------------------------------------------------------------------- 1 | #include "FreeRTOS_DHCP.h" 2 | 3 | eDHCPCallbackAnswer_t xApplicationDHCPHook( eDHCPCallbackPhase_t eDHCPPhase, 4 | uint32_t ulIPAddress ); 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: FreeRTOS Community Support Forum 4 | url: https://forums.freertos.org/ 5 | about: Please ask and answer questions about FreeRTOS-Plus-TCP here. 6 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(FREERTOS_PLUS_TCP_ENABLE_BUILD_CHECKS) 2 | add_subdirectory(build-combination) 3 | endif() 4 | 5 | if(FREERTOS_PLUS_TCP_BUILD_TEST) 6 | add_subdirectory(Coverity) 7 | add_subdirectory(unit-test) 8 | endif() 9 | 10 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPGenerateRequestPacket/README.md: -------------------------------------------------------------------------------- 1 | Given that the pointer target of xNetworkDescriptor.pucEthernetBuffer is allocated 2 | to the size claimed in xNetworkDescriptor.xDataLength, 3 | this harness proves the memory safety of ARPGenerateRequestPacket. -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPSendGratuitous/README.md: -------------------------------------------------------------------------------- 1 | Abstracting xQueueGenericSend away 2 | and including tasks.c and FreeRTOS_IP.c: 3 | The ARPSendGratuitous function is memory safe, 4 | if xQueueGenericSend is memory safe. 5 | 6 | queue.c is not compiled into the proof binary. -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tools/CMock"] 2 | path = tools/CMock 3 | url = https://github.com/ThrowTheSwitch/CMock 4 | update = none 5 | [submodule "test/FreeRTOS-Kernel"] 6 | path = test/FreeRTOS-Kernel 7 | url = https://github.com/FreeRTOS/FreeRTOS-Kernel 8 | update = none 9 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/STM32/Legacy/STM32Fxx/stm32f2xx_hal_eth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Ethernet header files for STM32F2, STM32F4 and STM32F7 have been merged to 3 | * a single module that works for both parts: "stm32fxx_hal_eth" 4 | */ 5 | 6 | #include "stm32fxx_hal_eth.h" 7 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/STM32/Legacy/STM32Fxx/stm32f4xx_hal_eth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Ethernet header files for STM32F2, STM32F4 and STM32F7 have been merged to 3 | * a single module that works for both parts: "stm32fxx_hal_eth" 4 | */ 5 | 6 | #include "stm32fxx_hal_eth.h" 7 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/STM32/Legacy/STM32Fxx/stm32f7xx_hal_eth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Ethernet header files for STM32F2, STM32F4 and STM32F7 have been merged to 3 | * a single module that works for both parts: "stm32fxx_hal_eth" 4 | */ 5 | 6 | #include "stm32fxx_hal_eth.h" 7 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/STM32/Legacy/STM32Hxx/stm32h7xx_hal_eth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Ethernet header files for STM32F2, STM32F4 and STM32F7 have been merged to 3 | * a single module that works for both parts: "stm32hxx_hal_eth" 4 | */ 5 | 6 | #include "stm32hxx_hal_eth.h" 7 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/DNSgetHostByName/cbmc-viewer.json: -------------------------------------------------------------------------------- 1 | { "expected-missing-functions": 2 | [ 3 | "vLoggingPrintf", 4 | "xApplicationGetRandomNumber", 5 | "xTaskGetTickCount" 6 | ], 7 | "proof-name": "DNSgetHostByName", 8 | "proof-root": "tools/cbmc/proofs" 9 | } 10 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPGetCacheEntry/README.md: -------------------------------------------------------------------------------- 1 | The combined proofs in the subdirectories prove that ARPGetCacheEntry 2 | is memory safe for all possible combinations of ipconfigARP_STORES_REMOTE_ADDRESSES 3 | and ipconfigUSE_LLMNR. These are the only configuration 4 | parameters used inside the ARPGetCacheEntry. 5 | -------------------------------------------------------------------------------- /test/cbmc/include/aws_freertos_ip_verification_access_ip_define.h: -------------------------------------------------------------------------------- 1 | eFrameProcessingResult_t publicProcessIPPacket( IPPacket_t * const pxIPPacket, 2 | NetworkBufferDescriptor_t * const pxNetworkBuffer ) 3 | { 4 | prvProcessIPPacket( pxIPPacket, pxNetworkBuffer ); 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore MacOS file system related. 2 | **/*.DS_Store* 3 | 4 | # Ignore build results 5 | [Dd]ebug/ 6 | [Dd]ebugPublic/ 7 | [Dd]ebug_with_Libslirp/ 8 | [Rr]elease/ 9 | [Rr]eleases/ 10 | [Bb]in/ 11 | [Oo]bj/ 12 | [Ll]og/ 13 | [Ll]ogs/ 14 | [Bb]uild/ 15 | __pycache__/ 16 | 17 | **/*.d 18 | **/*.o 19 | **/*.su 20 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPSendGratuitous/ARPSendGratuitous_harness.c: -------------------------------------------------------------------------------- 1 | /* / * FreeRTOS includes. * / */ 2 | #include "FreeRTOS.h" 3 | #include "queue.h" 4 | 5 | /* FreeRTOS+TCP includes. */ 6 | #include "FreeRTOS_IP.h" 7 | #include "FreeRTOS_ARP.h" 8 | 9 | 10 | void harness() 11 | { 12 | vARPSendGratuitous(); 13 | } 14 | -------------------------------------------------------------------------------- /test/cbmc/include/tasksStubs.h: -------------------------------------------------------------------------------- 1 | #ifndef INC_TASK_STUBS_H 2 | #define INC_TASK_STUBS_H 3 | 4 | #include "FreeRTOS.h" 5 | #include "task.h" 6 | 7 | BaseType_t xState; 8 | void vInitTaskCheckForTimeOut( BaseType_t maxCounter, 9 | BaseType_t maxCounter_limit ); 10 | 11 | #endif /* INC_TASK_STUBS_H */ 12 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/DNSHandlePacket/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "DNShandlePacket", 3 | "CBMCFLAGS": "--unwind 1", 4 | "OBJS": 5 | [ 6 | "$(ENTRY)_harness.goto", 7 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS.goto", 8 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto" 9 | ], 10 | "DEF": 11 | [ 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/unit-test/FreeRTOS_DHCP/FreeRTOS_DHCP_mock.h: -------------------------------------------------------------------------------- 1 | #include "FreeRTOS_DHCP.h" 2 | 3 | eDHCPCallbackAnswer_t xApplicationDHCPHook_Multi( eDHCPCallbackPhase_t eDHCPPhase, 4 | struct xNetworkEndPoint * pxEndPoint, 5 | IP_Address_t * pxIPAddress ); 6 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /test/cbmc/patches/README.md: -------------------------------------------------------------------------------- 1 | This directory includes patches to FreeRTOS required to run the CBMC proofs. 2 | 3 | The patches fall into three classes: 4 | * First is a refactoring of prvCheckOptions 5 | * Second is the removal of static attributes from some functions 6 | * Third is two patches dealing with shortcomings of CBMC that should be removed soon. -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | ## Reporting a Vulnerability 2 | 3 | If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security 4 | via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/) or directly via email to aws-security@amazon.com. 5 | Please do **NOT** create a public github issue. 6 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARP_FreeRTOS_ClearARP/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ClearARP", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset FreeRTOS_ClearARP.0:7" 7 | ], 8 | "OBJS": 9 | [ 10 | "$(ENTRY)_harness.goto", 11 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto" 12 | ], 13 | "DEF": 14 | [ 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/cbmc/proofs/xRecv_Update_IPv4/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "xRecv_Update_IPv4", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1" 6 | ], 7 | "OPT": 8 | [ 9 | ], 10 | "OBJS": 11 | [ 12 | "$(ENTRY)_harness.goto", 13 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 14 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IPv4_Sockets.goto" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPGenerateRequestPacket/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ARPGenerateRequestPacket", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1" 6 | ], 7 | "OBJS": 8 | [ 9 | "$(ENTRY)_harness.goto", 10 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 11 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto" 12 | ], 13 | "DEF": 14 | [ 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/MPS3_AN552/CMSIS_Driver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_sources( freertos_plus_tcp_network_if 6 | PRIVATE 7 | ETH_LAN91C111.c 8 | ) 9 | 10 | target_include_directories( freertos_plus_tcp_network_if 11 | PRIVATE 12 | . 13 | ) 14 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/MPS4_CS315/CMSIS_Driver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | target_sources( freertos_plus_tcp_network_if 6 | PRIVATE 7 | ETH_LAN91C111.c 8 | ) 9 | 10 | target_include_directories( freertos_plus_tcp_network_if 11 | PRIVATE 12 | . 13 | ) 14 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPGetCacheEntryByMac/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ARPGetCacheEntryByMac", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 7" 6 | ], 7 | "OBJS": 8 | [ 9 | "$(ENTRY)_harness.goto", 10 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto" 11 | ], 12 | "DEF": 13 | [ 14 | "ipconfigUSE_ARP_REVERSED_LOOKUP=1", "ipconfigARP_CACHE_ENTRIES=6" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/DNSgetHostByName_a/cbmc-viewer.json: -------------------------------------------------------------------------------- 1 | { "expected-missing-functions": 2 | [ 3 | "vLoggingPrintf", 4 | "xApplicationGetRandomNumber", 5 | "vListInsertEnd", 6 | "vTaskSetTimeOutState", 7 | "vTaskSuspendAll", 8 | "xTaskGetTickCount", 9 | "xTaskResumeAll" 10 | ], 11 | "proof-name": "DNSgetHostByName_a", 12 | "proof-root": "tools/cbmc/proofs" 13 | } 14 | -------------------------------------------------------------------------------- /test/cbmc/proofs/xRecv_Update_IPv6/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "xRecv_Update_IPv6", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1" 6 | ], 7 | "OPT": 8 | [ 9 | ], 10 | "OBJS": 11 | [ 12 | "$(ENTRY)_harness.goto", 13 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 14 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IPv6_Sockets.goto" 15 | ], 16 | "DEF": 17 | [ 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARP_FreeRTOS_PrintARPCache/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "FreeRTOS_PrintARPCache", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 7", 6 | "--nondet-static" 7 | ], 8 | "OBJS": 9 | [ 10 | "$(ENTRY)_harness.goto", 11 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto" 12 | ], 13 | "DEF": 14 | [ 15 | "ipconfigARP_CACHE_ENTRIES=6", 16 | "ipconfigHAS_PRINTF=1" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/xCheckRequiresARPResolution/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "xCheckRequiresARPResolution", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset memcmp.0:10" 7 | ], 8 | "OBJS": 9 | [ 10 | "$(ENTRY)_harness.goto", 11 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 12 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto" 13 | ], 14 | "DEF": 15 | [ 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/DNSclear/DNSclear_harness.c: -------------------------------------------------------------------------------- 1 | /* FreeRTOS includes. */ 2 | #include "FreeRTOS.h" 3 | #include "queue.h" 4 | 5 | /* FreeRTOS+TCP includes. */ 6 | #include "FreeRTOS_IP.h" 7 | #include "FreeRTOS_DNS.h" 8 | #include "FreeRTOS_IP_Private.h" 9 | 10 | void FreeRTOS_dnsclear( void ); 11 | 12 | 13 | void harness() 14 | { 15 | if( ipconfigUSE_DNS_CACHE != 0 ) 16 | { 17 | FreeRTOS_dnsclear(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/cbmc/proofs/TCP/prvTCPReturnPacket/README.md: -------------------------------------------------------------------------------- 1 | This is the memory safety proof for prvTCPReturnPacket. 2 | 3 | This proof is a work-in-progress. Proof assumptions are described in 4 | the harness. The proof also assumes the following functions are 5 | memory safe and have no side effects relevant to the memory safety of 6 | this function: 7 | 8 | * usGenerateChecksum 9 | * usGenerateProtocolChecksum 10 | * xNetworkInterfaceOutput 11 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARP_FreeRTOS_PrintARPCache/FreeRTOS_PrintARPCache_harness.c: -------------------------------------------------------------------------------- 1 | /* FreeRTOS includes. */ 2 | #include "FreeRTOS.h" 3 | #include "queue.h" 4 | 5 | /* FreeRTOS+TCP includes. */ 6 | #include "FreeRTOS_IP.h" 7 | #include "FreeRTOS_IP_Private.h" 8 | #include "FreeRTOSIPConfig.h" 9 | #include "FreeRTOS_ARP.h" 10 | 11 | void FreeRTOS_PrintARPCache( void ); 12 | 13 | void harness() 14 | { 15 | FreeRTOS_PrintARPCache(); 16 | } 17 | -------------------------------------------------------------------------------- /test/cbmc/proofs/TCP/prvSendData/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "SendData", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--nondet-static" 7 | ], 8 | "OBJS": 9 | [ 10 | "$(ENTRY)_harness.goto", 11 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_Transmission.goto", 12 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto" 13 | ], 14 | "INC": 15 | [ 16 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 17 | ] 18 | } -------------------------------------------------------------------------------- /test/cbmc/cmake/model-check.cmake: -------------------------------------------------------------------------------- 1 | execute_process( 2 | COMMAND 3 | cbmc --trace --unwinding-assertions 4 | ${cbmc_flags} ${cbmc_verbosity} ${goto_binary} 5 | OUTPUT_FILE ${out_file} 6 | ERROR_FILE ${out_file} 7 | RESULT_VARIABLE res 8 | ) 9 | 10 | if(NOT (${res} EQUAL 0 OR ${res} EQUAL 10)) 11 | message(FATAL_ERROR 12 | "Unexpected CBMC return code '${res}' for proof ${proof_name}. Log written to ${out_file}." 13 | ) 14 | endif() 15 | -------------------------------------------------------------------------------- /test/cbmc/proofs/IP/ConsiderFrameForProcessing/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ConsiderFrameForProcessing", 3 | "CBMCFLAGS": [ 4 | "--unwind 1", 5 | "--unwindset memcmp.0:7", 6 | "--nondet-static" 7 | ], 8 | "OPT": 9 | [ 10 | "--export-file-local-symbols" 11 | ], 12 | "OBJS": 13 | [ 14 | "$(ENTRY)_harness.goto", 15 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /test/cbmc/cmake/compute-coverage.cmake: -------------------------------------------------------------------------------- 1 | execute_process( 2 | COMMAND 3 | cbmc --cover location --xml-ui 4 | ${cbmc_flags} ${cbmc_verbosity} ${goto_binary} 5 | OUTPUT_FILE ${out_file} 6 | ERROR_FILE ${out_file} 7 | RESULT_VARIABLE res 8 | ) 9 | 10 | if(NOT (${res} EQUAL 0 OR ${res} EQUAL 10)) 11 | message(FATAL_ERROR 12 | "Unexpected CBMC coverage return code '${res}' for proof ${proof_name}. Log written to ${out_file}." 13 | ) 14 | endif() 15 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DHCP/DHCPProcessEndPoint/cbmc-viewer.json: -------------------------------------------------------------------------------- 1 | { "expected-missing-functions": 2 | [ 3 | "vPortEnterCritical", 4 | "vPortExitCritical", 5 | "vSocketBind", 6 | "vSocketClose", 7 | "vTaskSetTimeOutState", 8 | "xTaskGetTickCount", 9 | "xTaskGetCurrentTaskHandle", 10 | "xQueueGenericSend", 11 | "xApplicationGetRandomNumber", 12 | "vLoggingPrintf" 13 | ], 14 | "proof-name": "DHCPProcess", 15 | "proof-root": "tools/cbmc/proofs" 16 | } 17 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ICMP/ProcessICMPPacket/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ProcessICMPPacket", 3 | "CBMCFLAGS": [ 4 | "--unwind 1", 5 | "--nondet-static" 6 | ], 7 | "OPT": 8 | [ 9 | "--export-file-local-symbols" 10 | ], 11 | "OBJS": 12 | [ 13 | "$(ENTRY)_harness.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ICMP.goto", 16 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/tasks.goto" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /test/cbmc/proofs/Socket/lTCPAddRxdata/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "TCPAddRxdata", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1" 6 | ], 7 | "OBJS": 8 | [ 9 | "$(ENTRY)_harness.goto", 10 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Sockets.goto" 11 | ], 12 | "OPT": 13 | [ 14 | "--export-file-local-symbols" 15 | ], 16 | "INC": 17 | [ 18 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include", 19 | "$(FREERTOS_PLUS_TCP)/test/cbmc/proofs/utility" 20 | ] 21 | } 22 | 23 | -------------------------------------------------------------------------------- /test/cbmc/proofs/Routing/MatchingEndpoint/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "MatchingEndpoint", 3 | "MAX_ENDPOINT_COUNT_LOOP": 3, 4 | "CBMCFLAGS": 5 | [ 6 | "--unwindset pxEasyFit.0:{MAX_ENDPOINT_COUNT_LOOP}", 7 | "--nondet-static" 8 | ], 9 | "OBJS": 10 | [ 11 | "$(ENTRY)_harness.goto", 12 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Routing.goto" 13 | ], 14 | "INC": 15 | [ 16 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 17 | ] 18 | } -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/DNSclear/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "DNSclear", 3 | ################################################################ 4 | # This configuration flag uses DNS cache 5 | "USE_CACHE":1, 6 | "CBMCFLAGS": 7 | [ 8 | "--unwind 1", 9 | "--nondet-static" 10 | ], 11 | "OBJS": 12 | [ 13 | "$(ENTRY)_harness.goto", 14 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS_Cache.goto" 15 | ], 16 | "DEF": 17 | [ 18 | "ipconfigUSE_DNS_CACHE={USE_CACHE}" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /test/cbmc/proofs/IP/HandleEthernetPacket/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "HandleEthernetPacket", 3 | "CBMCFLAGS": [ 4 | "--unwind 3", 5 | "--nondet-static" 6 | ], 7 | "OPT": 8 | [ 9 | "--export-file-local-symbols" 10 | ], 11 | "OBJS": 12 | [ 13 | "$(ENTRY)_harness.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto" 16 | ], 17 | "DEF": 18 | [ 19 | "ipconfigUSE_LINKED_RX_MESSAGES=1" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /test/cbmc/proofs/Socket/prvRecvFrom_CopyPacket/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "RecvFrom_CopyPacket", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1" 6 | ], 7 | "OBJS": 8 | [ 9 | "$(ENTRY)_harness.goto", 10 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Sockets.goto" 11 | ], 12 | "OPT": 13 | [ 14 | "--export-file-local-symbols" 15 | ], 16 | "INC": 17 | [ 18 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include", 19 | "$(FREERTOS_PLUS_TCP)/test/cbmc/proofs/utility" 20 | ] 21 | } 22 | 23 | -------------------------------------------------------------------------------- /test/cbmc/stubs/cbmc.c: -------------------------------------------------------------------------------- 1 | #include "cbmc.h" 2 | 3 | /**************************************************************** 4 | * Model a malloc that can fail (CBMC malloc does not fail) and 5 | * check that CBMC can model an object of the requested size. 6 | ****************************************************************/ 7 | 8 | void * safeMalloc( size_t size ) 9 | { 10 | __CPROVER_assert( size < CBMC_MAX_OBJECT_SIZE, "safeMalloc size too big" ); 11 | return nondet_bool() ? NULL : malloc( size ); 12 | } 13 | -------------------------------------------------------------------------------- /test/cbmc/cmake/compute-property.cmake: -------------------------------------------------------------------------------- 1 | execute_process( 2 | COMMAND 3 | cbmc --show-properties --unwinding-assertions --xml-ui 4 | ${cbmc_flags} ${cbmc_verbosity} ${goto_binary} 5 | OUTPUT_FILE ${out_file} 6 | ERROR_FILE ${out_file} 7 | RESULT_VARIABLE res 8 | ) 9 | 10 | if(NOT (${res} EQUAL 0 OR ${res} EQUAL 10)) 11 | message(FATAL_ERROR 12 | "Unexpected CBMC property return code '${res}' for proof ${proof_name}. Log written to ${out_file}." 13 | ) 14 | endif() 15 | -------------------------------------------------------------------------------- /test/cbmc/proofs/TCPWin/vTCPWindowDestroy/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "vTCPWindowDestroy", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 5", 6 | "--nondet-static" 7 | ], 8 | "OBJS": 9 | [ 10 | "$(ENTRY)_harness.goto", 11 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_WIN.goto", 12 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/list.goto" 13 | ], 14 | "OPT": 15 | [ 16 | "--export-file-local-symbols" 17 | ], 18 | "DEF": 19 | [ 20 | "ipconfigUSE_TCP_WIN=1" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /test/cbmc/proofs/TCP/prvTCPPrepareSend/README.md: -------------------------------------------------------------------------------- 1 | This is the memory safety proof for prvTCPPrepareSend. 2 | 3 | This proof is a work-in-progress. Proof assumptions are described in 4 | the harness. The proof also assumes the following functions are 5 | memory safe and have no side effects relevant to the memory safety of 6 | this function: 7 | 8 | * ulTCPWindowTxGet 9 | * xTCPWindowTxDone 10 | 11 | * xTaskGetTickCount 12 | 13 | * uxStreamBufferGet 14 | * vReleaseNetworkBufferAndDescriptor 15 | * vSocketWakeUpUser 16 | -------------------------------------------------------------------------------- /test/cbmc/proofs/RA/vReceiveRA_ReadReply/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ReceiveRA_ReadReply", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 3", 6 | "--nondet-static" 7 | ], 8 | "OPT": 9 | [ 10 | "--export-file-local-symbols" 11 | ], 12 | "OBJS": 13 | [ 14 | "$(ENTRY)_harness.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_RA.goto" 17 | 18 | ], 19 | "INC": 20 | [ 21 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DHCPv6/DHCPv6HandleOption/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "DHCPv6HandleOption", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 2", 6 | "--nondet-static --flush" 7 | ], 8 | "OPT": 9 | [ 10 | "--export-file-local-symbols" 11 | ], 12 | "DEF": 13 | [ 14 | "ipconfigUSE_DHCPv6=1" 15 | ], 16 | "OBJS": 17 | [ 18 | "$(ENTRY)_harness.goto", 19 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 20 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DHCPv6.goto" 21 | ] 22 | } -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/NBNSHandlePacket/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "NBNSHandlePacket", 3 | "USE_CACHE":1, 4 | "CBMCFLAGS": 5 | [ 6 | "--unwind 1", 7 | "--nondet-static" 8 | ], 9 | "OBJS": 10 | [ 11 | "$(ENTRY)_harness.goto", 12 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 13 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 14 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS.goto" 15 | ], 16 | "DEF": 17 | [ 18 | "ipconfigUSE_DNS_CACHE={USE_CACHE}", 19 | "ipconfigUSE_NBNS=1" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ICMP/ProcessICMPEchoRequest/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ProcessICMPEchoRequest", 3 | "CBMCFLAGS": [ 4 | "--unwind 1", 5 | "--nondet-static" 6 | ], 7 | "OPT": 8 | [ 9 | "--export-file-local-symbols" 10 | ], 11 | "OBJS": 12 | [ 13 | "$(ENTRY)_harness.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ICMP.goto", 17 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/tasks.goto" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ulARPRemoveCacheEntryByMac/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ulARPRemoveCacheEntryByMac", 3 | "NUMBER_OF_CACHE_ENTRIES":6, 4 | "CBMCFLAGS": 5 | [ 6 | ], 7 | "OBJS": 8 | [ 9 | "$(ENTRY)_harness.goto", 10 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto" 11 | ], 12 | "INSTFLAGS": 13 | [ 14 | ], 15 | "DEF": 16 | [ 17 | "ipconfigUSE_ARP_REMOVE_ENTRY=1", 18 | "ipconfigARP_CACHE_ENTRIES={NUMBER_OF_CACHE_ENTRIES}" 19 | ], 20 | "INC": 21 | [ 22 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ulARPRemoveCacheEntryByMac/ulARPRemoveCacheEntryByMac_harness.c: -------------------------------------------------------------------------------- 1 | /* Standard includes. */ 2 | #include 3 | #include 4 | 5 | /* FreeRTOS includes. */ 6 | #include "FreeRTOS.h" 7 | 8 | /* FreeRTOS+TCP includes. */ 9 | #include "FreeRTOS_IP.h" 10 | #include "FreeRTOS_ARP.h" 11 | 12 | 13 | void harness() 14 | { 15 | const MACAddress_t xMACAddress; 16 | 17 | /* The pointer passed to ulARPRemoveCacheEntryByMac cannot be NULL 18 | * (see the API definition). */ 19 | ulARPRemoveCacheEntryByMac( &xMACAddress ); 20 | } 21 | -------------------------------------------------------------------------------- /test/cbmc/include/aws_freertos_tcp_verification_access_tcp_define.h: -------------------------------------------------------------------------------- 1 | int32_t publicTCPPrepareSend( FreeRTOS_Socket_t * pxSocket, 2 | NetworkBufferDescriptor_t ** ppxNetworkBuffer, 3 | UBaseType_t uxOptionsLength ) 4 | { 5 | prvTCPPrepareSend( pxSocket, ppxNetworkBuffer, uxOptionsLength ); 6 | } 7 | 8 | BaseType_t publicTCPHandleState( FreeRTOS_Socket_t * pxSocket, 9 | NetworkBufferDescriptor_t ** ppxNetworkBuffer ) 10 | { 11 | prvTCPHandleState( pxSocket, ppxNetworkBuffer ); 12 | } 13 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/README_DRIVER_DISCLAIMER.txt: -------------------------------------------------------------------------------- 1 | Network drivers are provided as examples only, and do not form part of the 2 | FreeRTOS+TCP stack itself. They: 3 | 4 | + May be based on driver code provided by the chip vendors, 5 | + May not have been tested in all possible configurations, 6 | + Will not necessarily be optimised. 7 | + May have a dependency on a particular PHY part number. 8 | + May not necessarily comply with any particular coding standard. 9 | + May have dependencies on chip company libraries. 10 | + May include other hardware board dependencies. 11 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPSendGratuitous/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ARPSendGratuitous", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--nondet-static" 7 | ], 8 | "OBJS": 9 | [ 10 | "$(ENTRY)_harness.goto", 11 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto", 12 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 13 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/tasks.goto", 15 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto" 16 | ], 17 | "DEF": 18 | [ 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/board_family/ReadMe.txt: -------------------------------------------------------------------------------- 1 | Update NetworkInterface.c and include other files needed by FreeRTOS+TCP here. 2 | 3 | Note: The NetworkInterface.c file in this directory is Not! to be used as is. The purpose of the file is to provide a template for writing a network interface. 4 | Each network interface will have to provide concrete implementations of the functions in NetworkInterface.c. 5 | See the following URL for an explanation of the file and its functions: https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/03-Embedded_Ethernet_Porting -------------------------------------------------------------------------------- /source/portable/NetworkInterface/NXP1060/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "NXP1060") ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | NetworkInterface.c 11 | ) 12 | 13 | target_link_libraries( freertos_plus_tcp_network_if 14 | PUBLIC 15 | freertos_plus_tcp_port 16 | freertos_plus_tcp_network_if_common 17 | PRIVATE 18 | freertos_kernel 19 | freertos_plus_tcp 20 | ) 21 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/TM4C/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT ( (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "TM4C") ) ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | NetworkInterface.c 11 | ) 12 | 13 | target_link_libraries( freertos_plus_tcp_network_if 14 | PUBLIC 15 | freertos_plus_tcp_port 16 | freertos_plus_tcp_network_if_common 17 | PRIVATE 18 | freertos_kernel 19 | freertos_plus_tcp 20 | ) 21 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/ATSAME5x/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "ATSAME5x") ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | NetworkInterface.c 11 | ) 12 | 13 | target_link_libraries( freertos_plus_tcp_network_if 14 | PUBLIC 15 | freertos_plus_tcp_port 16 | freertos_plus_tcp_network_if_common 17 | PRIVATE 18 | freertos_kernel 19 | freertos_plus_tcp 20 | ) 21 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/mw300_rd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "MW300_RD") ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | NetworkInterface.c 11 | ) 12 | 13 | target_link_libraries( freertos_plus_tcp_network_if 14 | PUBLIC 15 | freertos_plus_tcp_port 16 | freertos_plus_tcp_network_if_common 17 | PRIVATE 18 | freertos_kernel 19 | freertos_plus_tcp 20 | ) 21 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/loopback/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "LOOPBACK") ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | loopbackNetworkInterface.c 11 | ) 12 | 13 | target_link_libraries( freertos_plus_tcp_network_if 14 | PUBLIC 15 | freertos_plus_tcp_port 16 | freertos_plus_tcp_network_if_common 17 | PRIVATE 18 | freertos_kernel 19 | freertos_plus_tcp 20 | ) 21 | -------------------------------------------------------------------------------- /test/cbmc/proofs/IP/SendEventToIPTask/README.md: -------------------------------------------------------------------------------- 1 | This is the memory safety proof for xSendEventToIPTask, a function used 2 | for sending different events to IP-Task. We have abstracted away queues. 3 | 4 | This proof is a work-in-progress. Proof assumptions are described in 5 | the harness. The proof also assumes the following functions are 6 | memory safe and have no side effects relevant to the memory safety of 7 | this function: 8 | 9 | * uxQueueMessagesWaiting 10 | * xQueueGenericSend 11 | 12 | The coverage is imperfect (97%) because xSendEventToIPTask always 13 | calls xSendEventStructToIPTask with xTimeout==0. 14 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/board_family/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "") ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | NetworkInterface.c 11 | ) 12 | 13 | target_link_libraries( freertos_plus_tcp_network_if 14 | PUBLIC 15 | freertos_plus_tcp_port 16 | freertos_plus_tcp_network_if_common 17 | PRIVATE 18 | freertos_kernel 19 | freertos_plus_tcp 20 | ) 21 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/RX/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT ( (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "RX") ) ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | ether_callback.c 11 | NetworkInterface.c 12 | ) 13 | 14 | target_link_libraries( freertos_plus_tcp_network_if 15 | PUBLIC 16 | freertos_plus_tcp_port 17 | freertos_plus_tcp_network_if_common 18 | PRIVATE 19 | freertos_kernel 20 | freertos_plus_tcp 21 | ) 22 | -------------------------------------------------------------------------------- /test/cbmc/proofs/IP/ProcessEthernetPacket/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ProcessEthernetPacket", 3 | "CBMCFLAGS": [ 4 | "--unwind 1", 5 | "--nondet-static" 6 | ], 7 | "OPT": 8 | [ 9 | "--export-file-local-symbols" 10 | ], 11 | "OBJS": 12 | [ 13 | "$(ENTRY)_harness.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 15 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 16 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 17 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Timers.goto" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARP_FreeRTOS_ClearARP/ClearARP_harness.c: -------------------------------------------------------------------------------- 1 | /* FreeRTOS includes. */ 2 | #include "FreeRTOS.h" 3 | #include "queue.h" 4 | 5 | /* FreeRTOS+TCP includes. */ 6 | #include "FreeRTOS_IP.h" 7 | #include "FreeRTOS_ARP.h" 8 | 9 | void harness() 10 | { 11 | NetworkEndPoint_t * pxEndPoint_Test = ( NetworkEndPoint_t * ) malloc( sizeof( NetworkEndPoint_t ) ); 12 | 13 | /* 14 | * Here the assumption that pxEndPoint_Test != NULL [__CPROVER_assume( pxEndPoint_Test != NULL );] 15 | * is not made as pxEndPoint_Test == NULL is a valid use case. 16 | */ 17 | 18 | FreeRTOS_ClearARP( pxEndPoint_Test ); 19 | } 20 | -------------------------------------------------------------------------------- /test/cbmc/proofs/IPUtils/pxDuplicateNetworkBufferWithDescriptor/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "pxDuplicateNetworkBufferWithDescriptor", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--nondet-static" 7 | ], 8 | "INSTFLAGS": 9 | [ 10 | ], 11 | "OBJS": 12 | [ 13 | "$(ENTRY)_harness.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto" 16 | ], 17 | "DEF": 18 | [ 19 | "FREERTOS_TCP_ENABLE_VERIFICATION", 20 | "ipconfigUSE_TCP=1" 21 | ], 22 | "INC": 23 | [ 24 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /test/cbmc/proofs/MakefileLinux.json: -------------------------------------------------------------------------------- 1 | { 2 | "GOTO_CC": [ 3 | "goto-cc" 4 | ], 5 | "COMPILE_LINK": [ 6 | "-o" 7 | ], 8 | "COMPILE_ONLY": [ 9 | "-c", 10 | "-o" 11 | ], 12 | "RULE_INPUT": [ 13 | "$^" 14 | ], 15 | "RULE_OUTPUT": [ 16 | "$@" 17 | ], 18 | "RULE_GOTO": [ 19 | "%.goto : %.c" 20 | ], 21 | "INC": [ 22 | "$(PROOFS)/../windows" 23 | ], 24 | "RM": [ 25 | "$(RM)" 26 | ], 27 | "RM_RECURSIVE": [ 28 | "$(RM) -r" 29 | ], 30 | "CP": [ 31 | "cp" 32 | ], 33 | "TYPE_HEADER_SCRIPT": [ 34 | "$(PROOFS)/make_type_header_files.py" 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/M487/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "M487") ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | m480_eth.c 11 | m480_eth.h 12 | NetworkInterface.c 13 | ) 14 | 15 | target_link_libraries( freertos_plus_tcp_network_if 16 | PUBLIC 17 | freertos_plus_tcp_port 18 | freertos_plus_tcp_network_if_common 19 | PRIVATE 20 | freertos_kernel 21 | freertos_plus_tcp 22 | ) 23 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPRefreshCacheEntry/Configurations.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ARPRefreshCacheEntry", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset FreeRTOS_InterfaceEndPointOnNetMask.0:3", 7 | "--unwindset prvFindCacheEntry.0:7,memcmp.0:17" 8 | ], 9 | "OBJS": 10 | [ 11 | "$(ENTRY)_harness.goto", 12 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto", 13 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Routing.goto" 14 | ], 15 | "DEF": 16 | [ 17 | {"NOT_STORE_REMOTE":["ipconfigARP_STORES_REMOTE_ADDRESSES=0"]}, 18 | {"STORE_REMOTE":["ipconfigARP_STORES_REMOTE_ADDRESSES=1"]} 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DHCPv6/SendDHCPMessage/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "SendDHCPMessage", 3 | "CBMCFLAGS": 4 | [ 5 | "--nondet-static" 6 | ], 7 | "OPT": 8 | [ 9 | "--export-file-local-symbols" 10 | ], 11 | "DEF": 12 | [ 13 | "ipconfigUSE_DHCPv6=1" 14 | ], 15 | "OBJS": 16 | [ 17 | "$(ENTRY)_harness.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DHCPv6.goto", 19 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 20 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 21 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto" 22 | ] 23 | } -------------------------------------------------------------------------------- /source/portable/NetworkInterface/DriverSAM/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "DRIVER_SAM") ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | gmac_SAM.c 11 | gmac_SAM.h 12 | NetworkInterface.c 13 | ) 14 | 15 | target_link_libraries( freertos_plus_tcp_network_if 16 | PUBLIC 17 | freertos_plus_tcp_port 18 | freertos_plus_tcp_network_if_common 19 | PRIVATE 20 | freertos_kernel 21 | freertos_plus_tcp 22 | ) 23 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/prepareReplyDNSMessage/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "prepareReplyDNSMessage", 3 | "USE_CACHE":1, 4 | "CBMCFLAGS": 5 | [ 6 | "--unwind 1", 7 | "--nondet-static" 8 | ], 9 | "OBJS": 10 | [ 11 | "$(ENTRY)_harness.goto", 12 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 13 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 14 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS_Parser.goto" 16 | ], 17 | "DEF": 18 | [ 19 | "ipconfigUSE_DNS_CACHE={USE_CACHE}", 20 | "ipconfigUSE_NBNS=1" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ND/prvReturnICMP_IPv6/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ReturnICMP_IPv6", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwindset vNDRefreshCacheEntry.0:25", 6 | "--nondet-static" 7 | ], 8 | "OBJS": 9 | [ 10 | "$(ENTRY)_harness.goto", 11 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Timers.goto", 12 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ND.goto", 13 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 15 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto" 16 | ], 17 | "INC": 18 | [ 19 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPProcessPacket/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ARPProcessPacket", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset vARPRefreshCacheEntry.0:7,memcmp.0:17,xIsIPInARPCache.0:7", 7 | "--unwindset prvFindCacheEntry.0:7", 8 | "--nondet-static" 9 | ], 10 | "OBJS": 11 | [ 12 | "$(ENTRY)_harness.goto", 13 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto", 14 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 15 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 16 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 17 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/ksz8851snl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "KSZ8851SNL") ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | ksz8851snl_reg.h 11 | ksz8851snl.c 12 | ksz8851snl.h 13 | NetworkInterface.c 14 | ) 15 | 16 | target_link_libraries( freertos_plus_tcp_network_if 17 | PUBLIC 18 | freertos_plus_tcp_port 19 | freertos_plus_tcp_network_if_common 20 | PRIVATE 21 | freertos_kernel 22 | freertos_plus_tcp 23 | ) 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation issue 3 | about: Create a report to help us improve our documentation. 4 | title: "[DOC] " 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the issue** 11 | Please describe the issue and expected clarification in concise language. 12 | 13 | **Reference** 14 | Please attach the URL at which you are experiencing the issue. 15 | 16 | **Screenshot** 17 | If applicable, please attach screenshot. 18 | 19 | **Browser** 20 | - Browser: [e.g. Chrome] 21 | - Version: [e.g. 80.0.3987.132] 22 | 23 | 24 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/Zynq/uncached_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * uncached_memory.h 3 | * 4 | * This module will declare 1 MB of memory and switch off the caching for it. 5 | * 6 | * pucGetUncachedMemory( ulSize ) returns a trunc of this memory with a length 7 | * rounded up to a multiple of 4 KB 8 | * 9 | * ucIsCachedMemory( pucBuffer ) returns non-zero if a given pointer is NOT 10 | * within the range of the 1 MB non-cached memory. 11 | * 12 | */ 13 | 14 | #ifndef UNCACHEMEMORY_H 15 | 16 | #define UNCACHEMEMORY_H 17 | 18 | uint8_t * pucGetUncachedMemory( uint32_t ulSize ); 19 | 20 | uint8_t ucIsCachedMemory( const uint8_t * pucBuffer ); 21 | 22 | #endif /* UNCACHEMEMORY_H */ 23 | -------------------------------------------------------------------------------- /test/cbmc/proofs/IPUtils/prvPacketBuffer_to_NetworkBuffer/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "prvPacketBuffer_to_NetworkBuffer", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--nondet-static" 7 | ], 8 | "INSTFLAGS": 9 | [ 10 | ], 11 | "OBJS": 12 | [ 13 | "$(ENTRY)_harness.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto" 16 | ], 17 | "DEF": 18 | [ 19 | "FREERTOS_TCP_ENABLE_VERIFICATION", 20 | "ipconfigUSE_TCP=1" 21 | ], 22 | "OPT": 23 | [ 24 | "--export-file-local-symbols" 25 | ], 26 | "INC": 27 | [ 28 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /test/cbmc/proofs/Socket/vSocketWakeUpUser/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "vSocketWakeUpUser", 3 | 4 | "CBMCFLAGS": 5 | [ 6 | "--unwind 1" 7 | ], 8 | "OBJS": 9 | [ 10 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/list.goto", 11 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Sockets.goto", 12 | "$(ENTRY)_harness.goto" 13 | ], 14 | "DEF": 15 | [ 16 | "ipconfigSOCKET_HAS_USER_SEMAPHORE=1", 17 | "ipconfigSOCKET_HAS_USER_WAKE_CALLBACK=1", 18 | "ipconfigSUPPORT_SELECT_FUNCTION=1", 19 | "configUSE_16_BIT_TICKS=0" 20 | ], 21 | "INC": 22 | [ 23 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include", 24 | "$(FREERTOS_PLUS_TCP)/test/cbmc/proofs/utility" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /test/cbmc/proofs/parsing/ProcessReceivedUDPPacket_IPv6/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ProcessReceivedUDPPacket_IPv6", 3 | "MAX_RX_PACKETS":1, 4 | "USE_LLMNR":1, 5 | "USE_NBNS":1, 6 | "CBMCFLAGS": 7 | [ 8 | "--unwind 1", 9 | "--nondet-static" 10 | ], 11 | "OBJS": 12 | [ 13 | "$(ENTRY)_harness.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 15 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_UDP_IPv6.goto" 17 | ], 18 | "DEF": 19 | [ 20 | "ipconfigUDP_MAX_RX_PACKETS={MAX_RX_PACKETS}", 21 | "ipconfigUSE_LLMNR={USE_LLMNR}", 22 | "ipconfigUSE_NBNS={USE_NBNS}" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/xilinx_ultrascale/uncached_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * uncached_memory.h 3 | * 4 | * This module will declare 1 MB of memory and switch off the caching for it. 5 | * 6 | * pucGetUncachedMemory( ulSize ) returns a trunc of this memory with a length 7 | * rounded up to a multiple of 4 KB 8 | * 9 | * ucIsCachedMemory( pucBuffer ) returns non-zero if a given pointer is NOT 10 | * within the range of the 1 MB non-cached memory. 11 | * 12 | */ 13 | 14 | #ifndef UNCACHEMEMORY_H 15 | 16 | #define UNCACHEMEMORY_H 17 | 18 | uint8_t * pucGetUncachedMemory( uint32_t ulSize ); 19 | 20 | uint8_t ucIsCachedMemory( const uint8_t * pucBuffer ); 21 | 22 | #endif /* UNCACHEMEMORY_H */ 23 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/ThirdParty/MSP432/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT ( (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "MSP432") ) ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | NetworkInterface.c 11 | NetworkInterface.h 12 | NetworkMiddleware.c 13 | NetworkMiddleware.h 14 | ) 15 | 16 | target_link_libraries( freertos_plus_tcp_network_if 17 | PUBLIC 18 | freertos_plus_tcp_port 19 | freertos_plus_tcp_network_if_common 20 | PRIVATE 21 | freertos_kernel 22 | freertos_plus_tcp 23 | ) 24 | -------------------------------------------------------------------------------- /test/cbmc/proofs/IPUtils/pxUDPPayloadBuffer_to_NetworkBuffer/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "pxUDPPayloadBuffer_to_NetworkBuffer", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--nondet-static" 7 | ], 8 | "INSTFLAGS": 9 | [ 10 | ], 11 | "OBJS": 12 | [ 13 | "$(ENTRY)_harness.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto" 16 | ], 17 | "DEF": 18 | [ 19 | "FREERTOS_TCP_ENABLE_VERIFICATION", 20 | "ipconfigBUFFER_PADDING=14" 21 | ], 22 | "OPT": 23 | [ 24 | "--export-file-local-symbols" 25 | ], 26 | "INC": 27 | [ 28 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/STM32/Legacy/STM32Hxx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT ( (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "STM32HXX") ) ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | NetworkInterface.c 11 | stm32h7xx_hal_eth.h 12 | stm32hxx_hal_eth.c 13 | stm32hxx_hal_eth.h 14 | ) 15 | 16 | target_link_libraries( freertos_plus_tcp_network_if 17 | PUBLIC 18 | freertos_plus_tcp_port 19 | freertos_plus_tcp_network_if_common 20 | PRIVATE 21 | freertos_kernel 22 | freertos_plus_tcp 23 | ) 24 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/WinPCap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT ( (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "WIN_PCAP") ) ) 2 | return() 3 | endif() 4 | 5 | find_package(PCAP REQUIRED) 6 | 7 | #------------------------------------------------------------------------------ 8 | add_library( freertos_plus_tcp_network_if STATIC ) 9 | 10 | target_sources( freertos_plus_tcp_network_if 11 | PRIVATE 12 | FaultInjection.c 13 | NetworkInterface.c 14 | ) 15 | 16 | target_link_libraries( freertos_plus_tcp_network_if 17 | PUBLIC 18 | freertos_plus_tcp_port 19 | freertos_plus_tcp_network_if_common 20 | PRIVATE 21 | freertos_kernel 22 | freertos_plus_tcp 23 | ${PCAP_LIBRARY} 24 | ) 25 | 26 | -------------------------------------------------------------------------------- /manifest.yml: -------------------------------------------------------------------------------- 1 | name: "FreeRTOS-Plus-TCP" 2 | version: "V4.3.1" 3 | description: 4 | "Thread safe FreeRTOS TCP/IP stack working on top of the FreeRTOS-Kernel to 5 | implement the TCP/IP protocol. Suitable for microcontrollers." 6 | license: "MIT" 7 | dependencies: 8 | - name: "FreeRTOS-Kernel" 9 | version: "V11.1.0" 10 | license: "MIT" 11 | repository: 12 | type: "git" 13 | url: "https://github.com/FreeRTOS/FreeRTOS-Kernel.git" 14 | path: "test/FreeRTOS-Kernel" 15 | branch: "main" 16 | 17 | - name: "CMock" 18 | version: "afa2949" 19 | repository: 20 | type: "git" 21 | url: " https://github.com/ThrowTheSwitch/CMock.git" 22 | path: "tools/CMock" 23 | -------------------------------------------------------------------------------- /test/cbmc/proofs/IPUtils/usGenerateProtocolChecksum/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "usGenerateProtocolChecksum", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--nondet-static" 7 | ], 8 | "INSTFLAGS": 9 | [ 10 | "--remove-function-body prvChecksumIPv6Checks" 11 | ], 12 | "OBJS": 13 | [ 14 | "$(ENTRY)_harness.goto", 15 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 17 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IPv4_Utils.goto" 18 | ], 19 | "DEF": 20 | [ 21 | "FREERTOS_TCP_ENABLE_VERIFICATION", 22 | "ipconfigUSE_TCP=1" 23 | ], 24 | "INC": 25 | [ 26 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /test/cbmc/proofs/TCP/prvTCPHandleState/README.md: -------------------------------------------------------------------------------- 1 | This is the memory safety proof for prvTCPHandleState. 2 | 3 | This proof is a work-in-progress. Proof assumptions are described in 4 | the harness. The proof also assumes the following functions are 5 | memory safe and have no side effects relevant to the memory safety of 6 | this function: 7 | 8 | * prvTCPPrepareSend (proved independently) 9 | * prvTCPReturnPacket (proved independently) 10 | 11 | * lTCPAddRxdata 12 | * lTCPWindowRxCheck 13 | * lTCPWindowTxAdd 14 | * ulTCPWindowTxAck 15 | * vTCPWindowInit 16 | * xTCPWindowRxEmpty 17 | * xTCPWindowTxDone 18 | 19 | * uxStreamBufferGet 20 | * vReleaseNetworkBufferAndDescriptor 21 | * vSocketWakeUpUser 22 | * xTaskGetTickCount 23 | -------------------------------------------------------------------------------- /test/cbmc/patches/Makefile: -------------------------------------------------------------------------------- 1 | BRANCH=freertos 2 | 3 | PATCHED=patched 4 | 5 | default: 6 | git format-patch $(BRANCH)..$(BRANCH)-cbmc-patches 7 | 8 | patch: 9 | if [ ! -f $(PATCHED) ]; then \ 10 | for p in *.patch; do \ 11 | (cd ../../..; patch -p1 < CBMC/patches/$${p}) \ 12 | done; \ 13 | cat > $(PATCHED) < /dev/null; \ 14 | fi 15 | 16 | unpatch: 17 | git checkout ../../../lib 18 | $(RM) $(PATCHED) 19 | 20 | #patching file lib/FreeRTOS-Plus-TCP/include/FreeRTOS_IP_Private.h 21 | #patching file lib/include/private/list.h 22 | #patching file lib/FreeRTOS-Plus-TCP/source/FreeRTOS_DHCP.c 23 | #patching file lib/FreeRTOS-Plus-TCP/source/FreeRTOS_DNS.c 24 | #patching file lib/FreeRTOS-Plus-TCP/source/FreeRTOS_TCP_WIN.c 25 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/ATSAM4E/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "ATSAM4E") ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | component/gmac.h 11 | instance/gmac.h 12 | ethernet_phy.c 13 | ethernet_phy.h 14 | gmac.c 15 | gmac.h 16 | NetworkInterface.c 17 | ) 18 | 19 | target_link_libraries( freertos_plus_tcp_network_if 20 | PUBLIC 21 | freertos_plus_tcp_port 22 | freertos_plus_tcp_network_if_common 23 | PRIVATE 24 | freertos_kernel 25 | freertos_plus_tcp 26 | ) 27 | -------------------------------------------------------------------------------- /test/cbmc/proofs/TCP/prvHandleListen/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "prvHandleListen", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--nondet-static" 7 | ], 8 | "OBJS": 9 | [ 10 | "$(ENTRY)_harness.goto", 11 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 12 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 13 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_State_Handling.goto", 14 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_State_Handling_IPv4.goto" 15 | ], 16 | "DEF": 17 | [ 18 | "FREERTOS_TCP_ENABLE_VERIFICATION", 19 | "ipconfigNETWORK_MTU=586" 20 | ], 21 | "INSTFLAGS": 22 | [ 23 | ], 24 | "INC": 25 | [ 26 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/SH2A/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT ( (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "SH2A") ) ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | NetworkInterface.c 11 | ) 12 | 13 | # target_link_libraries( freertos_plus_tcp_network_if 14 | # PRIVATE 15 | # hwEthernetLib # Where is hwEthernet.h? 16 | # ) 17 | 18 | target_link_libraries( freertos_plus_tcp_network_if 19 | PUBLIC 20 | freertos_plus_tcp_port 21 | freertos_plus_tcp_network_if_common 22 | PRIVATE 23 | freertos_kernel 24 | freertos_plus_tcp 25 | ) 26 | -------------------------------------------------------------------------------- /test/cbmc/proofs/MakefileWindows.json: -------------------------------------------------------------------------------- 1 | { 2 | "DEF": [ 3 | "WIN32" 4 | ], 5 | "GOTO_CC": [ 6 | "goto-cl" 7 | ], 8 | "COMPILE_LINK": [ 9 | "/Fe" 10 | ], 11 | "COMPILE_ONLY": [ 12 | "/c", 13 | "/Fo" 14 | ], 15 | "RULE_INPUT": [ 16 | "$**" 17 | ], 18 | "RULE_OUTPUT": [ 19 | "$@" 20 | ], 21 | "RULE_GOTO": [ 22 | ".c.goto:" 23 | ], 24 | "OPT": [ 25 | "/wd4210", 26 | "/wd4127", 27 | "/wd4214", 28 | "/wd4201", 29 | "/wd4244", 30 | "/wd4310" 31 | ], 32 | "RM": [ 33 | "del" 34 | ], 35 | "RM_RECURSIVE": [ 36 | "del /s" 37 | ], 38 | "CP": [ 39 | "copy" 40 | ], 41 | "TYPE_HEADER_SCRIPT": [ 42 | "$(PROOFS)\\make_type_header_files.py" 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest an idea for this project 4 | title: "[Feature Request] " 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ND/prvProcessICMPMessage_IPv6/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ProcessICMPMessage_IPv6", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwindset vNDRefreshCacheEntry.0:25", 6 | "--nondet-static" 7 | ], 8 | "OBJS": 9 | [ 10 | "$(ENTRY)_harness.goto", 11 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Timers.goto", 12 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ND.goto", 13 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 15 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto" 16 | ], 17 | "DEF": 18 | [ 19 | "FREERTOS_TCP_ENABLE_VERIFICATION" 20 | ], 21 | "INC": 22 | [ 23 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/STM32/Legacy/STM32Fxx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT ( (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "STM32FXX") ) ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | NetworkInterface.c 11 | # stm32f2xx_hal_eth.h 12 | # stm32f4xx_hal_eth.h 13 | stm32f7xx_hal_eth.h # Only one of these ? 14 | stm32fxx_hal_eth.c 15 | stm32fxx_hal_eth.h 16 | ) 17 | 18 | target_link_libraries( freertos_plus_tcp_network_if 19 | PUBLIC 20 | freertos_plus_tcp_port 21 | freertos_plus_tcp_network_if_common 22 | PRIVATE 23 | freertos_kernel 24 | freertos_plus_tcp 25 | ) 26 | -------------------------------------------------------------------------------- /cspell.config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | $schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json 3 | version: '0.2' 4 | # Allows things like stringLength 5 | allowCompoundWords: true 6 | 7 | # Read files not to spell check from the git ignore 8 | useGitignore: true 9 | 10 | # Language settings for C 11 | languageSettings: 12 | - caseSensitive: false 13 | enabled: true 14 | languageId: c 15 | locale: "*" 16 | 17 | # Add a dictionary, and the path to the word list 18 | dictionaryDefinitions: 19 | - name: freertos-words 20 | path: '.github/.cSpellWords.txt' 21 | addWords: true 22 | 23 | dictionaries: 24 | - freertos-words 25 | 26 | # Paths and files to ignore 27 | ignorePaths: 28 | - 'dependency' 29 | - 'docs' 30 | - 'ThirdParty' 31 | - 'History.txt' 32 | -------------------------------------------------------------------------------- /test/cbmc/proofs/parsing/ProcessReceivedTCPPacket_IPv6/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ProcessReceivedTCPPacket_IPv6", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset prvTCPSendRepeated.0:13", 7 | "--nondet-static" 8 | ], 9 | "OBJS": 10 | [ 11 | "$(ENTRY)_harness.goto", 12 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 13 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_IP.goto" 16 | ], 17 | "INSTFLAGS": 18 | [ 19 | ], 20 | "DEF": 21 | [ 22 | "FREERTOS_TCP_ENABLE_VERIFICATION", 23 | "CBMC_GETNETWORKBUFFER_FAILURE_BOUND" 24 | ], 25 | "INC": 26 | [ 27 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 28 | ] 29 | } 30 | 31 | -------------------------------------------------------------------------------- /test/cbmc/proofs/Socket/vSocketBind/ALLOW_SOCKET_SEND_WITHOUT_BIND/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "vSocketBind", 3 | "ALLOW_SEND_WITHOUT_BIND":"1", 4 | "CBMCFLAGS": 5 | [ 6 | "--unwind 1", 7 | "--unwindset FreeRTOS_FindEndPointOnIP_IPv4.0:3" 8 | ], 9 | "OBJS": 10 | [ 11 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/list.goto", 12 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Routing.goto", 13 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Sockets.goto", 14 | "$(ENTRY)_harness.goto" 15 | ], 16 | "INSTFLAGS": 17 | [ 18 | ], 19 | "DEF": 20 | [ 21 | "ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND={ALLOW_SEND_WITHOUT_BIND}", 22 | "ipconfigUSE_TCP=1" 23 | ], 24 | "INC": 25 | [ 26 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include", 27 | "$(FREERTOS_PLUS_TCP)/test/cbmc/proofs/utility" 28 | ] 29 | } 30 | 31 | -------------------------------------------------------------------------------- /test/cbmc/proofs/TCP/prvHandleListen_IPv6/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "prvHandleListen_IPv6", 3 | "IPV6_ADDRESS_SIZE": 17, 4 | "CBMCFLAGS": 5 | [ 6 | "--unwind 1", 7 | "--unwindset memcmp.0:{IPV6_ADDRESS_SIZE}", 8 | "--nondet-static" 9 | ], 10 | "OBJS": 11 | [ 12 | "$(ENTRY)_harness.goto", 13 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_State_Handling.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_State_Handling_IPv6.goto" 17 | ], 18 | "DEF": 19 | [ 20 | "FREERTOS_TCP_ENABLE_VERIFICATION", 21 | "ipconfigNETWORK_MTU=586" 22 | ], 23 | "INSTFLAGS": 24 | [ 25 | ], 26 | "INC": 27 | [ 28 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /test/cbmc/proofs/CheckOptionsOuter/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "CheckOptionsOuter", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset __CPROVER_file_local_FreeRTOS_TCP_Reception_c_prvSingleStepTCPHeaderOptions.0:32" 7 | ], 8 | "OPT": 9 | [ 10 | "--export-file-local-symbols" 11 | ], 12 | "OBJS": 13 | [ 14 | "$(ENTRY)_harness.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_Reception.goto", 17 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_WIN.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Stream_Buffer.goto", 19 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/tasks.goto", 20 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/list.goto" 21 | ], 22 | "DEF": 23 | [ 24 | "ipconfigNETWORK_MTU=586" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /test/cbmc/proofs/Socket/vSocketBind/DONT_ALLOW_SOCKET_SEND_WITHOUT_BIND/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "vSocketBind", 3 | "ALLOW_SEND_WITHOUT_BIND":"0", 4 | "CBMCFLAGS": 5 | [ 6 | "--unwind 1", 7 | "--unwindset FreeRTOS_FindEndPointOnIP_IPv4.0:3" 8 | ], 9 | "OBJS": 10 | [ 11 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/list.goto", 12 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Routing.goto", 13 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Sockets.goto", 14 | "$(ENTRY)_harness.goto" 15 | ], 16 | "INSTFLAGS": 17 | [ 18 | ], 19 | "DEF": 20 | [ 21 | "ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND={ALLOW_SEND_WITHOUT_BIND}", 22 | "ipconfigUSE_TCP=1" 23 | ], 24 | "INC": 25 | [ 26 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include", 27 | "$(FREERTOS_PLUS_TCP)/test/cbmc/proofs/utility" 28 | ] 29 | } 30 | 31 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | Description 4 | ----------- 5 | 6 | 7 | Test Steps 8 | ----------- 9 | 10 | 11 | Checklist: 12 | ---------- 13 | 14 | 15 | - [ ] I have tested my changes. No regression in existing tests. 16 | - [ ] I have modified and/or added unit-tests to cover the code changes in this Pull Request. 17 | 18 | Related Issue 19 | ----------- 20 | 21 | 22 | 23 | By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. 24 | -------------------------------------------------------------------------------- /test/cbmc/proofs/CheckOptions/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "CheckOptions", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset prvCheckOptions.0:41" 7 | ], 8 | "OPT": 9 | [ 10 | "--export-file-local-symbols" 11 | ], 12 | "OBJS": 13 | [ 14 | "$(ENTRY)_harness.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_Reception.goto", 17 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_WIN.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_IP.goto", 19 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Stream_Buffer.goto", 20 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/tasks.goto", 21 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/list.goto" 22 | ], 23 | "BUFFER_SIZE": 100, 24 | "DEF": 25 | [ 26 | "BUFFER_SIZE={BUFFER_SIZE}" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | Contains the files that implement FreeRTOS+TCP. 2 | 3 | User documentation, including an API reference is available on: 4 | http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/ 5 | 6 | A description of the source code organisation is available on: 7 | http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial.html 8 | 9 | The porting guide is available on: 10 | https://www.freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/01-FreeRTOS_TCP_Porting 11 | 12 | License information is available on: 13 | http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_Plus_TCP_License.html 14 | 15 | At this time it is recommended to use BufferAllocation_2.c in which case it is 16 | essential to use the heap_4.c memory allocation scheme: 17 | http://www.FreeRTOS.org/a00111.html 18 | 19 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DHCPv6/DHCPv6Analyse/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "DHCPv6Analyse", 3 | "DHCPv6_SUBOPTION_NUM": 25, 4 | "CBMCFLAGS": 5 | [ 6 | "--nondet-static --flush", 7 | "--unwind 1", 8 | "--unwindset __CPROVER_file_local_FreeRTOS_DHCPv6_c_prvDHCPv6Analyse.0:{DHCPv6_SUBOPTION_NUM}" 9 | ], 10 | "INSTFLAGS": 11 | [ 12 | "--malloc-may-fail" 13 | ], 14 | "OPT": 15 | [ 16 | "--export-file-local-symbols" 17 | ], 18 | "DEF": 19 | [ 20 | "ipconfigUSE_DHCPv6=1", 21 | "ipconfigNETWORK_MTU=586" 22 | ], 23 | "OBJS": 24 | [ 25 | "$(ENTRY)_harness.goto", 26 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 27 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_BitConfig.goto", 28 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DHCPv6.goto" 29 | ] 30 | } -------------------------------------------------------------------------------- /tools/tcp_utilities/tcp_netstat.md: -------------------------------------------------------------------------------- 1 | tcp_netstat.c : it introduces the following function: 2 | 3 | `BaseType_t vGetMetrics( MetricsType_t * pxMetrics )` 4 | 5 | It collects information: all port numbers in use, all UDP sockets, all TCP sockets and their connections. 6 | 7 | Make sure that your FreeRTOSIPConfig.h includes tools/tcp_utilities/include/tcp_netstat.h: 8 | 9 | `@include "tcp_netstat.h"` 10 | 11 | because it will define 2 important macro's: 12 | 13 | #define iptraceNETWORK_INTERFACE_INPUT( uxDataLength, pucEthernetBuffer ) 14 | 15 | #define iptraceNETWORK_INTERFACE_OUTPUT( uxDataLength, pucEthernetBuffer ) 16 | 17 | These macro's will be called when an Ethernet packet has been received or sent. 18 | 19 | When collecting socket and port information, it will iterate through the list of sockets, filling arrays of structures. 20 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/esp32/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "ESP32") ) 2 | return() 3 | endif() 4 | 5 | if(NOT TARGET esp32_lib) 6 | message(FATAL_ERROR "For FREERTOS_PLUS_TCP_NETWORK_IF=ESP32 must have a target for the esp32_lib") 7 | endif() 8 | #------------------------------------------------------------------------------ 9 | add_library( freertos_plus_tcp_network_if STATIC ) 10 | 11 | target_sources( freertos_plus_tcp_network_if 12 | PRIVATE 13 | NetworkInterface.c 14 | ) 15 | 16 | target_link_libraries( freertos_plus_tcp_network_if 17 | PRIVATE 18 | esp32_lib 19 | ) 20 | 21 | target_link_libraries( freertos_plus_tcp_network_if 22 | PUBLIC 23 | freertos_plus_tcp_port 24 | freertos_plus_tcp_network_if_common 25 | PRIVATE 26 | freertos_kernel 27 | freertos_plus_tcp 28 | ) 29 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DHCPv6/Process_PassReplyToEndPoint/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "DHCPv6Process_PassReplyToEndPoint", 3 | "MAX_CLIENT_SERVER_ID_LENGTH": 128, 4 | "MAX_CLIENT_SERVER_ID_LENGTH_UNWIND": "__eval {MAX_CLIENT_SERVER_ID_LENGTH} + 1", 5 | "CBMCFLAGS": 6 | [ 7 | "--nondet-static", 8 | "--unwind 1", 9 | "--unwindset memcmp.0:{MAX_CLIENT_SERVER_ID_LENGTH_UNWIND}", 10 | "--unwindset __CPROVER_file_local_FreeRTOS_DHCPv6_c_xDHCPv6Process_PassReplyToEndPoint.0:3" 11 | ], 12 | "OPT": 13 | [ 14 | "--export-file-local-symbols" 15 | ], 16 | "DEF": 17 | [ 18 | "ipconfigUSE_DHCPv6=1" 19 | ], 20 | "OBJS": 21 | [ 22 | "$(ENTRY)_harness.goto", 23 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 24 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DHCPv6.goto" 25 | ] 26 | } -------------------------------------------------------------------------------- /test/cbmc/proofs/parsing/ProcessIPPacket_IPv6/eHandleIPv6ExtensionHeaders/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "eHandleIPv6ExtensionHeaders", 3 | "MAX_EXT_HEADER_NUM": 21, 4 | "CBMCFLAGS": 5 | [ 6 | "--unwind 1", 7 | "--unwindset usGetExtensionHeaderLength.0:{MAX_EXT_HEADER_NUM}", 8 | "--nondet-static" 9 | ], 10 | "OPT": 11 | [ 12 | "--export-file-local-symbols" 13 | ], 14 | "OBJS": 15 | [ 16 | "$(ENTRY)_harness.goto", 17 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IPv6.goto", 19 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IPv6_Utils.goto" 20 | ], 21 | "DEF": 22 | [ 23 | "ipconfigNETWORK_MTU=200", 24 | "ipconfigTCP_MSS=586", 25 | "ipconfigUSE_DHCP=0" 26 | ], 27 | "INC": 28 | [ 29 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 30 | ] 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /test/cbmc/proofs/parsing/ProcessReceivedUDPPacket/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ProcessReceivedUDPPacket", 3 | "MAX_RX_PACKETS":1, 4 | "USE_LLMNR":1, 5 | "USE_NBNS":1, 6 | "CBMCFLAGS": 7 | [ 8 | "--unwind 1", 9 | "--nondet-static" 10 | ], 11 | "OBJS": 12 | [ 13 | "$(ENTRY)_harness.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 15 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 16 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 17 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_UDP_IP.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_UDP_IPv4.goto", 19 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto" 20 | ], 21 | "DEF": 22 | [ 23 | "ipconfigUDP_MAX_RX_PACKETS={MAX_RX_PACKETS}", 24 | "ipconfigUSE_LLMNR={USE_LLMNR}", 25 | "ipconfigUSE_NBNS={USE_NBNS}" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/LPC17xx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "LPC17xx") ) 2 | return() 3 | endif() 4 | 5 | if(NOT TARGET lpc17xx_driver) 6 | message(FATAL_ERROR "For FREERTOS_PLUS_TCP_NETWORK_IF=LPC17xx must have a target for the lpc17xx_driver") 7 | endif() 8 | #------------------------------------------------------------------------------ 9 | add_library( freertos_plus_tcp_network_if STATIC ) 10 | 11 | target_sources( freertos_plus_tcp_network_if 12 | PRIVATE 13 | NetworkInterface.c 14 | ) 15 | 16 | target_link_libraries(freertos_plus_tcp_network_if 17 | PRIVATE 18 | lpc17xx_driver 19 | ) 20 | 21 | target_link_libraries( freertos_plus_tcp_network_if 22 | PUBLIC 23 | freertos_plus_tcp_port 24 | freertos_plus_tcp_network_if_common 25 | PRIVATE 26 | freertos_kernel 27 | freertos_plus_tcp 28 | ) 29 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/LPC18xx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "LPC18xx") ) 2 | return() 3 | endif() 4 | 5 | if(NOT TARGET lpc17xx_driver) 6 | message(FATAL_ERROR "For FREERTOS_PLUS_TCP_NETWORK_IF=LPC18xx must have a target for the lpc18xx_driver") 7 | endif() 8 | #------------------------------------------------------------------------------ 9 | add_library( freertos_plus_tcp_network_if STATIC ) 10 | 11 | target_sources( freertos_plus_tcp_network_if 12 | PRIVATE 13 | NetworkInterface.c 14 | ) 15 | 16 | target_link_libraries(freertos_plus_tcp_network_if 17 | PRIVATE 18 | lpc18xx_driver 19 | ) 20 | 21 | target_link_libraries( freertos_plus_tcp_network_if 22 | PUBLIC 23 | freertos_plus_tcp_port 24 | freertos_plus_tcp_network_if_common 25 | PRIVATE 26 | freertos_kernel 27 | freertos_plus_tcp 28 | ) 29 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/LPC54018/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "LPC54018") ) 2 | return() 3 | endif() 4 | 5 | if(NOT TARGET fsl_enet_driver) 6 | message(FATAL_ERROR "For FREERTOS_PLUS_TCP_NETWORK_IF=LPC54018 must have a target for the fsl_enet_driver") 7 | endif() 8 | #------------------------------------------------------------------------------ 9 | add_library( freertos_plus_tcp_network_if STATIC ) 10 | 11 | target_sources( freertos_plus_tcp_network_if 12 | PRIVATE 13 | NetworkInterface.c 14 | ) 15 | 16 | target_link_libraries(freertos_plus_tcp_network_if 17 | PRIVATE 18 | lpc54018_driver 19 | ) 20 | 21 | target_link_libraries( freertos_plus_tcp_network_if 22 | PUBLIC 23 | freertos_plus_tcp_port 24 | freertos_plus_tcp_network_if_common 25 | PRIVATE 26 | freertos_kernel 27 | freertos_plus_tcp 28 | ) 29 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/CreateDNSMessage/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "CreateDNSMessage", 3 | "MAX_HOSTNAME_LEN": 5, 4 | "HOSTNAME_UNWIND": "__eval {MAX_HOSTNAME_LEN} + 1", 5 | "USE_CACHE": 1, 6 | "CBMCFLAGS": 7 | [ 8 | "--unwind 1", 9 | "--unwindset strlen.0:{HOSTNAME_UNWIND}", 10 | "--unwindset strcpy.0:{HOSTNAME_UNWIND}", 11 | "--unwindset __CPROVER_file_local_FreeRTOS_DNS_c_prvCreateDNSMessage.0:{HOSTNAME_UNWIND}", 12 | "--unwindset __CPROVER_file_local_FreeRTOS_DNS_c_prvCreateDNSMessage.1:{HOSTNAME_UNWIND}", 13 | "--nondet-static" 14 | ], 15 | "OPT": 16 | [ 17 | "--export-file-local-symbols" 18 | ], 19 | "OBJS": 20 | [ 21 | "$(ENTRY)_harness.goto", 22 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS.goto" 23 | ], 24 | "DEF": 25 | [ 26 | "ipconfigUSE_DNS=1", 27 | "MAX_HOSTNAME_LEN={MAX_HOSTNAME_LEN}" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/MPS2_AN385/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "MPS2_AN385") ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | target_sources( freertos_plus_tcp_network_if 9 | PRIVATE 10 | ether_lan9118/SMM_MPS2.h 11 | ether_lan9118/smsc9220_emac_config.h 12 | ether_lan9118/smsc9220_eth_drv.c 13 | ether_lan9118/smsc9220_eth_drv.h 14 | NetworkInterface.c 15 | ) 16 | 17 | target_include_directories( freertos_plus_tcp_network_if 18 | PRIVATE 19 | ether_lan9118 20 | ) 21 | 22 | target_link_libraries( freertos_plus_tcp_network_if 23 | PUBLIC 24 | freertos_plus_tcp_port 25 | freertos_plus_tcp_network_if_common 26 | PRIVATE 27 | freertos_kernel 28 | freertos_plus_tcp 29 | ) 30 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/libslirp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "LIBSLIRP") ) 2 | return() 3 | endif() 4 | 5 | if(NOT TARGET slirp) 6 | message(FATAL_ERROR "For FREERTOS_PLUS_TCP_NETWORK_IF=LIBSLIRP must have a target for the slirp") 7 | endif() 8 | #------------------------------------------------------------------------------ 9 | add_library( freertos_plus_tcp_network_if STATIC ) 10 | 11 | target_sources( freertos_plus_tcp_network_if 12 | PRIVATE 13 | MBuffNetifBackendLibslirp.c 14 | MBuffNetworkInterface.c 15 | ) 16 | 17 | target_link_libraries(freertos_plus_tcp_network_if 18 | PRIVATE 19 | slirp 20 | ) 21 | 22 | target_link_libraries( freertos_plus_tcp_network_if 23 | PUBLIC 24 | freertos_plus_tcp_port 25 | freertos_plus_tcp_network_if_common 26 | PRIVATE 27 | freertos_kernel 28 | freertos_plus_tcp 29 | ) 30 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/pic32mzef/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT ( (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "PIC32MZEF_ETH") OR 2 | (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "PIC32MZEF_WIFI") ) ) 3 | return() 4 | endif() 5 | 6 | #------------------------------------------------------------------------------ 7 | add_library( freertos_plus_tcp_network_if STATIC ) 8 | 9 | # What about BufferAllocation_2.c here? 10 | target_sources( freertos_plus_tcp_network_if 11 | PRIVATE 12 | $<$:NetworkInterface_eth.c> 13 | $<$:NetworkInterface_wifi.c> 14 | ) 15 | 16 | target_link_libraries( freertos_plus_tcp_network_if 17 | PUBLIC 18 | freertos_plus_tcp_port 19 | freertos_plus_tcp_network_if_common 20 | PRIVATE 21 | freertos_kernel 22 | freertos_plus_tcp 23 | ) 24 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPAgeCache/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ARPAgeCache", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset vARPAgeCache.0:7", 7 | "--unwindset FreeRTOS_OutputARPRequest.0:3", 8 | "--unwindset FreeRTOS_InterfaceEndPointOnNetMask.0:3", 9 | "--unwindset vARPAgeCache.1:3", 10 | "--nondet-static" 11 | ], 12 | "OBJS": 13 | [ 14 | "$(ENTRY)_harness.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Routing.goto", 17 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 19 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 20 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 21 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/tasks.goto" 22 | ], 23 | "DEF": 24 | [ 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPGetCacheEntryByMac/ARPGetCacheEntryByMac_harness.c: -------------------------------------------------------------------------------- 1 | /* FreeRTOS includes. */ 2 | #include "FreeRTOS.h" 3 | #include "queue.h" 4 | 5 | /* FreeRTOS+TCP includes. */ 6 | #include "FreeRTOS_IP.h" 7 | #include "FreeRTOS_IP_Private.h" 8 | #include "FreeRTOS_ARP.h" 9 | 10 | extern ARPCacheRow_t xARPCache[ ipconfigARP_CACHE_ENTRIES ]; 11 | 12 | static NetworkEndPoint_t xEndPoint_Temp; 13 | 14 | void harness() 15 | { 16 | MACAddress_t xMACAddress; 17 | uint32_t ulIPAddress; 18 | 19 | NetworkInterface_t ** ppxInterface = ( NetworkInterface_t ** ) malloc( sizeof( NetworkInterface_t * ) ); 20 | 21 | if( ppxInterface ) 22 | { 23 | *ppxInterface = ( NetworkInterface_t * ) malloc( sizeof( NetworkInterface_t ) ); 24 | __CPROVER_assume( *ppxInterface != NULL ); 25 | } 26 | 27 | eARPGetCacheEntryByMac( &xMACAddress, &ulIPAddress, ppxInterface ); 28 | } 29 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/DNSlookup/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "DNSlookup", 3 | ################################################################ 4 | # This configuration uses DNS cache and the MAX_HOSTNAME_LEN is set to 255 according to the specification 5 | "MAX_HOSTNAME_LEN": 255, 6 | "HOSTNAME_UNWIND": "__eval {MAX_HOSTNAME_LEN} + 1", 7 | "USE_CACHE": 1, 8 | "CBMCFLAGS": 9 | [ 10 | "--unwind 1", 11 | "--unwindset prvFindEntryIndex.0:3", 12 | "--unwindset prvProcessDNSCache.0:5,strcmp.0:{HOSTNAME_UNWIND}", 13 | "--nondet-static" 14 | ], 15 | "OBJS": 16 | [ 17 | "$(ENTRY)_harness.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS_Cache.goto", 19 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/tasks.goto" 20 | ], 21 | "DEF": 22 | [ 23 | "ipconfigUSE_DNS_CACHE={USE_CACHE}", 24 | "MAX_HOSTNAME_LEN={MAX_HOSTNAME_LEN}" 25 | ], 26 | "OPT" : "-m32" 27 | } 28 | -------------------------------------------------------------------------------- /test/cbmc/proofs/UDP/vProcessGeneratedUDPPacket/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "vProcessGeneratedUDPPacket", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset FreeRTOS_InterfaceEndPointOnNetMask.0:3", 7 | "--nondet-static" 8 | ], 9 | "OBJS": 10 | [ 11 | "$(ENTRY)_harness.goto", 12 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 13 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Routing.goto", 14 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_UDP_IP.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_UDP_IPv4.goto" 16 | ], 17 | "INSTFLAGS": 18 | [ 19 | ], 20 | "DEF": 21 | [ 22 | "ipconfigSUPPORT_OUTGOING_PINGS=1", 23 | "ipconfigBYTE_ORDER=pdFREERTOS_BIG_ENDIAN" 24 | ], 25 | "INC": 26 | [ 27 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include", 28 | "$(FREERTOS_PLUS_TCP)/test/cbmc/proofs/utility", 29 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DHCPv6/DHCPv6ProcessEndPoint/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "DHCPv6ProcessEndPoint", 3 | "ENDPOINT_DNS_ADDRESS_COUNT": 5, 4 | "CBMCFLAGS": 5 | [ 6 | "--nondet-static --flush", 7 | "--unwind 1" 8 | ], 9 | "OPT": 10 | [ 11 | "--export-file-local-symbols" 12 | ], 13 | "DEF": 14 | [ 15 | "ipconfigUSE_DHCPv6=1", 16 | "ENDPOINT_DNS_ADDRESS_COUNT={ENDPOINT_DNS_ADDRESS_COUNT}" 17 | ], 18 | "OBJS": 19 | [ 20 | "$(ENTRY)_harness.goto", 21 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 22 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 23 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 24 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DHCPv6.goto", 25 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 26 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Timers.goto" 27 | ] 28 | } -------------------------------------------------------------------------------- /test/cbmc/proofs/RA/vReceiveRA/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ReceiveRA", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 2", 6 | "--unwindset FreeRTOS_NextEndPoint.0:1", 7 | "--unwindset FreeRTOS_CreateIPv6Address.0:5", 8 | "--nondet-static" 9 | ], 10 | "OPT": 11 | [ 12 | "--export-file-local-symbols" 13 | ], 14 | "OBJS": 15 | [ 16 | "$(ENTRY)_harness.goto", 17 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Timers.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Routing.goto", 19 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_RA.goto", 20 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ND.goto", 21 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 22 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 23 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto" 24 | 25 | ], 26 | "INC": 27 | [ 28 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /test/cbmc/proofs/UDP/vProcessGeneratedUDPPacket_IPv6/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "vProcessGeneratedUDPPacket_IPv6", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset FreeRTOS_InterfaceEndPointOnNetMask.0:3", 7 | "--nondet-static" 8 | ], 9 | "OBJS": 10 | [ 11 | "$(ENTRY)_harness.goto", 12 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 13 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Routing.goto", 14 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ND.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_UDP_IPv6.goto" 16 | ], 17 | "INSTFLAGS": 18 | [ 19 | ], 20 | "DEF": 21 | [ 22 | "ipconfigSUPPORT_OUTGOING_PINGS=1", 23 | "ipconfigBYTE_ORDER=pdFREERTOS_BIG_ENDIAN" 24 | ], 25 | "INC": 26 | [ 27 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include", 28 | "$(FREERTOS_PLUS_TCP)/test/cbmc/proofs/utility", 29 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/MPS3_AN552/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "MPS3_AN552") ) 6 | return() 7 | endif() 8 | 9 | #------------------------------------------------------------------------------ 10 | add_library( freertos_plus_tcp_network_if STATIC ) 11 | 12 | # CMSIS Ethernet driver for LAN91C111 13 | add_subdirectory(CMSIS_Driver) 14 | 15 | target_sources( freertos_plus_tcp_network_if 16 | PRIVATE 17 | NetworkInterface.c 18 | ) 19 | 20 | target_include_directories( freertos_plus_tcp_network_if 21 | PRIVATE 22 | Device/Include 23 | ) 24 | 25 | target_link_libraries( freertos_plus_tcp_network_if 26 | PUBLIC 27 | freertos_plus_tcp_port 28 | freertos_plus_tcp_network_if_common 29 | PRIVATE 30 | freertos_kernel 31 | freertos_plus_tcp 32 | ) 33 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/MPS4_CS315/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Arm Limited and/or its affiliates 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "MPS4_CS315") ) 6 | return() 7 | endif() 8 | 9 | #------------------------------------------------------------------------------ 10 | add_library( freertos_plus_tcp_network_if STATIC ) 11 | 12 | # CMSIS Ethernet driver for LAN91C111 13 | add_subdirectory(CMSIS_Driver) 14 | 15 | target_sources( freertos_plus_tcp_network_if 16 | PRIVATE 17 | NetworkInterface.c 18 | ) 19 | 20 | target_include_directories( freertos_plus_tcp_network_if 21 | PRIVATE 22 | Device/Include 23 | ) 24 | 25 | target_link_libraries( freertos_plus_tcp_network_if 26 | PUBLIC 27 | freertos_plus_tcp_port 28 | freertos_plus_tcp_network_if_common 29 | PRIVATE 30 | freertos_kernel 31 | freertos_plus_tcp 32 | ) 33 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/M487/README.md: -------------------------------------------------------------------------------- 1 | ## Disclaimer : 2 | 3 | Please note that M487 port has not been tested with IPv6, Multiple endpoint and interfaces which are supported by the latest TCP release V4.0.0. This needs to be used with caution in IPv6 environment as there can be potential compatibility issues. 4 | 5 | 6 | ## Last Git Release : 7 | 8 | You can find the last release supporting this port on our GitHub repository here : [V3.1.0](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/releases/tag/V3.1.0). Visit the mentioned link to access the repository and download the version supporting M487 port to use it. 9 | 10 | 11 | ## Contribution and Support : 12 | 13 | If you are interested in contributing to the development of this port or have any question regarding this port, feel free to post on [FreeRTOS forum](https://forums.freertos.org/). Your inputs are valuable to us and we encourage collaboration and discussion within the community. 14 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/SH2A/README.md: -------------------------------------------------------------------------------- 1 | ## Disclaimer : 2 | 3 | Please note that SH2A port has not been tested with IPv6, Multiple endpoint and interfaces which are supported by the latest TCP release V4.0.0. This needs to be used with caution in IPv6 environment as there can be potential compatibility issues. 4 | 5 | 6 | ## Last Git Release : 7 | 8 | You can find the last release supporting this port on our GitHub repository here : [V3.1.0](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/releases/tag/V3.1.0). Visit the mentioned link to access the repository and download the version supporting SH2A port to use it. 9 | 10 | 11 | ## Contribution and Support : 12 | 13 | If you are interested in contributing to the development of this port or have any question regarding this port, feel free to post on [FreeRTOS forum](https://forums.freertos.org/). Your inputs are valuable to us and we encourage collaboration and discussion within the community. 14 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/TM4C/README.md: -------------------------------------------------------------------------------- 1 | ## Disclaimer : 2 | 3 | Please note that TM4C port has not been tested with IPv6, Multiple endpoint and interfaces which are supported by the latest TCP release V4.0.0. This needs to be used with caution in IPv6 environment as there can be potential compatibility issues. 4 | 5 | 6 | ## Last Git Release : 7 | 8 | You can find the last release supporting this port on our GitHub repository here : [V3.1.0](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/releases/tag/V3.1.0). Visit the mentioned link to access the repository and download the version supporting TM4C port to use it. 9 | 10 | 11 | ## Contribution and Support : 12 | 13 | If you are interested in contributing to the development of this port or have any question regarding this port, feel free to post on [FreeRTOS forum](https://forums.freertos.org/). Your inputs are valuable to us and we encourage collaboration and discussion within the community. 14 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/pic32mzef/README.md: -------------------------------------------------------------------------------- 1 | ## Disclaimer : 2 | 3 | Please note that pic32mzef port has not been tested with IPv6, Multiple endpoint and interfaces which are supported by the latest TCP release V4.0.0. This needs to be used with caution in IPv6 environment as there can be potential compatibility issues. 4 | 5 | ## Last Git Release : 6 | 7 | You can find the last release supporting this port on our GitHub repository here : [V3.1.0](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/releases/tag/V3.1.0). Visit the mentioned link to access the repository and download the version supporting pic32mzef port to use it. 8 | 9 | ## Contribution and Support : 10 | 11 | If you are interested in contributing to the development of this port or have any question regarding this port, feel free to post on [FreeRTOS forum](https://forums.freertos.org/). Your inputs are valuable to us and we encourage collaboration and discussion within the community. -------------------------------------------------------------------------------- /source/portable/NetworkInterface/TM4C/TM4C-README.md: -------------------------------------------------------------------------------- 1 | # Ethernet Driver for TM4C129X MCUs 2 | *JD Scott - jscott@hotstart.com* 3 | 4 | This driver was written and tested using the Texas Instruments (TI) TM4C1294NCPDT microcontroller using version the TivaWare((C) TI) driver library. This MCU includes built-in MAC and PHY which this driver assumes is to be used. 5 | 6 | This is a zero-copy driver uses the TivaWare ((C) TI) ROM function mapping macros, is intended for use with FreeRTOS+TCP BufferManagement_1, and is loosely modeled after the example lwIP Ethernet driver provided by TI in their TivaWare library. The driver utilizes the Ethernet (MAC) DMA engine. 7 | 8 | ## Vendor Provided Version Numbers Used 9 | The following versions for tools/libraries were used during development and testing of this driver: 10 | - Code Composer Studio - 11.1.0.000111 11 | - TI ARM Code Generation Tools ((C) Texas Instruments) (CGT) - 20.2.6.LTS 12 | - TivaWare - 2.2.0.295 13 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/esp32/README.md: -------------------------------------------------------------------------------- 1 | ## Disclaimer : 2 | 3 | Please note that esp32 port has not been tested with IPv6, Multiple endpoint and interfaces which are supported by the latest TCP release V4.0.0. This needs to be used with caution in IPv6 environment as there can be potential compatibility issues. 4 | 5 | 6 | ## Last Git Release : 7 | 8 | You can find the last release supporting this port on our GitHub repository here : [V3.1.0](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/releases/tag/V3.1.0). Visit the mentioned link to access the repository and download the version supporting esp32 port to use it. 9 | 10 | 11 | ## Contribution and Support : 12 | 13 | If you are interested in contributing to the development of this port or have any question regarding this port, feel free to post on [FreeRTOS forum](https://forums.freertos.org/). Your inputs are valuable to us and we encourage collaboration and discussion within the community. 14 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/LPC17xx/README.md: -------------------------------------------------------------------------------- 1 | ## Disclaimer : 2 | 3 | Please note that LPC17xx port has not been tested with IPv6, Multiple endpoint and interfaces which are supported by the latest TCP release V4.0.0. This needs to be used with caution in IPv6 environment as there can be potential compatibility issues. 4 | 5 | 6 | ## Last Git Release : 7 | 8 | You can find the last release supporting this port on our GitHub repository here : [V3.1.0](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/releases/tag/V3.1.0). Visit the mentioned link to access the repository and download the version supporting LPC17xx port to use it. 9 | 10 | 11 | ## Contribution and Support : 12 | 13 | If you are interested in contributing to the development of this port or have any question regarding this port, feel free to post on [FreeRTOS forum](https://forums.freertos.org/). Your inputs are valuable to us and we encourage collaboration and discussion within the community. 14 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/LPC18xx/README.md: -------------------------------------------------------------------------------- 1 | ## Disclaimer : 2 | 3 | Please note that LPC18xx port has not been tested with IPv6, Multiple endpoint and interfaces which are supported by the latest TCP release V4.0.0. This needs to be used with caution in IPv6 environment as there can be potential compatibility issues. 4 | 5 | 6 | ## Last Git Release : 7 | 8 | You can find the last release supporting this port on our GitHub repository here : [V3.1.0](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/releases/tag/V3.1.0). Visit the mentioned link to access the repository and download the version supporting LPC18xx port to use it. 9 | 10 | 11 | ## Contribution and Support : 12 | 13 | If you are interested in contributing to the development of this port or have any question regarding this port, feel free to post on [FreeRTOS forum](https://forums.freertos.org/). Your inputs are valuable to us and we encourage collaboration and discussion within the community. 14 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/LPC54018/README.md: -------------------------------------------------------------------------------- 1 | ## Disclaimer : 2 | 3 | Please note that LPC54018 port has not been tested with IPv6, Multiple endpoint and interfaces which are supported by the latest TCP release V4.0.0. This needs to be used with caution in IPv6 environment as there can be potential compatibility issues. 4 | 5 | 6 | ## Last Git Release : 7 | 8 | You can find the last release supporting this port on our GitHub repository here : [V3.1.0](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/releases/tag/V3.1.0). Visit the mentioned link to access the repository and download the version supporting LPC54018 port to use it. 9 | 10 | 11 | ## Contribution and Support : 12 | 13 | If you are interested in contributing to the development of this port or have any question regarding this port, feel free to post on [FreeRTOS forum](https://forums.freertos.org/). Your inputs are valuable to us and we encourage collaboration and discussion within the community. 14 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/mw300_rd/README.md: -------------------------------------------------------------------------------- 1 | ## Disclaimer : 2 | 3 | Please note that mw300_rd port has not been tested with IPv6, Multiple endpoint and interfaces which are supported by the latest TCP release V4.0.0. This needs to be used with caution in IPv6 environment as there can be potential compatibility issues. 4 | 5 | 6 | ## Last Git Release : 7 | 8 | You can find the last release supporting this port on our GitHub repository here : [V3.1.0](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/releases/tag/V3.1.0). Visit the mentioned link to access the repository and download the version supporting mw300_rd port to use it. 9 | 10 | 11 | ## Contribution and Support : 12 | 13 | If you are interested in contributing to the development of this port or have any question regarding this port, feel free to post on [FreeRTOS forum](https://forums.freertos.org/). Your inputs are valuable to us and we encourage collaboration and discussion within the community. 14 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DHCPv6/DHCPv6Process/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "DHCPv6Process", 3 | "LOOP_UNWIND_COUNT": 4, 4 | "ENDPOINT_DNS_ADDRESS_COUNT": 5, 5 | "CBMCFLAGS": 6 | [ 7 | "--unwind {LOOP_UNWIND_COUNT}", 8 | "--unwindset memcmp.0:17", 9 | "--nondet-static --flush" 10 | ], 11 | "OPT": 12 | [ 13 | "--export-file-local-symbols" 14 | ], 15 | "DEF": 16 | [ 17 | "ipconfigUSE_DHCPv6=1", 18 | "FR_RECV_FROM_SUCCESS_COUNT={LOOP_UNWIND_COUNT}", 19 | "ENDPOINT_DNS_ADDRESS_COUNT={ENDPOINT_DNS_ADDRESS_COUNT}" 20 | ], 21 | "OBJS": 22 | [ 23 | "$(ENTRY)_harness.goto", 24 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 25 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 26 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 27 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DHCPv6.goto", 28 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Timers.goto" 29 | ] 30 | } -------------------------------------------------------------------------------- /test/cbmc/proofs/CheckOptionsInner/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "CheckOptionsInner", 3 | "CBMCFLAGS": [ 4 | "--unwind 1", 5 | "--unwindset __CPROVER_file_local_FreeRTOS_TCP_WIN_c_prvTCPWindowTxCheckAck.0:2", 6 | "--unwindset __CPROVER_file_local_FreeRTOS_TCP_WIN_c_prvTCPWindowFastRetransmit.0:2" 7 | ], 8 | "OPT": 9 | [ 10 | "--export-file-local-symbols" 11 | ], 12 | "OBJS": 13 | [ 14 | "$(ENTRY)_harness.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_Reception.goto", 17 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_IP.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_WIN.goto", 19 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Stream_Buffer.goto", 20 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/tasks.goto", 21 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/list.goto" 22 | ], 23 | "DEF": 24 | [ 25 | "ipconfigUSE_TCP=1", 26 | "ipconfigNETWORK_MTU=586" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /test/cbmc/proofs/IPUtils/usGenerateProtocolChecksum_IPv6/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "usGenerateProtocolChecksum_IPv6", 3 | "MAX_EXT_HEADER_NUM": 21, 4 | "CBMCFLAGS": 5 | [ 6 | "--unwind 1", 7 | "--nondet-static", 8 | "--unwindset usGetExtensionHeaderLength.3:{MAX_EXT_HEADER_NUM}", 9 | "--unwindset prvPrepareExtensionHeaders.0:{MAX_EXT_HEADER_NUM}" 10 | ], 11 | "INSTFLAGS": 12 | [ 13 | "--remove-function-body prvChecksumIPv4Checks" 14 | ], 15 | "OBJS": 16 | [ 17 | "$(ENTRY)_harness.goto", 18 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 19 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 20 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IPv6_Utils.goto" 21 | ], 22 | "DEF": 23 | [ 24 | "FREERTOS_TCP_ENABLE_VERIFICATION", 25 | "ipconfigUSE_TCP=1", 26 | "ipconfigNETWORK_MTU=200", 27 | "ipconfigTCP_MSS=586", 28 | "ipconfigUSE_DHCP=0" 29 | ], 30 | "INC": 31 | [ 32 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/DNSTreatNBNS/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "DNS_TreatNBNS", 3 | "USE_CACHE":1, 4 | "NBNS_NAME_MAX_LENGTH":17, 5 | "DNS_CACHE_NAME_LENGTH": 255, 6 | "CBMCFLAGS": 7 | [ 8 | "--unwind 1", 9 | "--unwindset DNS_TreatNBNS.0:{NBNS_NAME_MAX_LENGTH}", 10 | "--unwindset prvFindEntryIndex.0:2", 11 | "--unwindset strcmp.0:{NBNS_NAME_MAX_LENGTH}", 12 | "--unwindset strlen.0:{NBNS_NAME_MAX_LENGTH}", 13 | "--unwindset strncpy.0:{DNS_CACHE_NAME_LENGTH}" 14 | ], 15 | "OBJS": 16 | [ 17 | "$(ENTRY)_harness.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 19 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS_Parser.goto", 20 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS_Cache.goto", 21 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 22 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto" 23 | ], 24 | "DEF": 25 | [ 26 | "ipconfigUSE_DNS_CACHE={USE_CACHE}", 27 | "ipconfigUSE_NBNS=1", 28 | "ipconfigNETWORK_MTU=586" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /test/cbmc/proofs/SkipNameField/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "SkipNameField", 3 | 4 | ################################################################ 5 | # This is the network buffer size. This can be set to any positive value. 6 | "NETWORK_BUFFER_SIZE": 10, 7 | 8 | ################################################################ 9 | # Loop DNS_SkipNameField.0: 10 | # file lib/FreeRTOS-Plus-TCP/source/FreeRTOS_DNS.c line 778 11 | # bound should be half network buffer size, since chunk length is at least 2 12 | "SKIPLOOP0": "DNS_SkipNameField.0", 13 | "SKIPLOOP0_UNWIND": "__eval ({NETWORK_BUFFER_SIZE} + 1) / 2", 14 | 15 | ################################################################ 16 | 17 | "CBMCFLAGS": 18 | [ 19 | "--unwind 1", 20 | "--unwindset {SKIPLOOP0}:{SKIPLOOP0_UNWIND}" 21 | ], 22 | 23 | "OBJS": 24 | [ 25 | "$(ENTRY)_harness.goto", 26 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS_Parser.goto" 27 | ], 28 | "DEF": 29 | [ 30 | "NETWORK_BUFFER_SIZE={NETWORK_BUFFER_SIZE}" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /test/cbmc/proofs/Socket/vSocketClose/Configurations.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "vSocketClose", 3 | 4 | "CBMCFLAGS": 5 | [ 6 | "--unwind 2" 7 | ], 8 | "OBJS": 9 | [ 10 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/list.goto", 11 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Sockets.goto", 12 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 13 | "$(ENTRY)_harness.goto" 14 | ], 15 | "DEF": 16 | [ 17 | { 18 | "UDP_Only":[ 19 | "PROTOCOL=FREERTOS_IPPROTO_UDP", 20 | "ipconfigUSE_TCP=1", 21 | "ipconfigUSE_TCP_WIN=1", 22 | "ipconfigHAS_DEBUG_PRINTF=0" 23 | ] 24 | }, 25 | { 26 | "TCP_Only":[ 27 | "PROTOCOL=FREERTOS_IPPROTO_TCP", 28 | "ipconfigUSE_TCP=1", 29 | "ipconfigUSE_TCP_WIN=1", 30 | "ipconfigHAS_DEBUG_PRINTF=0" 31 | ] 32 | } 33 | ], 34 | "INC": 35 | [ 36 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include", 37 | "$(FREERTOS_PLUS_TCP)/test/cbmc/proofs/utility", 38 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs" 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /test/cbmc/proofs/Socket/vSocketBind/ALLOW_ETHERNET_DRIVER_FILTERS_PACKETS/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "vSocketBind", 3 | "ALLOW_SEND_WITHOUT_BIND":"1", 4 | "ALLOW_ETHERNET_DRIVER_FILTER":"1", 5 | "ALLOW_TCP":"1", 6 | "CBMCFLAGS": 7 | [ 8 | "--unwind 1", 9 | "--unwindset FreeRTOS_FindEndPointOnIP_IPv4.0:3" 10 | ], 11 | "OBJS": 12 | [ 13 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/list.goto", 14 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Routing.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Sockets.goto", 16 | "$(ENTRY)_harness.goto", 17 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto" 18 | ], 19 | "INSTFLAGS": 20 | [ 21 | ], 22 | "DEF": 23 | [ 24 | "ipconfigALLOW_SOCKET_SEND_WITHOUT_BIND={ALLOW_SEND_WITHOUT_BIND}", 25 | "ipconfigUSE_TCP={ALLOW_TCP}", 26 | "ipconfigETHERNET_DRIVER_FILTERS_PACKETS={ALLOW_ETHERNET_DRIVER_FILTER}" 27 | ], 28 | "INC": 29 | [ 30 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include", 31 | "$(FREERTOS_PLUS_TCP)/test/cbmc/proofs/utility" 32 | ] 33 | } 34 | 35 | -------------------------------------------------------------------------------- /test/unit-test/cmock/project.yml: -------------------------------------------------------------------------------- 1 | # Taken from amazon-freertos repository 2 | :cmock: 3 | :mock_prefix: mock_ 4 | :when_no_prototypes: :warn 5 | :enforce_strict_ordering: TRUE 6 | :plugins: 7 | - :ignore 8 | - :ignore_arg 9 | - :expect_any_args 10 | - :array 11 | - :callback 12 | - :return_thru_ptr 13 | :callback_include_count: true # include a count arg when calling the callback 14 | :callback_after_arg_check: false # check arguments before calling the callback 15 | :treat_as: 16 | uint8: HEX8 17 | uint16: HEX16 18 | uint32: UINT32 19 | int8: INT8 20 | bool: UINT8 21 | :includes: # This will add these includes to each mock. 22 | - 23 | - 24 | - 25 | - 26 | - FreeRTOS.h 27 | - FreeRTOS_IP.h 28 | :treat_externs: :exclude # Now the extern-ed functions will be mocked. 29 | :weak: __attribute__((weak)) 30 | :treat_externs: :include 31 | :strippables: 32 | - PRIVILEGED_FUNCTION 33 | - portDONT_DISCARD 34 | - portINLINE 35 | -------------------------------------------------------------------------------- /test/cbmc/proofs/prvChecksumIPv6Checks/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "prvChecksumIPv6Checks", 3 | "MAX_EXT_HEADER_NUM": 21, 4 | "CBMCFLAGS": 5 | [ 6 | "--unwind 1", 7 | "--nondet-static", 8 | "--unwindset usGetExtensionHeaderLength.0:{MAX_EXT_HEADER_NUM}", 9 | "--unwindset prvPrepareExtensionHeaders.0:{MAX_EXT_HEADER_NUM}", 10 | "--flush" 11 | ], 12 | "OBJS": 13 | [ 14 | "$(ENTRY)_harness.goto", 15 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IPv6.goto", 17 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IPv6_Utils.goto" 18 | ], 19 | "INSTFLAGS": 20 | [ 21 | ], 22 | "OPT": 23 | [ 24 | "--export-file-local-symbols" 25 | ], 26 | "DEF": 27 | [ 28 | "FREERTOS_TCP_ENABLE_VERIFICATION", 29 | "ipconfigNETWORK_MTU=200", 30 | "ipconfigTCP_MSS=586", 31 | "ipconfigUSE_DHCP=0" 32 | ], 33 | "INC": 34 | [ 35 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include", 36 | "$(FREERTOS_PLUS_TCP)/test/cbmc/proofs/utility", 37 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DHCP/DHCPProcessEndPoint/README.md: -------------------------------------------------------------------------------- 1 | This is the memory safety proof for DHCPProcessEndPoint function, which is the 2 | function that triggers the DHCP protocol. 3 | 4 | The main stubs in this proof deal with buffer management, which assume 5 | that the buffer is large enough to accommodate a DHCP message plus a 6 | few additional bytes for options (which is the last, variable-sized 7 | field in a DHCP message). We have abstracted away sockets, concurrency 8 | and third-party code. For more details, please check the comments on 9 | the harness file. 10 | 11 | This proof is a work-in-progress. Proof assumptions are described in 12 | the harness. The proof also assumes the following functions are 13 | memory safe and have no side effects relevant to the memory safety of 14 | this function: 15 | 16 | * FreeRTOS_sendto 17 | * FreeRTOS_setsockopt 18 | * FreeRTOS_socket 19 | * ulRand 20 | * vARPSendGratuitous 21 | * vApplicationIPNetworkEventHook 22 | * vLoggingPrintf 23 | * vPortEnterCritical 24 | * vPortExitCritical 25 | * vReleaseNetworkBufferAndDescriptor 26 | * vSocketBind 27 | * vSocketClose 28 | 29 | -------------------------------------------------------------------------------- /test/cbmc/proofs/TCP/prvTCPReturnPacket_IPv6/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "TCPReturnPacket_IPv6", 3 | "RX_MESSAGES":1, 4 | "CBMCFLAGS": 5 | [ 6 | "--unwind 1", 7 | "--nondet-static" 8 | ], 9 | "OBJS": 10 | [ 11 | "$(ENTRY)_harness.goto", 12 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Stream_Buffer.goto", 13 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 14 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_IP.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_Transmission_IPv6.goto", 17 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_Transmission.goto", 18 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 19 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 20 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto" 21 | ], 22 | "DEF": 23 | [ 24 | "ipconfigUSE_LINKED_RX_MESSAGES={RX_MESSAGES}", 25 | "FREERTOS_TCP_ENABLE_VERIFICATION", 26 | "CBMC_REQUIRE_NETWORKBUFFER_ETHERNETBUFFER_NONNULL" 27 | ], 28 | "INC": 29 | [ 30 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /test/cbmc/proofs/parsing/ProcessIPPacket/Configurations.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ProcessIPPacket", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset memcmp.0:7", 7 | "--unwindset FreeRTOS_AllEndPointsUp.0:2", 8 | "--nondet-static" 9 | ], 10 | "OPT": 11 | [ 12 | "--export-file-local-symbols" 13 | ], 14 | "OBJS": 15 | [ 16 | "$(ENTRY)_harness.goto", 17 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 19 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IPv4.goto" 20 | ], 21 | "DEF": 22 | [ 23 | { 24 | "ChecksumIncluded": 25 | [ 26 | "ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM=1", 27 | "FREERTOS_TCP_ENABLE_VERIFICATION", 28 | "ipconfigNETWORK_MTU=586" 29 | ] 30 | }, 31 | { 32 | "ChecksumNotIncluded": 33 | [ 34 | "ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM=0", 35 | "FREERTOS_TCP_ENABLE_VERIFICATION", 36 | "ipconfigNETWORK_MTU=586" 37 | ] 38 | } 39 | ], 40 | "INC": 41 | [ 42 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/DNSlookup/DNSlookup_harness.c: -------------------------------------------------------------------------------- 1 | /* FreeRTOS includes. */ 2 | #include "FreeRTOS.h" 3 | #include "queue.h" 4 | #include "list.h" 5 | 6 | /* FreeRTOS+TCP includes. */ 7 | #include "FreeRTOS_IP.h" 8 | #include "FreeRTOS_DNS.h" 9 | #include "FreeRTOS_IP_Private.h" 10 | 11 | /* This assumes that the length of the hostname is bounded by MAX_HOSTNAME_LEN. */ 12 | void * safeMalloc( size_t xWantedSize ) 13 | { 14 | if( xWantedSize == 0 ) 15 | { 16 | return NULL; 17 | } 18 | 19 | uint8_t byte; 20 | 21 | return byte ? malloc( xWantedSize ) : NULL; 22 | } 23 | 24 | void harness() 25 | { 26 | if( ipconfigUSE_DNS_CACHE != 0 ) 27 | { 28 | size_t len; 29 | __CPROVER_assume( len >= 0 && len <= MAX_HOSTNAME_LEN ); 30 | char * pcHostName = safeMalloc( len ); /* malloc is replaced by safeMalloc */ 31 | 32 | if( len && pcHostName ) 33 | { 34 | pcHostName[ len - 1 ] = NULL; 35 | } 36 | 37 | if( pcHostName ) /* guarding against NULL pointer */ 38 | { 39 | FreeRTOS_dnslookup( pcHostName ); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/DNSHandlePacket/DNShandlePacket_harness.c: -------------------------------------------------------------------------------- 1 | /* FreeRTOS includes. */ 2 | #include "FreeRTOS.h" 3 | #include "queue.h" 4 | 5 | /* FreeRTOS+TCP includes. */ 6 | #include "FreeRTOS_IP.h" 7 | #include "FreeRTOS_DNS.h" 8 | #include "FreeRTOS_IP_Private.h" 9 | 10 | /* CBMC includes. */ 11 | #include "cbmc.h" 12 | 13 | /* Function DNS_ParseDNSReply is proven to be correct separately. */ 14 | uint32_t DNS_ParseDNSReply( uint8_t * pucUDPPayloadBuffer, 15 | size_t uxBufferLength, 16 | struct freertos_addrinfo ** ppxAddressInfo, 17 | BaseType_t xExpected, 18 | uint16_t usPort ) 19 | { 20 | __CPROVER_assert( pucUDPPayloadBuffer != NULL, "pucUDPPayloadBuffer cannot be NULL" ); 21 | return nondet_uint32(); 22 | } 23 | 24 | void harness() 25 | { 26 | NetworkBufferDescriptor_t xNetworkBuffer; 27 | 28 | xNetworkBuffer.pucEthernetBuffer = malloc( sizeof( UDPPacket_t ) + sizeof( DNSMessage_t ) ); 29 | __CPROVER_assume( xNetworkBuffer.pucEthernetBuffer != NULL ); 30 | 31 | ulDNSHandlePacket( &xNetworkBuffer ); 32 | } 33 | -------------------------------------------------------------------------------- /test/cbmc/patches/patch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import logging 4 | import os 5 | import subprocess 6 | import sys 7 | from glob import glob 8 | 9 | from patches_constants import PATCHES_DIR 10 | 11 | def patch(): 12 | if os.path.isfile("patched"): 13 | sys.exit() 14 | 15 | applied_patches = [] 16 | failed_patches = [] 17 | for tmpfile in glob(os.path.join(PATCHES_DIR, "*.patch")): 18 | print("patch", tmpfile) 19 | result = subprocess.run(["git", "apply", "--ignore-space-change", "--ignore-whitespace", tmpfile], 20 | cwd=os.path.join("..", "..", "..", "..")) 21 | if result.returncode: 22 | failed_patches.append(tmpfile) 23 | logging.error("patching failed: %s", tmpfile) 24 | else: 25 | applied_patches.append(tmpfile) 26 | 27 | with open(os.path.join(PATCHES_DIR, "patched"), "w") as outp: 28 | print("Success:", file=outp) 29 | print("\n".join(map(lambda x: "\t" + x, applied_patches)), file=outp) 30 | 31 | print("Failure:", file=outp) 32 | print("\n".join(map(lambda x: "\t" + x, failed_patches)), file=outp) 33 | 34 | 35 | if __name__ == "__main__": 36 | patch() 37 | -------------------------------------------------------------------------------- /test/cbmc/proofs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | list(APPEND cbmc_compile_options 2 | -m32 3 | ) 4 | 5 | list(APPEND cbmc_compile_definitions 6 | CBMC 7 | WINVER=0x400 8 | _CONSOLE 9 | _CRT_SECURE_NO_WARNINGS 10 | _DEBUG 11 | _WIN32_WINNT=0x0500 12 | __PRETTY_FUNCTION__=__FUNCTION__ 13 | __free_rtos__ 14 | ) 15 | 16 | list(APPEND cbmc_compile_includes 17 | ${CMAKE_SOURCE_DIR}/Source/include 18 | ${CMAKE_SOURCE_DIR}/Source/portable/MSVC-MingW 19 | ${CMAKE_SOURCE_DIR}/Source/../../FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/BufferManagement 20 | ${CMAKE_SOURCE_DIR}/Source/../../FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/include 21 | ${CMAKE_SOURCE_DIR}/Source/../../FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/Compiler/MSVC 22 | ${cbmc_dir}/include 23 | ${cbmc_dir}/windows 24 | ) 25 | 26 | # Remove --flag for a specific proof with list(REMOVE_ITEM cbmc_flags --flag) 27 | list(APPEND cbmc_flags 28 | --32 29 | --bounds-check 30 | --pointer-check 31 | --div-by-zero-check 32 | --float-overflow-check 33 | --nan-check 34 | --nondet-static 35 | --pointer-overflow-check 36 | --signed-overflow-check 37 | --undefined-shift-check 38 | --unsigned-overflow-check 39 | ) 40 | 41 | -------------------------------------------------------------------------------- /test/cbmc/proofs/MakefileCommon.json: -------------------------------------------------------------------------------- 1 | { 2 | "FREERTOS_PLUS_TCP": [ " ../../.." ], 3 | "PROOFS": [ "." ], 4 | 5 | "DEF ": [ 6 | "WIN32", 7 | "WINVER=0x400", 8 | "_CONSOLE", 9 | "_CRT_SECURE_NO_WARNINGS", 10 | "_DEBUG", 11 | "_WIN32_WINNT=0x0500", 12 | "__PRETTY_FUNCTION__=__FUNCTION__", 13 | "__free_rtos__", 14 | 15 | "CBMC", 16 | "'configASSERT(X)=__CPROVER_assert(X,\"Assertion Error\")'", 17 | "'configPRECONDITION(X)=__CPROVER_assume(X)'", 18 | "'_static='", 19 | "'_volatile='" 20 | ], 21 | 22 | "INC ": [ 23 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/include", 24 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/portable/MSVC-MingW", 25 | "$(FREERTOS_PLUS_TCP)/source/include", 26 | "$(FREERTOS_PLUS_TCP)/source/portable/Compiler/MSVC", 27 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include", 28 | "$(FREERTOS_PLUS_TCP)/test/cbmc/patches", 29 | "$(FREERTOS_PLUS_TCP)/test/cbmc/windows", 30 | "$(FREERTOS_PLUS_TCP)/test/cbmc/windows2" 31 | ], 32 | 33 | "CBMCFLAGS ": [ 34 | "--object-bits 8", 35 | "--32" 36 | ], 37 | 38 | "FORWARD_SLASH": ["/"], 39 | 40 | "TYPE_HEADERS": [ 41 | "$(FREERTOS_PLUS_TCP)/test/FreeRTOS-Kernel/queue.c" 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARP_OutputARPRequest_buffer_alloc1/README.md: -------------------------------------------------------------------------------- 1 | This is the memory safety proof for ```FreeRTOS_OutputARPRequest``` 2 | method combined with the BufferAllocation_1.c allocation strategy. 3 | 4 | This proof is a work-in-progress. Proof assumptions are described in 5 | the harness. The proof also assumes the following functions are 6 | memory safe and have no side effects relevant to the memory safety of 7 | this function: 8 | 9 | * vPortEnterCritical 10 | * vPortExitCritical 11 | * vPortGenerateSimulatedInterrupt 12 | * vAssertCalled 13 | * xTaskGetSchedulerState 14 | * pvTaskIncrementMutexHeldCount 15 | * xTaskRemoveFromEventList 16 | * xTaskPriorityDisinherit 17 | 18 | This proof checks ```FreeRTOS_OutputARPRequest``` in multiple configurations. 19 | All assume the memory safety of uxNetworkInterfaceAllocateRAMToBuffers. 20 | * The ```config_minimal_configuration``` proof sets 21 | ```ipconfigUSE_LINKED_RX_MESSAGES=0```. 22 | * The ```config_minimal_configuration_linked_rx_messages``` proof sets 23 | ```ipconfigUSE_LINKED_RX_MESSAGES=1```. 24 | * The ```minimal_configuration_minimal_packet_size``` proof sets 25 | ```ipconfigETHERNET_MINIMUM_PACKET_BYTES``` to 50. 26 | 27 | All harnesses include the queue.c file, but test only for the happy path. 28 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DHCP/DHCPProcess/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "DHCPProcess", 3 | 4 | # Minimal buffer size for maximum coverage, see harness for details. 5 | "BUFFER_SIZE": 299, 6 | "ENDPOINT_DNS_ADDRESS_COUNT": 5, 7 | 8 | # The number of times GetNetworkBufferWithDescriptor can be allowed to fail 9 | # (plus 1). 10 | "FAILURE_BOUND": 2, 11 | "LOOP_UNWIND_COUNT": 4, 12 | 13 | "CBMCFLAGS": [ 14 | "--unwind {LOOP_UNWIND_COUNT}", 15 | "--nondet-static --flush" 16 | ], 17 | "OPT": 18 | [ 19 | "--export-file-local-symbols" 20 | ], 21 | "OBJS": 22 | [ 23 | "$(ENTRY)_harness.goto", 24 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 25 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DHCP.goto", 26 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 27 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto", 28 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto" 29 | ], 30 | "DEF": 31 | [ 32 | "FR_RECV_FROM_SUCCESS_COUNT={LOOP_UNWIND_COUNT}", 33 | "BUFFER_SIZE={BUFFER_SIZE}", 34 | "ipconfigDHCP_REGISTER_HOSTNAME=1", 35 | "CBMC_REQUIRE_NETWORKBUFFER_ETHERNETBUFFER_NONNULL=1", 36 | "CBMC_GETNETWORKBUFFER_FAILURE_BOUND={FAILURE_BOUND}", 37 | "ENDPOINT_DNS_ADDRESS_COUNT={ENDPOINT_DNS_ADDRESS_COUNT}" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /test/cbmc/proofs/prvChecksumIPv6Checks/prvChecksumIPv6Checks_harness.c: -------------------------------------------------------------------------------- 1 | /* Standard includes. */ 2 | #include 3 | #include 4 | 5 | /* FreeRTOS includes. */ 6 | #include "FreeRTOS.h" 7 | #include "task.h" 8 | #include "queue.h" 9 | #include "semphr.h" 10 | 11 | /* FreeRTOS+TCP includes. */ 12 | #include "FreeRTOS_IP.h" 13 | #include "FreeRTOS_IP_Private.h" 14 | #include "FreeRTOS_IPv6_Utils.h" 15 | 16 | /* CBMC includes. */ 17 | #include "cbmc.h" 18 | 19 | void harness() 20 | { 21 | size_t uxBufferSize; 22 | uint8_t * pucEthernetBuffer; 23 | struct xPacketSummary xSet; 24 | 25 | /* We must have ethernet header to get frame type. */ 26 | __CPROVER_assume( uxBufferSize >= sizeof( IPPacket_IPv6_t ) && uxBufferSize <= ipconfigNETWORK_MTU ); 27 | 28 | /* Ethernet buffer is not possible to be NULL. */ 29 | pucEthernetBuffer = ( uint8_t * ) safeMalloc( uxBufferSize ); 30 | __CPROVER_assume( pucEthernetBuffer != NULL ); 31 | 32 | /* This is set before calling prvChecksumIPv6Checks. */ 33 | xSet.pxIPPacket = ( const IPPacket_t * ) pucEthernetBuffer; 34 | xSet.pxIPPacket_IPv6 = ( const IPHeader_IPv6_t * ) ( pucEthernetBuffer + ipSIZE_OF_ETH_HEADER ); 35 | 36 | prvChecksumIPv6Checks( pucEthernetBuffer, 37 | uxBufferSize, 38 | &xSet ); 39 | } 40 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DHCP/DHCPProcessEndPoint/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "DHCPProcessEndPoint", 3 | 4 | # Minimal buffer size for maximum coverage, see harness for details. 5 | "BUFFER_SIZE": 299, 6 | "ENDPOINT_DNS_ADDRESS_COUNT": 5, 7 | 8 | # The number of times GetNetworkBufferWithDescriptor can be allowed to fail 9 | # (plus 1). 10 | "FAILURE_BOUND": 2, 11 | 12 | "CBMCFLAGS": [ 13 | "--unwind 4", 14 | "--unwindset strlen.0:11,memcmp.0:7", 15 | "--nondet-static --flush" 16 | ], 17 | "OPT": 18 | [ 19 | "--export-file-local-symbols" 20 | ], 21 | "OBJS": 22 | [ 23 | "$(ENTRY)_harness.goto", 24 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 25 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 26 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 27 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DHCP.goto", 28 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 29 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Timers.goto", 30 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto" 31 | ], 32 | "DEF": 33 | [ 34 | "BUFFER_SIZE={BUFFER_SIZE}", 35 | "ipconfigDHCP_REGISTER_HOSTNAME=1", 36 | "CBMC_REQUIRE_NETWORKBUFFER_ETHERNETBUFFER_NONNULL=1", 37 | "CBMC_GETNETWORKBUFFER_FAILURE_BOUND={FAILURE_BOUND}", 38 | "ENDPOINT_DNS_ADDRESS_COUNT={ENDPOINT_DNS_ADDRESS_COUNT}" 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "POSIX") ) 2 | return() 3 | endif() 4 | 5 | find_package(PCAP REQUIRED) 6 | set(THREADS_PREFER_PTHREAD_FLAG TRUE) 7 | find_package(Threads) 8 | 9 | #------------------------------------------------------------------------------ 10 | add_library( freertos_plus_tcp_network_if STATIC ) 11 | 12 | target_sources( freertos_plus_tcp_network_if 13 | PRIVATE 14 | NetworkInterface.c 15 | ) 16 | 17 | target_compile_options( freertos_plus_tcp_network_if 18 | PRIVATE 19 | $<$:-Wno-cast-align> 20 | $<$:-Wno-declaration-after-statement> 21 | $<$:-Wno-documentation> 22 | $<$:-Wno-missing-noreturn> 23 | $<$:-Wno-padded> 24 | $<$:-Wno-shorten-64-to-32> 25 | $<$:-Wno-undef> 26 | $<$:-Wno-unused-macros> 27 | $<$:-Wno-unused-parameter> 28 | ) 29 | 30 | target_link_libraries( freertos_plus_tcp_network_if 31 | PUBLIC 32 | freertos_plus_tcp_port 33 | freertos_plus_tcp_network_if_common 34 | PRIVATE 35 | freertos_kernel 36 | freertos_plus_tcp 37 | ${PCAP_LIBRARY} 38 | Threads::Threads 39 | ) 40 | -------------------------------------------------------------------------------- /test/cbmc/proofs/parsing/ProcessReceivedTCPPacket/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ProcessReceivedTCPPacket", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset prvTCPSendRepeated.0:13", 7 | "--nondet-static" 8 | ], 9 | "OBJS": 10 | [ 11 | "$(ENTRY)_harness.goto", 12 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 13 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 14 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 15 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 16 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 17 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Timers.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_IP.goto", 19 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_IP_IPv4.goto", 20 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_Transmission.goto", 21 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_Transmission_IPv4.goto", 22 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_State_Handling.goto", 23 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_Utils.goto", 24 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_TCP_Reception.goto" 25 | ], 26 | "INSTFLAGS": 27 | [ 28 | ], 29 | "DEF": 30 | [ 31 | "FREERTOS_TCP_ENABLE_VERIFICATION", 32 | "CBMC_GETNETWORKBUFFER_FAILURE_BOUND" 33 | ], 34 | "INC": 35 | [ 36 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 37 | ] 38 | } 39 | 40 | -------------------------------------------------------------------------------- /tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library( freertos_plus_tcp_utilities STATIC ) 2 | 3 | target_sources( freertos_plus_tcp_utilities 4 | PRIVATE 5 | tcp_utilities/include/tcp_dump_packets.h 6 | tcp_utilities/include/tcp_mem_stats.h 7 | tcp_utilities/include/tcp_netstat.h 8 | 9 | tcp_utilities/tcp_dump_packets.c 10 | tcp_utilities/tcp_mem_stats.c 11 | tcp_utilities/tcp_netstat.c 12 | ) 13 | 14 | # Note: Have to make system due to compiler warnings in header files. 15 | target_include_directories( freertos_plus_tcp_utilities SYSTEM 16 | PUBLIC 17 | tcp_utilities/include 18 | ) 19 | 20 | # Investigate and fix in freertos_plus_tcp if not already fixed. 21 | target_compile_options( freertos_plus_tcp_utilities 22 | PRIVATE 23 | $<$:-Wno-extra-semi-stmt> 24 | $<$:-Wno-format> 25 | $<$:-Wno-missing-variable-declarations> 26 | $<$:-Wno-padded> 27 | $<$:-Wno-unused-but-set-variable> 28 | $<$:-Wno-unused-function> 29 | $<$:-Wno-unused-macros> 30 | $<$:-Wno-unused-variable> 31 | ) 32 | 33 | target_link_libraries( freertos_plus_tcp_utilities 34 | PRIVATE 35 | freertos_kernel 36 | freertos_plus_tcp 37 | ) 38 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/NBNSHandlePacket/NBNSHandlePacket_harness.c: -------------------------------------------------------------------------------- 1 | /* FreeRTOS includes. */ 2 | #include "FreeRTOS.h" 3 | #include "queue.h" 4 | 5 | /* FreeRTOS+TCP includes. */ 6 | #include "FreeRTOS_IP.h" 7 | #include "FreeRTOS_DNS.h" 8 | #include "FreeRTOS_DNS_Parser.h" 9 | #include "FreeRTOS_IP_Private.h" 10 | 11 | #include "cbmc.h" 12 | 13 | NetworkBufferDescriptor_t xNetworkBuffer; 14 | 15 | /* DNS_TreatNBNS is proved separately */ 16 | void DNS_TreatNBNS( uint8_t * pucPayload, 17 | size_t uxBufferLength, 18 | uint32_t ulIPAddress ) 19 | { 20 | __CPROVER_assert( pucPayload != NULL, "Precondition: pucPayload != NULL" ); 21 | } 22 | 23 | void harness() 24 | { 25 | uint32_t ulIPAddress; 26 | 27 | BaseType_t xDataSize; 28 | 29 | /* Assume an upper limit on max memory that can be allocated */ 30 | __CPROVER_assume( ( xDataSize < ( ipconfigNETWORK_MTU + ipSIZE_OF_ETH_HEADER ) ) ); 31 | xNetworkBuffer.xDataLength = xDataSize; 32 | 33 | xNetworkBuffer.pucEthernetBuffer = safeMalloc( xDataSize ); 34 | 35 | /* pucEthernetBuffer being not NULL is pre validated before the call to ulNBNSHandlePacket */ 36 | __CPROVER_assume( xNetworkBuffer.pucEthernetBuffer != NULL ); 37 | 38 | xNetworkBuffer.pxEndPoint = ( NetworkEndPoint_t * ) safeMalloc( sizeof( NetworkEndPoint_t ) ); 39 | 40 | ulNBNSHandlePacket( &xNetworkBuffer ); 41 | } 42 | -------------------------------------------------------------------------------- /test/cbmc/proofs/utility/memory_assignments.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define ensure_memory_is_valid( px, length ) ( px != NULL ) && __CPROVER_w_ok( ( px ), length ) 4 | 5 | /* Implementation of safe malloc which returns NULL if the requested size is 0. 6 | * Warning: The behavior of malloc(0) is platform dependent. 7 | * It is possible for malloc(0) to return an address without allocating memory.*/ 8 | void * safeMalloc( size_t xWantedSize ) 9 | { 10 | return nondet_bool() ? malloc( xWantedSize ) : NULL; 11 | } 12 | 13 | /* Memory assignment for FreeRTOS_Socket_t */ 14 | FreeRTOS_Socket_t * ensure_FreeRTOS_Socket_t_is_allocated() 15 | { 16 | FreeRTOS_Socket_t * pxSocket = safeMalloc( sizeof( FreeRTOS_Socket_t ) ); 17 | 18 | if( ensure_memory_is_valid( pxSocket, sizeof( FreeRTOS_Socket_t ) ) ) 19 | { 20 | pxSocket->u.xTCP.rxStream = safeMalloc( sizeof( StreamBuffer_t ) ); 21 | pxSocket->u.xTCP.txStream = safeMalloc( sizeof( StreamBuffer_t ) ); 22 | pxSocket->u.xTCP.pxPeerSocket = safeMalloc( sizeof( FreeRTOS_Socket_t ) ); 23 | pxSocket->pxEndPoint = safeMalloc( sizeof( NetworkEndPoint_t ) ); 24 | } 25 | 26 | return pxSocket; 27 | } 28 | 29 | /* Memory assignment for FreeRTOS_Network_Buffer */ 30 | NetworkBufferDescriptor_t * ensure_FreeRTOS_NetworkBuffer_is_allocated() 31 | { 32 | return safeMalloc( sizeof( NetworkBufferDescriptor_t ) ); 33 | } 34 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARP_FreeRTOS_OutputARPRequest/README.md: -------------------------------------------------------------------------------- 1 | This is the memory safety proof for FreeRTOS_OutputARPRequest. 2 | 3 | This proof is a work-in-progress. Proof assumptions are described in 4 | the harness. The proof also assumes the following functions are 5 | memory safe and have no side effects relevant to the memory safety of 6 | this function: 7 | 8 | * xNetworkInterfaceOutput 9 | 10 | This proof checks FreeRTOS_OutputARPRequest in multiple configuration: 11 | 12 | * The config_CBMC_PROOF_ASSUMPTION_HOLDS_no_packet_bytes proof 13 | guarantees that for a buffer allocated to xDataLength, 14 | the code executed by the FreeRTOS_OutputARPRequest function 15 | call of FreeRTOS_ARP.c is memory safe. 16 | * If the ipconfigETHERNET_MINIMUM_PACKET_BYTES is set and the 17 | buffer allocated by pxGetNetworkBufferWithDescriptor allocates 18 | a buffer of at least ipconfigETHERNET_MINIMUM_PACKET_BYTES, 19 | the config_CBMC_PROOF_ASSUMPTION_HOLDS_Packet_bytes proof 20 | guarantees that the code executed by the 21 | FreeRTOS_OutputARPRequest function call 22 | of FreeRTOS_ARP.c is memory safe. 23 | * The third configuration in the subdirectory 24 | config_CBMC_PROOF_ASSUMPTION_DOES_NOT_HOLD demonstrates 25 | that the code is not memory safe, if the allocation 26 | code violates our assumption. 27 | * All proofs mock the pxGetNetworkBufferWithDescriptor 28 | function for modelling the assumptions about the 29 | buffer management layer. 30 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/Zynq/x_emacpsif_hw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2013 Xilinx, Inc. All rights reserved. 3 | * 4 | * Xilinx, Inc. 5 | * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 6 | * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS 7 | * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 8 | * STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION 9 | * IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 10 | * FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION. 11 | * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 12 | * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 13 | * ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 14 | * FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 15 | * AND FITNESS FOR A PARTICULAR PURPOSE. 16 | * 17 | */ 18 | 19 | #ifndef __XEMACPSIF_HW_H_ 20 | #define __XEMACPSIF_HW_H_ 21 | 22 | #include "Zynq/x_emacpsif.h" 23 | /*#include "lwip/netif.h" */ 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | XEmacPs_Config * lookup_config( unsigned mac_base ); 30 | 31 | /*void init_emacps(xemacpsif_s *xemacpsif, struct netif *netif); */ 32 | 33 | int emacps_check_errors( xemacpsif_s * xemacps ); 34 | 35 | #ifdef __cplusplus 36 | } /* extern "C" */ 37 | #endif 38 | 39 | #endif /* __XEMACPSIF_HW_H_ */ 40 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DNS/DNSgetHostByName_cancel/Makefile.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "DNSgetHostByName_cancel", 3 | ################################################################ 4 | # This configuration flag sets callback to 1. It also sets MAX_HOSTNAME_LEN to 10 for performance issues. 5 | # According to the specification MAX_HOST_NAME is upto 255. 6 | "callback": 1, 7 | "MAX_HOSTNAME_LEN": 10, 8 | "HOSTNAME_UNWIND": "__eval {MAX_HOSTNAME_LEN} + 1", 9 | "CBMCFLAGS": 10 | [ 11 | "--unwind 1", 12 | "--unwindset prvProcessDNSCache.0:5,strlen.0:{HOSTNAME_UNWIND},__builtin___strcpy_chk.0:{HOSTNAME_UNWIND},vDNSCheckCallBack.0:2,strcpy.0:{HOSTNAME_UNWIND}", 13 | "--unwindset strncpy.0:{HOSTNAME_UNWIND}" 14 | ], 15 | "OBJS": 16 | [ 17 | "$(ENTRY)_harness.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Utils.goto", 19 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Timers.goto", 20 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS.goto", 21 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DNS_Callback.goto", 22 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 23 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto", 24 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto" 25 | ], 26 | "DEF": 27 | [ 28 | "ipconfigDNS_USE_CALLBACKS={callback}", 29 | "MAX_HOSTNAME_LEN={MAX_HOSTNAME_LEN}", 30 | # This value is defined only when ipconfigUSE_DNS_CACHE==1 31 | "ipconfigDNS_CACHE_NAME_LENGTH=254" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /test/cbmc/proofs/xRecv_Update_IPv6/xRecv_Update_IPv6_harness.c: -------------------------------------------------------------------------------- 1 | /* Standard includes. */ 2 | #include 3 | #include 4 | 5 | /* FreeRTOS includes. */ 6 | #include "FreeRTOS.h" 7 | #include "task.h" 8 | #include "queue.h" 9 | #include "semphr.h" 10 | 11 | /* FreeRTOS+TCP includes. */ 12 | #include "FreeRTOS_IP.h" 13 | #include "FreeRTOS_IPv6_Sockets.h" 14 | 15 | /* CBMC includes. */ 16 | #include "cbmc.h" 17 | 18 | void harness() 19 | { 20 | NetworkBufferDescriptor_t * pxNetworkBuffer = safeMalloc( sizeof( NetworkBufferDescriptor_t ) ); 21 | uint8_t * pxEthBuffer = safeMalloc( ipTOTAL_ETHERNET_FRAME_SIZE + ipIP_TYPE_OFFSET ); 22 | struct freertos_sockaddr * pxSourceAddress = safeMalloc( sizeof( struct freertos_sockaddr ) ); 23 | 24 | /* Network buffer is checked in FreeRTOS_recvfrom. */ 25 | __CPROVER_assume( pxNetworkBuffer != NULL ); 26 | 27 | /* Ethernet buffer is checked in xProcessReceivedUDPPacket_IPv6 before adding to the list. */ 28 | __CPROVER_assume( pxEthBuffer != NULL ); 29 | 30 | /* Points to ethernet buffer offset by ipIP_TYPE_OFFSET, this make sure the buffer allocation is similar 31 | * to the pxGetNetworkBufferWithDescriptor */ 32 | pxNetworkBuffer->pucEthernetBuffer = &( pxEthBuffer[ ipIP_TYPE_OFFSET ] ); 33 | 34 | /* Randomize address as input for different scenarios. */ 35 | __CPROVER_havoc_object( pxSourceAddress ); 36 | 37 | xRecv_Update_IPv6( pxNetworkBuffer, pxSourceAddress ); 38 | } 39 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Each line is a file pattern followed by one or more owners. 2 | 3 | # These owners will be the default owners for everything in 4 | # the repo. Unless a later match takes precedence, 5 | # @global-owner1 and @global-owner2 will be requested for 6 | # review when someone opens a pull request. 7 | * @FreeRTOS/pr-bar-raisers 8 | 9 | # Order is important; the last matching pattern takes the most 10 | # precedence. When someone opens a pull request that only 11 | # modifies JS files, only @js-owner and not the global 12 | # owner(s) will be requested for a review. 13 | # *.c FreeRTOS/pr-bar-raiser 14 | 15 | # You can also use email addresses if you prefer. They'll be 16 | # used to look up users just like we do for commit author 17 | # emails. 18 | # *.go docs@example.com 19 | 20 | # In this example, @doctocat owns any files in the build/logs 21 | # directory at the root of the repository and any of its 22 | # subdirectories. 23 | # /build/logs/ @doctocat 24 | 25 | # The `docs/*` pattern will match files like 26 | # `docs/getting-started.md` but not further nested files like 27 | # `docs/build-app/troubleshooting.md`. 28 | # docs/* docs@example.com 29 | 30 | # In this example, @octocat owns any file in an apps directory 31 | # anywhere in your repository. 32 | # apps/ @octocat 33 | 34 | # In this example, @doctocat owns any file in the `/docs` 35 | # directory in the root of your repository and any of its 36 | # subdirectories. 37 | # /docs/ @doctocat 38 | 39 | 40 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/xilinx_ultrascale/x_emacpsif_hw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2013 Xilinx, Inc. All rights reserved. 3 | * 4 | * Xilinx, Inc. 5 | * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 6 | * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS 7 | * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 8 | * STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION 9 | * IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 10 | * FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION. 11 | * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 12 | * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 13 | * ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 14 | * FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 15 | * AND FITNESS FOR A PARTICULAR PURPOSE. 16 | * 17 | */ 18 | 19 | #ifndef __XEMACPSIF_HW_H_ 20 | #define __XEMACPSIF_HW_H_ 21 | 22 | #include "x_emacpsif.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | XEmacPs_Config * lookup_config( unsigned mac_base ); 29 | 30 | int emacps_check_errors( xemacpsif_s * xemacps ); 31 | 32 | /* Defined in x_emacpsif_physpeed.c. */ 33 | uint32_t ulDetectPHY( XEmacPs * xemacpsp ); 34 | 35 | 36 | #ifdef __cplusplus 37 | } /* extern "C" */ 38 | #endif 39 | 40 | #endif /* ifndef __XEMACPSIF_HW_H_ */ 41 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPGetCacheEntry/Configurations.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "ARPGetCacheEntry", 3 | "CBMCFLAGS": 4 | [ 5 | "--unwind 1", 6 | "--unwindset prvCacheLookup.0:7", 7 | "--unwindset FreeRTOS_FindEndPointOnIP_IPv4.0:3", 8 | "--unwindset FreeRTOS_InterfaceEndPointOnNetMask.0:3", 9 | "--unwindset xIsIPv4Broadcast.0:3", 10 | "--unwindset eARPGetCacheEntry.0:3", 11 | "--unwindset FreeRTOS_FindGateWay.0:3", 12 | "--nondet-static" 13 | ], 14 | "OBJS": 15 | [ 16 | "$(ENTRY)_harness.goto", 17 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_Routing.goto", 18 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IPv4.goto", 19 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IPv4_Utils.goto", 20 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_ARP.goto" 21 | ], 22 | "DEF": 23 | [ 24 | { 25 | "ARPGetCacheEntry_default":[ 26 | "ipconfigARP_STORES_REMOTE_ADDRESSES=0", 27 | "ipconfigUSE_LLMNR=0" 28 | ] 29 | }, 30 | { 31 | "ARPGetCacheEntry_LLMNR": [ 32 | "ipconfigARP_STORES_REMOTE_ADDRESSES=0", 33 | "ipconfigUSE_LLMNR=1" 34 | ] 35 | }, 36 | { 37 | "ARPGetCacheEntry_STORE_REMOTE": [ 38 | "ipconfigARP_STORES_REMOTE_ADDRESSES=1", 39 | "ipconfigUSE_LLMNR=0" 40 | ] 41 | }, 42 | { 43 | "ARPGetCacheEntry_REMOTE_LLMNR": [ 44 | "ipconfigARP_STORES_REMOTE_ADDRESSES=1", 45 | "ipconfigUSE_LLMNR=1" 46 | ] 47 | } 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPGenerateRequestPacket/ARPGenerateRequestPacket_harness.c: -------------------------------------------------------------------------------- 1 | /* FreeRTOS includes. */ 2 | #include "FreeRTOS.h" 3 | #include "queue.h" 4 | 5 | /* FreeRTOS+TCP includes. */ 6 | #include "FreeRTOS_IP.h" 7 | #include "FreeRTOS_IP_Private.h" 8 | #include "FreeRTOS_ARP.h" 9 | 10 | void harness() 11 | { 12 | /* 13 | * The assumption made here is that the buffer pointed by pucEthernetBuffer 14 | * is at least allocated to sizeof(ARPPacket_t) size but eventually a even larger buffer. 15 | * This is not checked inside vARPGenerateRequestPacket. 16 | */ 17 | uint8_t ucBUFFER_SIZE; 18 | 19 | __CPROVER_assume( ucBUFFER_SIZE >= sizeof( ARPPacket_t ) && ucBUFFER_SIZE < 2 * sizeof( ARPPacket_t ) ); 20 | void * xBuffer = malloc( ucBUFFER_SIZE ); 21 | 22 | __CPROVER_assume( xBuffer != NULL ); 23 | 24 | NetworkBufferDescriptor_t xNetworkBuffer2; 25 | 26 | xNetworkBuffer2.pucEthernetBuffer = xBuffer; 27 | xNetworkBuffer2.xDataLength = ucBUFFER_SIZE; 28 | 29 | /* 30 | * This proof assumes one end point is present. 31 | */ 32 | xNetworkBuffer2.pxEndPoint = ( NetworkEndPoint_t * ) malloc( sizeof( NetworkEndPoint_t ) ); 33 | __CPROVER_assume( xNetworkBuffer2.pxEndPoint != NULL ); 34 | xNetworkBuffer2.pxEndPoint->pxNext = NULL; 35 | 36 | /* vARPGenerateRequestPacket asserts buffer has room for a packet */ 37 | __CPROVER_assume( xNetworkBuffer2.xDataLength >= sizeof( ARPPacket_t ) ); 38 | vARPGenerateRequestPacket( &xNetworkBuffer2 ); 39 | } 40 | -------------------------------------------------------------------------------- /test/cbmc/proofs/parsing/ProcessIPPacket_IPv6/prvAllowIPPacketIPv6/Configurations.json: -------------------------------------------------------------------------------- 1 | { 2 | "ENTRY": "prvAllowIPPacketIPv6", 3 | "MAX_EXT_HEADER_PARSING_LOOP": 21, 4 | "IPV6_ADDRESS_LOOP": 17, 5 | "CBMCFLAGS": 6 | [ 7 | "--unwind 1", 8 | "--unwindset memcmp.0:{IPV6_ADDRESS_LOOP}", 9 | "--unwindset memcmp.1:{IPV6_ADDRESS_LOOP}", 10 | "--unwindset __CPROVER_file_local_FreeRTOS_IPv6_c_xCheckIPv6SizeFields.0:{MAX_EXT_HEADER_PARSING_LOOP}", 11 | "--nondet-static" 12 | ], 13 | "OPT": 14 | [ 15 | "--export-file-local-symbols" 16 | ], 17 | "OBJS": 18 | [ 19 | "$(ENTRY)_harness.goto", 20 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/cbmc.goto", 21 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IPv6.goto" 22 | ], 23 | "DEF": 24 | [ 25 | { 26 | "ChecksumIncluded": 27 | [ 28 | "ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM=1", 29 | "ipconfigETHERNET_DRIVER_FILTERS_PACKE,TS=1", 30 | "FREERTOS_TCP_ENABLE_VERIFICATION", 31 | "ipconfigNETWORK_MTU=200", 32 | "ipconfigTCP_MSS=586", 33 | "ipconfigUSE_DHCP=0" 34 | ] 35 | }, 36 | { 37 | "ChecksumNotIncluded": 38 | [ 39 | "ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM=0", 40 | "ipconfigETHERNET_DRIVER_FILTERS_PACKETS=0", 41 | "FREERTOS_TCP_ENABLE_VERIFICATION", 42 | "ipconfigNETWORK_MTU=200", 43 | "ipconfigTCP_MSS=586", 44 | "ipconfigUSE_DHCP=0" 45 | ] 46 | } 47 | ], 48 | "INC": 49 | [ 50 | "$(FREERTOS_PLUS_TCP)/test/cbmc/include" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /.github/workflows/release-candidate.yml: -------------------------------------------------------------------------------- 1 | name: Release Candidate Automation 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | commit_id: 7 | description: 'Commit ID to tag' 8 | required: true 9 | version_number: 10 | description: 'Release Version Number (Eg, v1.0.0-rc1)' 11 | required: true 12 | 13 | # Workflow permissions block 14 | permissions: 15 | contents: write # This grants write access to repository content, including pushing commits/tags and creating releases. 16 | 17 | jobs: 18 | tag-commit: 19 | name: Tag commit 20 | runs-on: ubuntu-latest 21 | steps: 22 | - name: Checkout code 23 | uses: actions/checkout@v4 24 | with: 25 | ref: ${{ github.event.inputs.commit_id }} 26 | - name: Configure git identity 27 | run: | 28 | git config --global user.name ${{ github.actor }} 29 | git config --global user.email ${{ github.actor }}@users.noreply.github.com 30 | - name: Tag Commit and Push to Remote 31 | run: | 32 | git tag ${{ github.event.inputs.version_number }} -a -m "FreeRTOS-Plus-TCP Library ${{ github.event.inputs.version_number }}" 33 | git push origin --tags 34 | - name: Verify tag on remote 35 | run: | 36 | git tag -d ${{ github.event.inputs.version_number }} 37 | git remote update 38 | git checkout tags/${{ github.event.inputs.version_number }} 39 | git diff ${{ github.event.inputs.commit_id }} tags/${{ github.event.inputs.version_number }} 40 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPGetCacheEntry/ARPGetCacheEntry_harness.c: -------------------------------------------------------------------------------- 1 | /* FreeRTOS includes. */ 2 | #include "FreeRTOS.h" 3 | #include "queue.h" 4 | 5 | /* FreeRTOS+TCP includes. */ 6 | #include "FreeRTOS_IP.h" 7 | #include "FreeRTOS_IP_Private.h" 8 | #include "FreeRTOS_ARP.h" 9 | 10 | 11 | void harness() 12 | { 13 | uint32_t ulIPAddress; 14 | MACAddress_t xMACAddress; 15 | struct xNetworkEndPoint * pxEndPoint = NULL; 16 | 17 | /* 18 | * For this proof, its assumed that the endpoints and interfaces are correctly 19 | * initialised and the pointers are set correctly. 20 | * Assumes one endpoint and interface is present. 21 | */ 22 | 23 | pxNetworkEndPoints = ( NetworkEndPoint_t * ) malloc( sizeof( NetworkEndPoint_t ) ); 24 | __CPROVER_assume( pxNetworkEndPoints != NULL ); 25 | 26 | /* Interface init. */ 27 | pxNetworkEndPoints->pxNetworkInterface = ( NetworkInterface_t * ) malloc( sizeof( NetworkInterface_t ) ); 28 | __CPROVER_assume( pxNetworkEndPoints->pxNetworkInterface != NULL ); 29 | 30 | if( nondet_bool() ) 31 | { 32 | pxNetworkEndPoints->pxNext = ( NetworkEndPoint_t * ) malloc( sizeof( NetworkEndPoint_t ) ); 33 | __CPROVER_assume( pxNetworkEndPoints->pxNext != NULL ); 34 | pxNetworkEndPoints->pxNext->pxNext = NULL; 35 | pxNetworkEndPoints->pxNext->pxNetworkInterface = pxNetworkEndPoints->pxNetworkInterface; 36 | } 37 | else 38 | { 39 | pxNetworkEndPoints->pxNext = NULL; 40 | } 41 | 42 | eARPGetCacheEntry( &ulIPAddress, &xMACAddress, &pxEndPoint ); 43 | } 44 | -------------------------------------------------------------------------------- /test/cbmc/proofs/DHCP/IsDHCPSocket/Makefile.json: -------------------------------------------------------------------------------- 1 | # 2 | # FreeRTOS memory safety proofs with CBMC. 3 | # Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person 6 | # obtaining a copy of this software and associated documentation 7 | # files (the "Software"), to deal in the Software without 8 | # restriction, including without limitation the rights to use, copy, 9 | # modify, merge, publish, distribute, sublicense, and/or sell copies 10 | # of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | # SOFTWARE. 24 | # 25 | # http://aws.amazon.com/freertos 26 | # http://www.FreeRTOS.org 27 | # 28 | 29 | { 30 | "ENTRY": "IsDHCPSocket", 31 | "CBMCFLAGS": 32 | [ 33 | "--unwind 1" 34 | ], 35 | "OBJS": 36 | [ 37 | "$(ENTRY)_harness.goto", 38 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_DHCP.goto" 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/ARP_DataLenLessThanMinPacket_list_macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | #ifndef LIST_MACRO_H 29 | #define LIST_MACRO_H 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #endif /* ifndef LIST_MACRO_H */ 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve FreeRTOS-Plus-TCP. This should only be used 4 | for confirmed bugs. If you suspect something it is best to first discuss it on the 5 | FreeRTOS forums linked below. 6 | title: "[BUG]" 7 | labels: bug 8 | assignees: '' 9 | 10 | --- 11 | 12 | **Describe the bug** 13 | A concise description of what the bug is. If possible, that is the code is not proprietary, please upload the code in a [GitHub fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) such that we can reproduce the bug. 14 | 15 | **Target** 16 | - Development board: [e.g. HiFive11 RevB] 17 | - Instruction Set Architecture: [e.g. RV32IMAC] 18 | - IDE and version: [e.g. Freedom Studio 4.12.0.2019-08-2] 19 | - Toolchain and version: [e.g. riscv64-unknown-elf-gcc-8.3.0-2019.08.0] 20 | 21 | **Host** 22 | - Host OS: [e.g. MacOS] 23 | - Version: [e.g. Mojave 10.14.6] 24 | 25 | **To Reproduce** 26 | - Use project ... and configure with ... 27 | - Run on ... and could observe ... 28 | 29 | **Expected behavior** 30 | A concise description of what you expected to happen. 31 | 32 | **Screenshots** 33 | If applicable, add screenshots to help explain your problem. 34 | 35 | **Wireshark logs** 36 | To help us identify the issue and/or reproduce it, please attach Wireshark logs if applicable. 37 | 38 | **Additional context** 39 | Add any other context about the problem here. 40 | e.g. code snippet to reproduce the issue. 41 | e.g. stack trace, memory dump, debugger log, and many etc. 42 | 43 | 44 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/MPS4_CS315/Device/Include/system_SSE315.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2024 Arm Limited 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * This file is derivative of CMSIS V5.9.0 system_ARMCM85.h 19 | * Git SHA: 2b7495b8535bdcb306dac29b9ded4cfb679d7e5c 20 | */ 21 | 22 | #ifndef __SYSTEM_CORE_INIT_H__ 23 | #define __SYSTEM_CORE_INIT_H__ 24 | 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 32 | extern uint32_t PeripheralClock; /*!< Peripheral Clock Frequency */ 33 | 34 | /** 35 | * \brief Exception / Interrupt Handler Function Prototype 36 | */ 37 | typedef void (* VECTOR_TABLE_Type)( void ); 38 | 39 | /** 40 | * \brief Initializes the system 41 | */ 42 | extern void SystemInit( void ); 43 | 44 | /** 45 | * \brief Restores system core clock 46 | */ 47 | extern void SystemCoreClockUpdate( void ); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* __SYSTEM_CORE_INIT_H__ */ 54 | -------------------------------------------------------------------------------- /test/cbmc/proofs/CBMCStubLibrary/tasksStubs.c: -------------------------------------------------------------------------------- 1 | #include "FreeRTOS.h" 2 | #include "task.h" 3 | #include "tasksStubs.h" 4 | 5 | #ifndef TASK_STUB_COUNTER 6 | #define TASK_STUB_COUNTER 0; 7 | #endif 8 | 9 | /* 5 is a magic number, but we need some number here as a default value. 10 | * This value is used to bound any loop depending on xTaskCheckForTimeOut 11 | * as a loop bound. It should be overwritten in the Makefile.json adapting 12 | * to the performance requirements of the harness. */ 13 | #ifndef TASK_STUB_COUNTER_LIMIT 14 | #define TASK_STUB_COUNTER_LIMIT 5; 15 | #endif 16 | 17 | 18 | static BaseType_t xCounter = TASK_STUB_COUNTER; 19 | static BaseType_t xCounterLimit = TASK_STUB_COUNTER_LIMIT; 20 | 21 | BaseType_t xTaskGetSchedulerState( void ) 22 | { 23 | return xState; 24 | } 25 | 26 | 27 | /* This function is another method apart from overwriting the defines to init the max 28 | * loop bound. */ 29 | void vInitTaskCheckForTimeOut( BaseType_t maxCounter, 30 | BaseType_t maxCounter_limit ) 31 | { 32 | xCounter = maxCounter; 33 | xCounterLimit = maxCounter_limit; 34 | } 35 | 36 | /* This is mostly called in a loop. For CBMC, we have to bound the loop 37 | * to a max limits of calls. Therefore this Stub models a nondet timeout in 38 | * max TASK_STUB_COUNTER_LIMIT iterations.*/ 39 | BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, 40 | TickType_t * const pxTicksToWait ) 41 | { 42 | ++xCounter; 43 | 44 | if( xCounter == xCounterLimit ) 45 | { 46 | return pdTRUE; 47 | } 48 | else 49 | { 50 | return nondet_basetype(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ProcessDHCPReplies/ProcessDHCPReplies_harness.c: -------------------------------------------------------------------------------- 1 | /* Standard includes. */ 2 | #include 3 | 4 | /* FreeRTOS includes. */ 5 | #include "FreeRTOS.h" 6 | #include "task.h" 7 | #include "semphr.h" 8 | 9 | /* FreeRTOS+TCP includes. */ 10 | #include "FreeRTOS_IP.h" 11 | #include "FreeRTOS_Sockets.h" 12 | #include "FreeRTOS_IP_Private.h" 13 | #include "FreeRTOS_UDP_IP.h" 14 | #include "FreeRTOS_DHCP.h" 15 | #include "FreeRTOS_ARP.h" 16 | 17 | 18 | /**************************************************************** 19 | * Signature of function under test 20 | ****************************************************************/ 21 | 22 | BaseType_t __CPROVER_file_local_FreeRTOS_DHCP_c_prvProcessDHCPReplies( BaseType_t xExpectedMessageType, 23 | NetworkEndPoint_t * pxEndPoint ); 24 | 25 | /**************************************************************** 26 | * The proof for FreeRTOS_gethostbyname. 27 | ****************************************************************/ 28 | 29 | void harness() 30 | { 31 | /* Omitting model of an unconstrained xDHCPData because xDHCPData is */ 32 | /* the source of uninitialized data only on line 647 to set a */ 33 | /* transaction id is an outgoing message */ 34 | 35 | BaseType_t xExpectedMessageType; 36 | 37 | NetworkEndPoint_t * pxNetworkEndPoint_Temp = ( NetworkEndPoint_t * ) malloc( sizeof( NetworkEndPoint_t ) ); 38 | 39 | __CPROVER_assume( pxNetworkEndPoint_Temp != NULL ); 40 | pxNetworkEndPoint_Temp->pxNext = NULL; 41 | 42 | __CPROVER_file_local_FreeRTOS_DHCP_c_prvProcessDHCPReplies( xExpectedMessageType, pxNetworkEndPoint_Temp ); 43 | } 44 | -------------------------------------------------------------------------------- /source/portable/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library( freertos_plus_tcp_port STATIC ) 2 | 3 | target_sources( freertos_plus_tcp_port 4 | PRIVATE 5 | BufferManagement/BufferAllocation_${FREERTOS_PLUS_TCP_BUFFER_ALLOCATION}.c 6 | # Note: There's NetworkInterface/pic32mzef that has it's own BufferAllocation_2.c 7 | ) 8 | 9 | target_include_directories( freertos_plus_tcp_port 10 | PUBLIC 11 | # Using Cmake to detect except for unknown compilers. 12 | $<$:${CMAKE_CURRENT_SOURCE_DIR}/Compiler/CCS> 13 | $<$:${CMAKE_CURRENT_SOURCE_DIR}/Compiler/CCS> 14 | $<$:${CMAKE_CURRENT_SOURCE_DIR}/Compiler/GCC> 15 | $<$:${CMAKE_CURRENT_SOURCE_DIR}/Compiler/Tasking> 16 | $<$:${CMAKE_CURRENT_SOURCE_DIR}/Compiler/IAR> 17 | $<$:${CMAKE_CURRENT_SOURCE_DIR}/Compiler/Keil> 18 | $<$:${CMAKE_CURRENT_SOURCE_DIR}/Compiler/MSVC> 19 | $<$:${CMAKE_CURRENT_SOURCE_DIR}/Compiler/Renesas> 20 | ) 21 | 22 | target_compile_options( freertos_plus_tcp_port 23 | PRIVATE 24 | $<$:-Wno-cast-align> 25 | $<$:-Wno-extra-semi-stmt> 26 | $<$:-Wno-pedantic> # Strange definition for STATIC_ASSERT 27 | ) 28 | 29 | target_link_libraries( freertos_plus_tcp_port 30 | PRIVATE 31 | freertos_kernel 32 | freertos_plus_tcp 33 | freertos_plus_tcp_network_if 34 | ) 35 | 36 | #------------------------------------------------------------------------------ 37 | add_subdirectory(NetworkInterface) 38 | -------------------------------------------------------------------------------- /test/cbmc/proofs/ARP/ARPRefreshCacheEntry/ARPRefreshCacheEntry_harness.c: -------------------------------------------------------------------------------- 1 | /* FreeRTOS includes. */ 2 | #include "FreeRTOS.h" 3 | #include "queue.h" 4 | 5 | /* FreeRTOS+TCP includes. */ 6 | #include "FreeRTOS_IP.h" 7 | #include "FreeRTOS_ARP.h" 8 | 9 | void harness() 10 | { 11 | MACAddress_t xMACAddress; 12 | uint32_t ulIPAddress; 13 | 14 | /* 15 | * For this proof, its assumed that the endpoints and interfaces are correctly 16 | * initialised and the pointers are set correctly. 17 | * Assumes one endpoints and interface is present. 18 | */ 19 | 20 | pxNetworkEndPoints = ( NetworkEndPoint_t * ) malloc( sizeof( NetworkEndPoint_t ) ); 21 | __CPROVER_assume( pxNetworkEndPoints != NULL ); 22 | 23 | /* Interface init. */ 24 | pxNetworkEndPoints->pxNetworkInterface = ( NetworkInterface_t * ) malloc( sizeof( NetworkInterface_t ) ); 25 | __CPROVER_assume( pxNetworkEndPoints->pxNetworkInterface != NULL ); 26 | 27 | if( nondet_bool() ) 28 | { 29 | pxNetworkEndPoints->pxNext = ( NetworkEndPoint_t * ) malloc( sizeof( NetworkEndPoint_t ) ); 30 | __CPROVER_assume( pxNetworkEndPoints->pxNext != NULL ); 31 | pxNetworkEndPoints->pxNext->pxNext = NULL; 32 | pxNetworkEndPoints->pxNext->pxNetworkInterface = pxNetworkEndPoints->pxNetworkInterface; 33 | } 34 | else 35 | { 36 | pxNetworkEndPoints->pxNext = NULL; 37 | } 38 | 39 | NetworkEndPoint_t * pxEndPoint = ( NetworkEndPoint_t * ) malloc( sizeof( NetworkEndPoint_t ) ); 40 | __CPROVER_assume( pxEndPoint != NULL ); 41 | 42 | vARPRefreshCacheEntry( &xMACAddress, ulIPAddress, pxEndPoint ); 43 | vARPRefreshCacheEntry( NULL, ulIPAddress, pxEndPoint ); 44 | } 45 | -------------------------------------------------------------------------------- /test/unit-test/FreeRTOS_TCP_State_Handling_IPv4/TCP_State_Handling_IPv4_list_macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | #ifndef LIST_MACRO_H 29 | #define LIST_MACRO_H 30 | 31 | #include 32 | 33 | BaseType_t prvTCPSocketCopy( FreeRTOS_Socket_t * pxNewSocket, 34 | FreeRTOS_Socket_t * pxSocket ); 35 | 36 | #endif /* ifndef LIST_MACRO_H */ 37 | -------------------------------------------------------------------------------- /test/unit-test/FreeRTOS_TCP_Transmission_IPv6/TCP_Transmission_IPv6_list_macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | #ifndef LIST_MACRO_H 28 | #define LIST_MACRO_H 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | BaseType_t prvTCPCreateWindow( FreeRTOS_Socket_t * pxSocket ); 36 | 37 | #endif /* ifndef LIST_MACRO_H */ 38 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/xilinx_ultrascale/x_topology.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2013 Xilinx, Inc. All rights reserved. 3 | * 4 | * Xilinx, Inc. 5 | * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 6 | * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS 7 | * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 8 | * STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION 9 | * IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 10 | * FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION. 11 | * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 12 | * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 13 | * ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 14 | * FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 15 | * AND FITNESS FOR A PARTICULAR PURPOSE. 16 | * 17 | */ 18 | 19 | #ifndef __XTOPOLOGY_H_ 20 | #define __XTOPOLOGY_H_ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | enum xemac_types 27 | { 28 | xemac_type_unknown = -1, xemac_type_xps_emaclite, xemac_type_xps_ll_temac, xemac_type_axi_ethernet, xemac_type_emacps 29 | }; 30 | 31 | struct xtopology_t 32 | { 33 | unsigned emac_baseaddr; 34 | enum xemac_types emac_type; 35 | unsigned intc_baseaddr; 36 | unsigned intc_emac_intr; /* valid only for xemac_type_xps_emaclite */ 37 | unsigned scugic_baseaddr; /* valid only for Zynq */ 38 | unsigned scugic_emac_intr; /* valid only for GEM */ 39 | }; 40 | 41 | #ifdef __cplusplus 42 | } /* extern "C" */ 43 | #endif 44 | 45 | #endif /* __XTOPOLOGY_H_ */ 46 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/MPS2_AN385/ether_lan9118/smsc9220_emac_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Arm Limited 3 | * SPDX-License-Identifier: Apache-2.0 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef SMSC9220_EMAC_CONFIG_H 19 | #define SMSC9220_EMAC_CONFIG_H 20 | 21 | #define SMSC9220_HWADDR_SIZE 6U 22 | #define SMSC9220_BUFF_ALIGNMENT 4U 23 | 24 | /* 25 | * Maximum Transfer Unit 26 | * The IEEE 802.3 specification limits the data portion of the 802.3 frame 27 | * to a minimum of 46 and a maximum of 1522 bytes, this is on L2 level. 28 | */ 29 | #define SMSC9220_ETH_MTU_SIZE 1500U 30 | #define SMSC9220_ETH_IF_NAME "smsc9220" 31 | #define SMSC9220_ETH_MAX_FRAME_SIZE 1522U 32 | 33 | /** \brief Defines for receiver thread */ 34 | #define FLAG_RX 1U 35 | #define LINK_STATUS_THREAD_PRIORITY ( osPriorityNormal ) 36 | #define LINK_STATUS_THREAD_STACKSIZE 512U 37 | #define LINK_STATUS_TASK_PERIOD_MS 200U 38 | #define PHY_STATE_LINK_DOWN false 39 | #define PHY_STATE_LINK_UP true 40 | #define CRC_LENGTH_BYTES 4U 41 | 42 | #endif /* SMSC9220_EMAC_CONFIG_H */ 43 | -------------------------------------------------------------------------------- /test/unit-test/FreeRTOS_TCP_Reception/FreeRTOS_TCP_Reception_stubs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | 29 | /* Include Unity header */ 30 | #include 31 | 32 | /* Include standard libraries */ 33 | #include 34 | #include 35 | #include 36 | #include "FreeRTOS.h" 37 | #include "task.h" 38 | #include "list.h" 39 | 40 | #include "FreeRTOS_IP.h" 41 | #include "FreeRTOS_IP_Private.h" 42 | -------------------------------------------------------------------------------- /test/unit-test/FreeRTOS_TCP_State_Handling_IPv6/TCP_State_Handling_IPv6_list_macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | #ifndef LIST_MACRO_H 29 | #define LIST_MACRO_H 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | BaseType_t prvTCPSocketCopy( FreeRTOS_Socket_t * pxNewSocket, 36 | FreeRTOS_Socket_t * pxSocket ); 37 | 38 | #endif /* ifndef LIST_MACRO_H */ 39 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/MPS3_AN552/Device/Include/system_SSE300MPS3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2020 Arm Limited 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * This file is derivative of CMSIS V5.6.0 system_ARMv81MML.h 19 | * Git SHA: b5f0603d6a584d1724d952fd8b0737458b90d62b 20 | */ 21 | 22 | /* This file is a copy of 23 | * https://gitlab.arm.com/iot/open-iot-sdk/arm-corstone-platform-bsp/-/blob/main/corstone300/Device/Include/system_SSE300MPS3.h 24 | */ 25 | 26 | #ifndef __SYSTEM_CORE_INIT_H__ 27 | #define __SYSTEM_CORE_INIT_H__ 28 | 29 | #include 30 | 31 | /* *INDENT-OFF* */ 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | /* *INDENT-ON* */ 36 | 37 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 38 | extern uint32_t PeripheralClock; /*!< Peripheral Clock Frequency */ 39 | 40 | /** 41 | * \brief Initializes the system 42 | */ 43 | extern void SystemInit( void ); 44 | 45 | /** 46 | * \brief Restores system core clock 47 | */ 48 | extern void SystemCoreClockUpdate( void ); 49 | 50 | /* *INDENT-OFF* */ 51 | #ifdef __cplusplus 52 | } /* extern "C" */ 53 | #endif 54 | /* *INDENT-ON* */ 55 | 56 | #endif /* __SYSTEM_CORE_INIT_H__ */ 57 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/STM32/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT ( (FREERTOS_PLUS_TCP_NETWORK_IF STREQUAL "STM32") ) ) 2 | return() 3 | endif() 4 | 5 | #------------------------------------------------------------------------------ 6 | add_library( freertos_plus_tcp_network_if STATIC ) 7 | 8 | set( FREERTOS_PLUS_TCP_STM32_IF_DRIVER "None" CACHE STRING "The driver sources to use with STM32 Network interface" ) 9 | 10 | target_sources( freertos_plus_tcp_network_if 11 | PRIVATE 12 | NetworkInterface.c 13 | $<$: 14 | Drivers/F4/stm32f4xx_hal_eth.c> 15 | $<$: 16 | Drivers/F7/stm32f7xx_hal_eth.c> 17 | $<$: 18 | Drivers/H5/stm32h5xx_hal_eth_ex.c> 19 | $<$: 20 | Drivers/H5/stm32h5xx_hal_eth.c> 21 | $<$: 22 | Drivers/H7/stm32h7xx_hal_eth_ex.c> 23 | $<$: 24 | Drivers/H7/stm32h7xx_hal_eth.c> 25 | ) 26 | 27 | target_include_directories( freertos_plus_tcp_network_if 28 | PUBLIC 29 | $<$: 30 | Drivers/F4> 31 | $<$: 32 | Drivers/F7> 33 | $<$: 34 | Drivers/H5> 35 | $<$: 36 | Drivers/H7> 37 | ) 38 | 39 | target_link_libraries( freertos_plus_tcp_network_if 40 | PUBLIC 41 | freertos_plus_tcp_port 42 | freertos_plus_tcp_network_if_common 43 | PRIVATE 44 | freertos_kernel 45 | freertos_plus_tcp 46 | ) 47 | -------------------------------------------------------------------------------- /source/portable/Compiler/MPLAB_XC/pack_struct_start.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | /***************************************************************************** 29 | * 30 | * See the following URL for an explanation of this file: 31 | * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting 32 | * 33 | *****************************************************************************/ 34 | -------------------------------------------------------------------------------- /source/portable/Compiler/IAR/pack_struct_end.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | /***************************************************************************** 29 | * 30 | * See the following URL for an explanation of this file: 31 | * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting 32 | * 33 | *****************************************************************************/ 34 | 35 | ; 36 | -------------------------------------------------------------------------------- /test/cbmc/proofs/SkipNameField/SkipNameField_harness.c: -------------------------------------------------------------------------------- 1 | /* Standard includes. */ 2 | #include 3 | 4 | /* FreeRTOS includes. */ 5 | #include "FreeRTOS.h" 6 | #include "task.h" 7 | #include "queue.h" 8 | #include "list.h" 9 | #include "semphr.h" 10 | 11 | /* FreeRTOS+TCP includes. */ 12 | #include "FreeRTOS_IP.h" 13 | #include "FreeRTOS_Sockets.h" 14 | #include "FreeRTOS_IP_Private.h" 15 | #include "FreeRTOS_UDP_IP.h" 16 | #include "FreeRTOS_DNS.h" 17 | #include "NetworkBufferManagement.h" 18 | #include "NetworkInterface.h" 19 | #include "IPTraceMacroDefaults.h" 20 | #include "FreeRTOS_DNS_Parser.h" 21 | 22 | #include "cbmc.h" 23 | 24 | /**************************************************************** 25 | * Signature of function under test 26 | ****************************************************************/ 27 | 28 | size_t DNS_SkipNameField( const uint8_t * pucByte, 29 | size_t uxLength ); 30 | 31 | /**************************************************************** 32 | * Proof of DNS_SkipNameField function contract 33 | ****************************************************************/ 34 | 35 | void harness() 36 | { 37 | __CPROVER_assert( NETWORK_BUFFER_SIZE < CBMC_MAX_OBJECT_SIZE, 38 | "NETWORK_BUFFER_SIZE < CBMC_MAX_OBJECT_SIZE" ); 39 | 40 | size_t uxLength; 41 | uint8_t * pucByte = malloc( uxLength ); 42 | 43 | /* Preconditions */ 44 | 45 | __CPROVER_assume( uxLength < CBMC_MAX_OBJECT_SIZE ); 46 | __CPROVER_assume( uxLength <= NETWORK_BUFFER_SIZE ); 47 | __CPROVER_assume( pucByte != NULL ); 48 | 49 | size_t index = DNS_SkipNameField( pucByte, uxLength ); 50 | 51 | /* Postconditions */ 52 | 53 | __CPROVER_assert( index <= uxLength, 54 | "DNS_SkipNameField: index <= uxLength" ); 55 | } 56 | -------------------------------------------------------------------------------- /source/portable/Compiler/CCS/pack_struct_end.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file: pack_struct_end.h 3 | * @author: jscott 4 | * @date: Feb 1, 2022 5 | * @copyright: Hotstart 2022 Hotstart Thermal Management. All Rights Reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * @brief: TI's Code Generation Tools do not add a trailing directive for packing structures 25 | * 26 | * Contains a semicolon to end the wrapped structure, 27 | * and resets warnings that were supressed in pack_struct_start.h. 28 | * It also pops the previously pushed alignment of 1 byte of the stack. 29 | */ 30 | ; 31 | #pragma pack(pop) 32 | #pragma diag_pop 33 | -------------------------------------------------------------------------------- /source/portable/NetworkInterface/Zynq/x_topology.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2013 Xilinx, Inc. All rights reserved. 3 | * 4 | * Xilinx, Inc. 5 | * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 6 | * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS 7 | * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 8 | * STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION 9 | * IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 10 | * FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION. 11 | * XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 12 | * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 13 | * ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 14 | * FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 15 | * AND FITNESS FOR A PARTICULAR PURPOSE. 16 | * 17 | */ 18 | 19 | #ifndef __XTOPOLOGY_H_ 20 | #define __XTOPOLOGY_H_ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | enum xemac_types 27 | { 28 | xemac_type_unknown = -1, xemac_type_xps_emaclite, xemac_type_xps_ll_temac, xemac_type_axi_ethernet, xemac_type_emacps 29 | }; 30 | 31 | struct xtopology_t 32 | { 33 | unsigned emac_baseaddr; 34 | enum xemac_types emac_type; 35 | unsigned intc_baseaddr; 36 | unsigned intc_emac_intr; /* valid only for xemac_type_xps_emaclite */ 37 | unsigned scugic_baseaddr; /* valid only for Zynq */ 38 | unsigned scugic_emac_intr; /* valid only for GEM */ 39 | }; 40 | 41 | extern struct xtopology_t xXTopologies[ XPAR_XEMACPS_NUM_INSTANCES ]; 42 | 43 | #ifdef __cplusplus 44 | } /* extern "C" */ 45 | #endif 46 | 47 | #endif /* __XTOPOLOGY_H_ */ 48 | -------------------------------------------------------------------------------- /source/portable/Compiler/Tasking/pack_struct_end.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | /***************************************************************************** 29 | * 30 | * See the following URL for an explanation of this file: 31 | * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting 32 | * 33 | *****************************************************************************/ 34 | 35 | __packed__; 36 | -------------------------------------------------------------------------------- /source/portable/Compiler/Keil/pack_struct_end.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | /***************************************************************************** 29 | * 30 | * See the following URL for an explanation of this file: 31 | * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting 32 | * 33 | *****************************************************************************/ 34 | ; 35 | #pragma pack(pop) 36 | -------------------------------------------------------------------------------- /test/unit-test/ConfigFiles/pack_struct_end.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | /***************************************************************************** 29 | * 30 | * See the following URL for an explanation of this file: 31 | * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting 32 | * 33 | *****************************************************************************/ 34 | __attribute__( ( packed ) ); 35 | -------------------------------------------------------------------------------- /source/portable/Compiler/GCC/pack_struct_end.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | /***************************************************************************** 29 | * 30 | * See the following URL for an explanation of this file: 31 | * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting 32 | * 33 | *****************************************************************************/ 34 | __attribute__( ( packed ) ); 35 | -------------------------------------------------------------------------------- /source/portable/Compiler/MSVC/pack_struct_start.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | /***************************************************************************** 29 | * 30 | * See the following URL for an explanation of this file: 31 | * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting 32 | * 33 | *****************************************************************************/ 34 | 35 | #pragma pack( push, 1 ) 36 | -------------------------------------------------------------------------------- /test/Coverity/ConfigFiles/pack_struct_start.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | /***************************************************************************** 29 | * 30 | * See the following URL for an explanation of this file: 31 | * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting 32 | * 33 | *****************************************************************************/ 34 | 35 | /* Nothing to do here. */ 36 | -------------------------------------------------------------------------------- /test/unit-test/ConfigFiles/pack_struct_start.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | /***************************************************************************** 29 | * 30 | * See the following URL for an explanation of this file: 31 | * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting 32 | * 33 | *****************************************************************************/ 34 | 35 | /* Nothing to do here. */ 36 | -------------------------------------------------------------------------------- /source/portable/Compiler/CCS/pack_struct_start.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file: pack_struct_start.h 3 | * @author: jscott 4 | * @date: Feb 1, 2022 5 | * @copyright: Hotstart 2022 Hotstart Thermal Management. All Rights Reserved. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * @brief: The leading compiler directive to pack the following structure to 1 byte 25 | * 26 | * Also suppress an incorrect warning from the CCS compiler: 27 | * error #1916-D: definition at end of file not followed by a semicolon or a declarator 28 | * Pushes the struct alignment of packed. 29 | */ 30 | #pragma diag_push 31 | #pragma diag_suppress=1916 32 | #pragma pack(push, 1) 33 | -------------------------------------------------------------------------------- /source/portable/Compiler/GCC/pack_struct_start.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | /***************************************************************************** 29 | * 30 | * See the following URL for an explanation of this file: 31 | * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting 32 | * 33 | *****************************************************************************/ 34 | 35 | /* Nothing to do here. */ 36 | -------------------------------------------------------------------------------- /source/portable/Compiler/MSVC/pack_struct_end.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | /***************************************************************************** 29 | * 30 | * See the following URL for an explanation of this file: 31 | * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting 32 | * 33 | *****************************************************************************/ 34 | 35 | ; 36 | #pragma pack( pop ) 37 | -------------------------------------------------------------------------------- /source/portable/Compiler/Tasking/pack_struct_start.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS+TCP 3 | * Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * http://aws.amazon.com/freertos 25 | * http://www.FreeRTOS.org 26 | */ 27 | 28 | /***************************************************************************** 29 | * 30 | * See the following URL for an explanation of this file: 31 | * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting 32 | * 33 | *****************************************************************************/ 34 | 35 | /* Nothing to do here. */ 36 | -------------------------------------------------------------------------------- /test/cbmc/proofs/IP/SendEventToIPTask/Makefile.json: -------------------------------------------------------------------------------- 1 | # 2 | # FreeRTOS memory safety proofs with CBMC. 3 | # Copyright (C) 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person 6 | # obtaining a copy of this software and associated documentation 7 | # files (the "Software"), to deal in the Software without 8 | # restriction, including without limitation the rights to use, copy, 9 | # modify, merge, publish, distribute, sublicense, and/or sell copies 10 | # of the Software, and to permit persons to whom the Software is 11 | # furnished to do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | # SOFTWARE. 24 | # 25 | # http://aws.amazon.com/freertos 26 | # http://www.FreeRTOS.org 27 | # 28 | 29 | { 30 | "ENTRY": "SendEventToIPTask", 31 | "CBMCFLAGS": [ 32 | "--unwind 1", 33 | "--nondet-static" 34 | ], 35 | "OBJS": 36 | [ 37 | "$(ENTRY)_harness.goto", 38 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP.goto", 39 | "$(FREERTOS_PLUS_TCP)/source/FreeRTOS_IP_Timers.goto", 40 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_kernel_api.goto", 41 | "$(FREERTOS_PLUS_TCP)/test/cbmc/stubs/freertos_api.goto" 42 | ] 43 | } 44 | --------------------------------------------------------------------------------