From c1fc5fe3bedb8fe9e90d55405bce27cbd0960726 Mon Sep 17 00:00:00 2001 From: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:25:48 +0530 Subject: [PATCH 1/8] Update links in ReadMe (#1174) --- README.md | 2 +- .../portable/NetworkInterface/board_family/NetworkInterface.c | 2 +- source/portable/NetworkInterface/board_family/ReadMe.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 08ed92b14a..b422dd034e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ release.** The easiest way to use version 4.0.0 and later of FreeRTOS-Plus-TCP is to refer the Getting started Guide (found [here](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/GettingStarted.md)) Another way is to start with the pre-configured IPv4 Windows Simulator demo (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator)) or IPv6 Multi-endpoint Windows Simulator demo (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/IPv6_Multi_WinSim_demo)). That way you will have the correct FreeRTOS source files included, and the correct include paths configured. Once a demo application is building and executing you can remove the demo application files, and start to add in your own application source files. See the [FreeRTOS Kernel Quick Start Guide](https://www.freertos.org/FreeRTOS-quick-start-guide.html) for detailed instructions and other useful links. -Additionally, for FreeRTOS-Plus-TCP source code organization refer to the [Documentation](http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial.html), and [API Reference](https://freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_API_Functions.html). +Additionally, for FreeRTOS-Plus-TCP source code organization refer to the [Documentation](http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial.html), and [API Reference](https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/01-FreeRTOS-plus-TCP-APIs). ### Getting help If you have any questions or need assistance troubleshooting your FreeRTOS project, we have an active community that can help on the [FreeRTOS Community Support Forum](https://forums.freertos.org). Please also refer to [FAQ](http://www.freertos.org/FAQHelp.html) for frequently asked questions. diff --git a/source/portable/NetworkInterface/board_family/NetworkInterface.c b/source/portable/NetworkInterface/board_family/NetworkInterface.c index 0a6fa05054..dfb1979c61 100644 --- a/source/portable/NetworkInterface/board_family/NetworkInterface.c +++ b/source/portable/NetworkInterface/board_family/NetworkInterface.c @@ -31,7 +31,7 @@ * concrete implementations of the functions in this file. * * See the following URL for an explanation of this file and its functions: -* https://freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Ethernet_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/03-Embedded_Ethernet_Porting * *****************************************************************************/ diff --git a/source/portable/NetworkInterface/board_family/ReadMe.txt b/source/portable/NetworkInterface/board_family/ReadMe.txt index 782e429355..352670ab5c 100644 --- a/source/portable/NetworkInterface/board_family/ReadMe.txt +++ b/source/portable/NetworkInterface/board_family/ReadMe.txt @@ -2,4 +2,4 @@ Update NetworkInterface.c and include other files needed by FreeRTOS+TCP here. 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. Each network interface will have to provide concrete implementations of the functions in NetworkInterface.c. -See the following URL for an explanation of the file and its functions: https://freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Ethernet_Porting.html \ No newline at end of file +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 \ No newline at end of file From c81b3632cf2e26eccb729a699ea7683226d3f1be Mon Sep 17 00:00:00 2001 From: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:07:52 +0530 Subject: [PATCH 2/8] Add Network Down event in EMACHandler Task (#1173) * Add Network Down event in EMACHandler Task --- README.md | 6 +++--- readme.txt | 2 +- source/include/FreeRTOS_IP.h | 2 +- source/include/FreeRTOS_Sockets.h | 2 +- source/include/IPTraceMacroDefaults.h | 2 +- source/portable/BufferManagement/BufferAllocation_1.c | 2 +- source/portable/BufferManagement/BufferAllocation_2.c | 2 +- source/portable/Compiler/CompilerName/pack_struct_end.h | 2 +- source/portable/Compiler/CompilerName/pack_struct_start.h | 2 +- source/portable/Compiler/GCC/pack_struct_end.h | 2 +- source/portable/Compiler/GCC/pack_struct_start.h | 2 +- source/portable/Compiler/IAR/pack_struct_end.h | 2 +- source/portable/Compiler/IAR/pack_struct_start.h | 2 +- source/portable/Compiler/Keil/pack_struct_end.h | 2 +- source/portable/Compiler/Keil/pack_struct_start.h | 2 +- source/portable/Compiler/MPLAB_XC/pack_struct_end.h | 2 +- source/portable/Compiler/MPLAB_XC/pack_struct_start.h | 2 +- source/portable/Compiler/MSVC/pack_struct_end.h | 2 +- source/portable/Compiler/MSVC/pack_struct_start.h | 2 +- source/portable/Compiler/Renesas/pack_struct_end.h | 2 +- source/portable/Compiler/Renesas/pack_struct_start.h | 2 +- source/portable/Compiler/Tasking/pack_struct_end.h | 2 +- source/portable/Compiler/Tasking/pack_struct_start.h | 2 +- source/portable/NetworkInterface/M487/NetworkInterface.c | 2 +- .../portable/NetworkInterface/STM32Hxx/NetworkInterface.c | 6 ++++++ source/portable/NetworkInterface/Zynq/NetworkInterface.c | 2 +- .../NetworkInterface/pic32mzef/BufferAllocation_2.c | 2 +- .../NetworkInterface/xilinx_ultrascale/NetworkInterface.c | 2 +- test/Coverity/ConfigFiles/FreeRTOSIPConfig.h | 2 +- test/Coverity/ConfigFiles/pack_struct_end.h | 2 +- test/Coverity/ConfigFiles/pack_struct_start.h | 2 +- test/build-combination/AllDisable/FreeRTOSIPConfig.h | 2 +- test/build-combination/AllEnable/FreeRTOSIPConfig.h | 2 +- test/build-combination/Enable_IPv4/FreeRTOSIPConfig.h | 2 +- test/build-combination/Enable_IPv4_IPv6/FreeRTOSIPConfig.h | 2 +- test/build-combination/Enable_IPv4_TCP/FreeRTOSIPConfig.h | 2 +- test/build-combination/Enable_IPv6/FreeRTOSIPConfig.h | 2 +- test/build-combination/Enable_IPv6_TCP/FreeRTOSIPConfig.h | 2 +- .../Header_Self_Contain/FreeRTOSIPConfig.h | 2 +- test/cbmc/patches/FreeRTOSIPConfig.h | 2 +- test/cbmc/stubs/freertos_api.c | 5 ++--- test/unit-test/ConfigFiles/FreeRTOSIPConfig.h | 2 +- test/unit-test/ConfigFiles/pack_struct_end.h | 2 +- test/unit-test/ConfigFiles/pack_struct_start.h | 2 +- .../FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_DHCPv6/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_DNS/FreeRTOSIPConfig.h | 2 +- .../FreeRTOS_DNS_ConfigNoCallback/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_DNS_Parser/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_IP_DiffConfig/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_IP_DiffConfig1/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_IP_DiffConfig2/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_IP_DiffConfig3/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_IP_Utils/FreeRTOSIPConfig.h | 2 +- .../FreeRTOS_IP_Utils_DiffConfig/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_IPv4_DiffConfig/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_IPv4_DiffConfig1/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_IPv6/FreeRTOSIPConfig.h | 2 +- .../FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_IPv6_Utils/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h | 2 +- .../FreeRTOSIPConfig.h | 2 +- .../FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h | 2 +- .../FreeRTOS_Sockets_DiffConfig/FreeRTOSIPConfig.h | 2 +- .../FreeRTOS_Sockets_DiffConfig1/FreeRTOSIPConfig.h | 2 +- .../unit-test/FreeRTOS_TCP_IP_DiffConfig/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_Tiny_TCP/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOSIPConfig.h | 2 +- test/unit-test/FreeRTOS_UDP_IPv6/FreeRTOSIPConfig.h | 2 +- 69 files changed, 77 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index b422dd034e..e329ca7468 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,12 @@ release.** ## Getting started The easiest way to use version 4.0.0 and later of FreeRTOS-Plus-TCP is to refer the Getting started Guide (found [here](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/GettingStarted.md)) -Another way is to start with the pre-configured IPv4 Windows Simulator demo (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator)) or IPv6 Multi-endpoint Windows Simulator demo (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/IPv6_Multi_WinSim_demo)). That way you will have the correct FreeRTOS source files included, and the correct include paths configured. Once a demo application is building and executing you can remove the demo application files, and start to add in your own application source files. See the [FreeRTOS Kernel Quick Start Guide](https://www.freertos.org/FreeRTOS-quick-start-guide.html) for detailed instructions and other useful links. +Another way is to start with the pre-configured IPv4 Windows Simulator demo (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator)) or IPv6 Multi-endpoint Windows Simulator demo (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/IPv6_Multi_WinSim_demo)). That way you will have the correct FreeRTOS source files included, and the correct include paths configured. Once a demo application is building and executing you can remove the demo application files, and start to add in your own application source files. See the [FreeRTOS Kernel Quick Start Guide](https://www.freertos.org/Documentation/01-FreeRTOS-quick-start/01-Beginners-guide/02-Quick-start-guide) for detailed instructions and other useful links. Additionally, for FreeRTOS-Plus-TCP source code organization refer to the [Documentation](http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial.html), and [API Reference](https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/01-FreeRTOS-plus-TCP-APIs). ### Getting help -If you have any questions or need assistance troubleshooting your FreeRTOS project, we have an active community that can help on the [FreeRTOS Community Support Forum](https://forums.freertos.org). Please also refer to [FAQ](http://www.freertos.org/FAQHelp.html) for frequently asked questions. +If you have any questions or need assistance troubleshooting your FreeRTOS project, we have an active community that can help on the [FreeRTOS Community Support Forum](https://forums.freertos.org). Please also refer to [FAQ](https://www.freertos.org/Why-FreeRTOS/FAQs) for frequently asked questions. Also see the [Submitting a bugs/feature request](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/.github/CONTRIBUTING.md#submitting-a-bugsfeature-request) section of CONTRIBUTING.md for more details. @@ -91,7 +91,7 @@ git submodule update --checkout --init --recursive tools/CMock test/FreeRTOS-Ker ``` ## Porting -The porting guide is available on [this page](http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_Porting.html). +The porting guide is available on [this page](https://www.freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/01-FreeRTOS_TCP_Porting). ## Repository structure This repository contains the FreeRTOS-Plus-TCP repository and a number of supplementary libraries for testing/PR Checks. diff --git a/readme.txt b/readme.txt index 65e5e2b19d..62f2df8465 100644 --- a/readme.txt +++ b/readme.txt @@ -7,7 +7,7 @@ A description of the source code organisation is available on: http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial.html The porting guide is available on: -http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_Porting.html +https://www.freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/01-FreeRTOS_TCP_Porting License information is available on: http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_Plus_TCP_License.html diff --git a/source/include/FreeRTOS_IP.h b/source/include/FreeRTOS_IP.h index 8b422576af..8e7f5ea94c 100644 --- a/source/include/FreeRTOS_IP.h +++ b/source/include/FreeRTOS_IP.h @@ -307,7 +307,7 @@ uint32_t FreeRTOS_round_down( uint32_t a, /* * FULL, UP-TO-DATE AND MAINTAINED REFERENCE DOCUMENTATION FOR ALL THESE * FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_API_Functions.html + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/01-FreeRTOS-plus-TCP-APIs */ /* FreeRTOS_IPInit_Multi() replaces the earlier FreeRTOS_IPInit(). It assumes diff --git a/source/include/FreeRTOS_Sockets.h b/source/include/FreeRTOS_Sockets.h index 0a93660a8f..4045e51bcf 100644 --- a/source/include/FreeRTOS_Sockets.h +++ b/source/include/FreeRTOS_Sockets.h @@ -199,7 +199,7 @@ /** * FULL, UP-TO-DATE AND MAINTAINED REFERENCE DOCUMENTATION FOR ALL THESE * FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/FreeRTOS_TCP_API_Functions.html + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/01-FreeRTOS-plus-TCP-APIs */ /* Common Socket Attributes. */ diff --git a/source/include/IPTraceMacroDefaults.h b/source/include/IPTraceMacroDefaults.h index 3c3872f15f..802525d77a 100644 --- a/source/include/IPTraceMacroDefaults.h +++ b/source/include/IPTraceMacroDefaults.h @@ -29,7 +29,7 @@ * @file IPTraceMacroDefaults.h * @brief This file provides default (empty) implementations for any IP trace * macros that are not defined by the user. See - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Trace.html + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/08-Trace-macros */ #ifndef IP_TRACE_MACRO_DEFAULTS_H diff --git a/source/portable/BufferManagement/BufferAllocation_1.c b/source/portable/BufferManagement/BufferAllocation_1.c index 2d564d0085..55ac667ecd 100644 --- a/source/portable/BufferManagement/BufferAllocation_1.c +++ b/source/portable/BufferManagement/BufferAllocation_1.c @@ -29,7 +29,7 @@ * * See the following web page for essential buffer allocation scheme usage and * configuration details: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Ethernet_Buffer_Management.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/05-Buffer-management * ******************************************************************************/ diff --git a/source/portable/BufferManagement/BufferAllocation_2.c b/source/portable/BufferManagement/BufferAllocation_2.c index 62169043c1..b67d1d4249 100644 --- a/source/portable/BufferManagement/BufferAllocation_2.c +++ b/source/portable/BufferManagement/BufferAllocation_2.c @@ -31,7 +31,7 @@ * * See the following web page for essential buffer allocation scheme usage and * configuration details: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Ethernet_Buffer_Management.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/05-Buffer-management * ******************************************************************************/ diff --git a/source/portable/Compiler/CompilerName/pack_struct_end.h b/source/portable/Compiler/CompilerName/pack_struct_end.h index 86252fc024..dc3ba6bb96 100644 --- a/source/portable/Compiler/CompilerName/pack_struct_end.h +++ b/source/portable/Compiler/CompilerName/pack_struct_end.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ ; /* FIX ME. Update for the compiler specifier needed at end of a struct declaration to pack the struct. */ diff --git a/source/portable/Compiler/CompilerName/pack_struct_start.h b/source/portable/Compiler/CompilerName/pack_struct_start.h index 1f519674f8..7057df4b9f 100644 --- a/source/portable/Compiler/CompilerName/pack_struct_start.h +++ b/source/portable/Compiler/CompilerName/pack_struct_start.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ /* FIX ME. Update for the compiler specifier needed at the start of a struct declaration to pack the struct. */ diff --git a/source/portable/Compiler/GCC/pack_struct_end.h b/source/portable/Compiler/GCC/pack_struct_end.h index 4f4b2f904b..260eddc22e 100644 --- a/source/portable/Compiler/GCC/pack_struct_end.h +++ b/source/portable/Compiler/GCC/pack_struct_end.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ __attribute__( ( packed ) ); diff --git a/source/portable/Compiler/GCC/pack_struct_start.h b/source/portable/Compiler/GCC/pack_struct_start.h index 5da2689d39..62fb479075 100644 --- a/source/portable/Compiler/GCC/pack_struct_start.h +++ b/source/portable/Compiler/GCC/pack_struct_start.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/source/portable/Compiler/IAR/pack_struct_end.h b/source/portable/Compiler/IAR/pack_struct_end.h index 0f72081c4d..0dc5384759 100644 --- a/source/portable/Compiler/IAR/pack_struct_end.h +++ b/source/portable/Compiler/IAR/pack_struct_end.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/source/portable/Compiler/IAR/pack_struct_start.h b/source/portable/Compiler/IAR/pack_struct_start.h index 9cd5a3274d..e2c75aa1e8 100644 --- a/source/portable/Compiler/IAR/pack_struct_start.h +++ b/source/portable/Compiler/IAR/pack_struct_start.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/source/portable/Compiler/Keil/pack_struct_end.h b/source/portable/Compiler/Keil/pack_struct_end.h index 286b99a645..19f2a83e40 100644 --- a/source/portable/Compiler/Keil/pack_struct_end.h +++ b/source/portable/Compiler/Keil/pack_struct_end.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ ; diff --git a/source/portable/Compiler/Keil/pack_struct_start.h b/source/portable/Compiler/Keil/pack_struct_start.h index ea31babf92..f2b041aa33 100644 --- a/source/portable/Compiler/Keil/pack_struct_start.h +++ b/source/portable/Compiler/Keil/pack_struct_start.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/source/portable/Compiler/MPLAB_XC/pack_struct_end.h b/source/portable/Compiler/MPLAB_XC/pack_struct_end.h index 38472525c5..99ede1f678 100644 --- a/source/portable/Compiler/MPLAB_XC/pack_struct_end.h +++ b/source/portable/Compiler/MPLAB_XC/pack_struct_end.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/source/portable/Compiler/MPLAB_XC/pack_struct_start.h b/source/portable/Compiler/MPLAB_XC/pack_struct_start.h index fa61000c9d..3e780eb632 100644 --- a/source/portable/Compiler/MPLAB_XC/pack_struct_start.h +++ b/source/portable/Compiler/MPLAB_XC/pack_struct_start.h @@ -28,6 +28,6 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/source/portable/Compiler/MSVC/pack_struct_end.h b/source/portable/Compiler/MSVC/pack_struct_end.h index 6aed02ac6e..c273cb9d1e 100644 --- a/source/portable/Compiler/MSVC/pack_struct_end.h +++ b/source/portable/Compiler/MSVC/pack_struct_end.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/source/portable/Compiler/MSVC/pack_struct_start.h b/source/portable/Compiler/MSVC/pack_struct_start.h index 824902bdd9..75014b7ccb 100644 --- a/source/portable/Compiler/MSVC/pack_struct_start.h +++ b/source/portable/Compiler/MSVC/pack_struct_start.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/source/portable/Compiler/Renesas/pack_struct_end.h b/source/portable/Compiler/Renesas/pack_struct_end.h index f2b99123d0..3a298cc2f1 100644 --- a/source/portable/Compiler/Renesas/pack_struct_end.h +++ b/source/portable/Compiler/Renesas/pack_struct_end.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/source/portable/Compiler/Renesas/pack_struct_start.h b/source/portable/Compiler/Renesas/pack_struct_start.h index 6d5325cbe6..d23a822bd6 100644 --- a/source/portable/Compiler/Renesas/pack_struct_start.h +++ b/source/portable/Compiler/Renesas/pack_struct_start.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/source/portable/Compiler/Tasking/pack_struct_end.h b/source/portable/Compiler/Tasking/pack_struct_end.h index 96e3ea9468..78f9032926 100644 --- a/source/portable/Compiler/Tasking/pack_struct_end.h +++ b/source/portable/Compiler/Tasking/pack_struct_end.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/source/portable/Compiler/Tasking/pack_struct_start.h b/source/portable/Compiler/Tasking/pack_struct_start.h index 5da2689d39..62fb479075 100644 --- a/source/portable/Compiler/Tasking/pack_struct_start.h +++ b/source/portable/Compiler/Tasking/pack_struct_start.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/source/portable/NetworkInterface/M487/NetworkInterface.c b/source/portable/NetworkInterface/M487/NetworkInterface.c index fdced336a7..32b3208031 100644 --- a/source/portable/NetworkInterface/M487/NetworkInterface.c +++ b/source/portable/NetworkInterface/M487/NetworkInterface.c @@ -73,7 +73,7 @@ static void prvEMACHandlerTask( void * pvParameters ); static void prvPhyTmrCallback( TimerHandle_t xTimer ); /* The size of each buffer when BufferAllocation_1 is used: - * http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Ethernet_Buffer_Management.html */ + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/05-Buffer-management */ #define niBUFFER_1_PACKET_SIZE 1536 #ifdef __ICCARM__ diff --git a/source/portable/NetworkInterface/STM32Hxx/NetworkInterface.c b/source/portable/NetworkInterface/STM32Hxx/NetworkInterface.c index 4456d517e4..e42e58fddc 100644 --- a/source/portable/NetworkInterface/STM32Hxx/NetworkInterface.c +++ b/source/portable/NetworkInterface/STM32Hxx/NetworkInterface.c @@ -1174,6 +1174,12 @@ static void prvEMACHandlerTask( void * pvParameters ) */ if( xSTM32H_GetPhyLinkStatus( pxMyInterface ) == pdFALSE ) { + #if ( ipconfigSUPPORT_NETWORK_DOWN_EVENT != 0 ) + { + FreeRTOS_NetworkDown( pxMyInterface ); + } + #endif /* ( ipconfigSUPPORT_NETWORK_DOWN_EVENT != 0 ) */ + /* Stop the DMA transfer. */ HAL_ETH_Stop_IT( &( xEthHandle ) ); /* Clear the Transmit buffers. */ diff --git a/source/portable/NetworkInterface/Zynq/NetworkInterface.c b/source/portable/NetworkInterface/Zynq/NetworkInterface.c index aa0cd363f7..21ad820ceb 100644 --- a/source/portable/NetworkInterface/Zynq/NetworkInterface.c +++ b/source/portable/NetworkInterface/Zynq/NetworkInterface.c @@ -64,7 +64,7 @@ #define niBMSR_LINK_STATUS 0x0004uL /* The size of each buffer when BufferAllocation_1 is used: - * http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Ethernet_Buffer_Management.html */ + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/05-Buffer-management */ #define niBUFFER_1_PACKET_SIZE 1536 /* Naming and numbering of PHY registers. */ diff --git a/source/portable/NetworkInterface/pic32mzef/BufferAllocation_2.c b/source/portable/NetworkInterface/pic32mzef/BufferAllocation_2.c index c177f6ff6f..622a9b84fa 100644 --- a/source/portable/NetworkInterface/pic32mzef/BufferAllocation_2.c +++ b/source/portable/NetworkInterface/pic32mzef/BufferAllocation_2.c @@ -29,7 +29,7 @@ * * See the following web page for essential buffer allocation scheme usage and * configuration details: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Ethernet_Buffer_Management.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/05-Buffer-management * ******************************************************************************/ diff --git a/source/portable/NetworkInterface/xilinx_ultrascale/NetworkInterface.c b/source/portable/NetworkInterface/xilinx_ultrascale/NetworkInterface.c index 56dba016ae..6928131e66 100644 --- a/source/portable/NetworkInterface/xilinx_ultrascale/NetworkInterface.c +++ b/source/portable/NetworkInterface/xilinx_ultrascale/NetworkInterface.c @@ -68,7 +68,7 @@ #endif /* The size of each buffer when BufferAllocation_1 is used: - * http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Ethernet_Buffer_Management.html */ + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/05-Buffer-management */ #if ( USE_JUMBO_FRAMES == 1 ) #define niBUFFER_1_PACKET_SIZE 10240 #else diff --git a/test/Coverity/ConfigFiles/FreeRTOSIPConfig.h b/test/Coverity/ConfigFiles/FreeRTOSIPConfig.h index 6d3da4df7a..b37503cd79 100644 --- a/test/Coverity/ConfigFiles/FreeRTOSIPConfig.h +++ b/test/Coverity/ConfigFiles/FreeRTOSIPConfig.h @@ -103,7 +103,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/Coverity/ConfigFiles/pack_struct_end.h b/test/Coverity/ConfigFiles/pack_struct_end.h index dc615181a2..6642548c3b 100644 --- a/test/Coverity/ConfigFiles/pack_struct_end.h +++ b/test/Coverity/ConfigFiles/pack_struct_end.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/test/Coverity/ConfigFiles/pack_struct_start.h b/test/Coverity/ConfigFiles/pack_struct_start.h index 5da2689d39..62fb479075 100644 --- a/test/Coverity/ConfigFiles/pack_struct_start.h +++ b/test/Coverity/ConfigFiles/pack_struct_start.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/test/build-combination/AllDisable/FreeRTOSIPConfig.h b/test/build-combination/AllDisable/FreeRTOSIPConfig.h index b84c2670c6..ba46611a14 100644 --- a/test/build-combination/AllDisable/FreeRTOSIPConfig.h +++ b/test/build-combination/AllDisable/FreeRTOSIPConfig.h @@ -99,7 +99,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 0 diff --git a/test/build-combination/AllEnable/FreeRTOSIPConfig.h b/test/build-combination/AllEnable/FreeRTOSIPConfig.h index bdafa06272..44c7e8df91 100644 --- a/test/build-combination/AllEnable/FreeRTOSIPConfig.h +++ b/test/build-combination/AllEnable/FreeRTOSIPConfig.h @@ -130,7 +130,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/build-combination/Enable_IPv4/FreeRTOSIPConfig.h b/test/build-combination/Enable_IPv4/FreeRTOSIPConfig.h index 1af6f8bf92..b610106031 100644 --- a/test/build-combination/Enable_IPv4/FreeRTOSIPConfig.h +++ b/test/build-combination/Enable_IPv4/FreeRTOSIPConfig.h @@ -133,7 +133,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/build-combination/Enable_IPv4_IPv6/FreeRTOSIPConfig.h b/test/build-combination/Enable_IPv4_IPv6/FreeRTOSIPConfig.h index 758c68f907..3c7b30e67b 100644 --- a/test/build-combination/Enable_IPv4_IPv6/FreeRTOSIPConfig.h +++ b/test/build-combination/Enable_IPv4_IPv6/FreeRTOSIPConfig.h @@ -133,7 +133,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/build-combination/Enable_IPv4_TCP/FreeRTOSIPConfig.h b/test/build-combination/Enable_IPv4_TCP/FreeRTOSIPConfig.h index 9689f54a66..eea9281f20 100644 --- a/test/build-combination/Enable_IPv4_TCP/FreeRTOSIPConfig.h +++ b/test/build-combination/Enable_IPv4_TCP/FreeRTOSIPConfig.h @@ -133,7 +133,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/build-combination/Enable_IPv6/FreeRTOSIPConfig.h b/test/build-combination/Enable_IPv6/FreeRTOSIPConfig.h index 5be4d7c3f4..0bf7c1def1 100644 --- a/test/build-combination/Enable_IPv6/FreeRTOSIPConfig.h +++ b/test/build-combination/Enable_IPv6/FreeRTOSIPConfig.h @@ -133,7 +133,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/build-combination/Enable_IPv6_TCP/FreeRTOSIPConfig.h b/test/build-combination/Enable_IPv6_TCP/FreeRTOSIPConfig.h index 2a4b581d9e..17e679550c 100644 --- a/test/build-combination/Enable_IPv6_TCP/FreeRTOSIPConfig.h +++ b/test/build-combination/Enable_IPv6_TCP/FreeRTOSIPConfig.h @@ -133,7 +133,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/build-combination/Header_Self_Contain/FreeRTOSIPConfig.h b/test/build-combination/Header_Self_Contain/FreeRTOSIPConfig.h index 0516653469..ce7022b2ec 100644 --- a/test/build-combination/Header_Self_Contain/FreeRTOSIPConfig.h +++ b/test/build-combination/Header_Self_Contain/FreeRTOSIPConfig.h @@ -129,7 +129,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/cbmc/patches/FreeRTOSIPConfig.h b/test/cbmc/patches/FreeRTOSIPConfig.h index f94bfb655a..55dfc29292 100644 --- a/test/cbmc/patches/FreeRTOSIPConfig.h +++ b/test/cbmc/patches/FreeRTOSIPConfig.h @@ -96,7 +96,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/cbmc/stubs/freertos_api.c b/test/cbmc/stubs/freertos_api.c index db349a25ad..7534c34b8a 100644 --- a/test/cbmc/stubs/freertos_api.c +++ b/test/cbmc/stubs/freertos_api.c @@ -200,7 +200,7 @@ int32_t FreeRTOS_sendto( Socket_t xSocket, /**************************************************************** * Abstract FreeRTOS_GetUDPPayloadBuffer -* https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/FreeRTOS_GetUDPPayloadBuffer.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/34-FreeRTOS_GetUDPPayloadBuffer * * We stub out this function to do nothing but allocate a buffer of * unconstrained size containing unconstrained data and return a @@ -329,7 +329,7 @@ void vReleaseNetworkBufferAndDescriptor( NetworkBufferDescriptor_t * const pxNet /**************************************************************** * Abstract FreeRTOS_GetAddressConfiguration -* https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/API/FreeRTOS_GetAddressConfiguration.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/32-FreeRTOS_GetAddressConfiguration ****************************************************************/ void FreeRTOS_GetAddressConfiguration( uint32_t * pulIPAddress, @@ -389,7 +389,6 @@ const char * pcApplicationHostnameHook( void ) /**************************************************************** * Abstract xNetworkInterfaceOutput -* https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Ethernet_Porting.html#xNetworkInterfaceOutput ****************************************************************/ BaseType_t xNetworkInterfaceOutput( NetworkBufferDescriptor_t * const pxNetworkBuffer, BaseType_t bReleaseAfterSend ) diff --git a/test/unit-test/ConfigFiles/FreeRTOSIPConfig.h b/test/unit-test/ConfigFiles/FreeRTOSIPConfig.h index 2dc487b48c..f10ea2e30a 100644 --- a/test/unit-test/ConfigFiles/FreeRTOSIPConfig.h +++ b/test/unit-test/ConfigFiles/FreeRTOSIPConfig.h @@ -109,7 +109,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/ConfigFiles/pack_struct_end.h b/test/unit-test/ConfigFiles/pack_struct_end.h index 4f4b2f904b..260eddc22e 100644 --- a/test/unit-test/ConfigFiles/pack_struct_end.h +++ b/test/unit-test/ConfigFiles/pack_struct_end.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ __attribute__( ( packed ) ); diff --git a/test/unit-test/ConfigFiles/pack_struct_start.h b/test/unit-test/ConfigFiles/pack_struct_start.h index 5da2689d39..62fb479075 100644 --- a/test/unit-test/ConfigFiles/pack_struct_start.h +++ b/test/unit-test/ConfigFiles/pack_struct_start.h @@ -28,7 +28,7 @@ /***************************************************************************** * * See the following URL for an explanation of this file: -* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Compiler_Porting.html +* https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/10-Porting/02-Embedded_Compiler_Porting * *****************************************************************************/ diff --git a/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOSIPConfig.h index e8f5d6755d..8c2a65c70d 100644 --- a/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOSIPConfig.h @@ -103,7 +103,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_DHCPv6/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_DHCPv6/FreeRTOSIPConfig.h index d7e6fab6a8..8dcb9d8659 100644 --- a/test/unit-test/FreeRTOS_DHCPv6/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_DHCPv6/FreeRTOSIPConfig.h @@ -107,7 +107,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_DNS/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_DNS/FreeRTOSIPConfig.h index 6596cb1e0e..52819c5ae8 100644 --- a/test/unit-test/FreeRTOS_DNS/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_DNS/FreeRTOSIPConfig.h @@ -108,7 +108,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_DNS_ConfigNoCallback/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_DNS_ConfigNoCallback/FreeRTOSIPConfig.h index d80e178ffa..4f9154c359 100644 --- a/test/unit-test/FreeRTOS_DNS_ConfigNoCallback/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_DNS_ConfigNoCallback/FreeRTOSIPConfig.h @@ -108,7 +108,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_DNS_Parser/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_DNS_Parser/FreeRTOSIPConfig.h index 18b5be367c..5b740c2828 100644 --- a/test/unit-test/FreeRTOS_DNS_Parser/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_DNS_Parser/FreeRTOSIPConfig.h @@ -107,7 +107,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_IP_DiffConfig/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IP_DiffConfig/FreeRTOSIPConfig.h index 942f0f7c49..f9da2bf5a7 100644 --- a/test/unit-test/FreeRTOS_IP_DiffConfig/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IP_DiffConfig/FreeRTOSIPConfig.h @@ -106,7 +106,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_IP_DiffConfig1/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IP_DiffConfig1/FreeRTOSIPConfig.h index 90642ae7f3..4aa2dee504 100644 --- a/test/unit-test/FreeRTOS_IP_DiffConfig1/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IP_DiffConfig1/FreeRTOSIPConfig.h @@ -106,7 +106,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_IP_DiffConfig2/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IP_DiffConfig2/FreeRTOSIPConfig.h index 73c8ac7478..45964ca96a 100644 --- a/test/unit-test/FreeRTOS_IP_DiffConfig2/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IP_DiffConfig2/FreeRTOSIPConfig.h @@ -106,7 +106,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_IP_DiffConfig3/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IP_DiffConfig3/FreeRTOSIPConfig.h index 97898f2f11..a95e7d9927 100644 --- a/test/unit-test/FreeRTOS_IP_DiffConfig3/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IP_DiffConfig3/FreeRTOSIPConfig.h @@ -108,7 +108,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_IP_Utils/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IP_Utils/FreeRTOSIPConfig.h index 0370baf987..3662a23487 100644 --- a/test/unit-test/FreeRTOS_IP_Utils/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IP_Utils/FreeRTOSIPConfig.h @@ -108,7 +108,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_IP_Utils_DiffConfig/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IP_Utils_DiffConfig/FreeRTOSIPConfig.h index 8fba7f3905..bb6766856f 100644 --- a/test/unit-test/FreeRTOS_IP_Utils_DiffConfig/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IP_Utils_DiffConfig/FreeRTOSIPConfig.h @@ -106,7 +106,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_IPv4_DiffConfig/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IPv4_DiffConfig/FreeRTOSIPConfig.h index 2e5e2f7b40..6eb551d56d 100644 --- a/test/unit-test/FreeRTOS_IPv4_DiffConfig/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IPv4_DiffConfig/FreeRTOSIPConfig.h @@ -106,7 +106,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_IPv4_DiffConfig1/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IPv4_DiffConfig1/FreeRTOSIPConfig.h index a81bd93862..2ad3ba3c2e 100644 --- a/test/unit-test/FreeRTOS_IPv4_DiffConfig1/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IPv4_DiffConfig1/FreeRTOSIPConfig.h @@ -106,7 +106,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_IPv6/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IPv6/FreeRTOSIPConfig.h index 31ca857ddf..6b4f63f1fc 100644 --- a/test/unit-test/FreeRTOS_IPv6/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IPv6/FreeRTOSIPConfig.h @@ -106,7 +106,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_IPv6_ConfigDriverCheckChecksum/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IPv6_ConfigDriverCheckChecksum/FreeRTOSIPConfig.h index fa3d350d06..61009fb7e0 100644 --- a/test/unit-test/FreeRTOS_IPv6_ConfigDriverCheckChecksum/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IPv6_ConfigDriverCheckChecksum/FreeRTOSIPConfig.h @@ -106,7 +106,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_IPv6_Utils/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_IPv6_Utils/FreeRTOSIPConfig.h index 95b087a475..dbd9c417f8 100644 --- a/test/unit-test/FreeRTOS_IPv6_Utils/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_IPv6_Utils/FreeRTOSIPConfig.h @@ -105,7 +105,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h index a3ed8a1a01..594af2296a 100644 --- a/test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Routing/FreeRTOSIPConfig.h @@ -109,7 +109,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_Routing_ConfigCompatibleWithSingle/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Routing_ConfigCompatibleWithSingle/FreeRTOSIPConfig.h index 2f38e010f4..1694370464 100644 --- a/test/unit-test/FreeRTOS_Routing_ConfigCompatibleWithSingle/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Routing_ConfigCompatibleWithSingle/FreeRTOSIPConfig.h @@ -113,7 +113,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h index 53c48bdeff..ddc95ecdb2 100644 --- a/test/unit-test/FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Routing_ConfigV4Only/FreeRTOSIPConfig.h @@ -115,7 +115,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_Sockets_DiffConfig/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Sockets_DiffConfig/FreeRTOSIPConfig.h index b86e87136d..1d50c302eb 100644 --- a/test/unit-test/FreeRTOS_Sockets_DiffConfig/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Sockets_DiffConfig/FreeRTOSIPConfig.h @@ -103,7 +103,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_Sockets_DiffConfig1/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Sockets_DiffConfig1/FreeRTOSIPConfig.h index 0f60a4da27..da390dc439 100644 --- a/test/unit-test/FreeRTOS_Sockets_DiffConfig1/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Sockets_DiffConfig1/FreeRTOSIPConfig.h @@ -105,7 +105,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_TCP_IP_DiffConfig/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_TCP_IP_DiffConfig/FreeRTOSIPConfig.h index dbd4141e2f..4815614c7a 100644 --- a/test/unit-test/FreeRTOS_TCP_IP_DiffConfig/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_TCP_IP_DiffConfig/FreeRTOSIPConfig.h @@ -103,7 +103,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_Tiny_TCP/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_Tiny_TCP/FreeRTOSIPConfig.h index f04738b64d..28f657715e 100644 --- a/test/unit-test/FreeRTOS_Tiny_TCP/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_Tiny_TCP/FreeRTOSIPConfig.h @@ -103,7 +103,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOSIPConfig.h index 6596cb1e0e..52819c5ae8 100644 --- a/test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_UDP_IPv4/FreeRTOSIPConfig.h @@ -108,7 +108,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 diff --git a/test/unit-test/FreeRTOS_UDP_IPv6/FreeRTOSIPConfig.h b/test/unit-test/FreeRTOS_UDP_IPv6/FreeRTOSIPConfig.h index f8c258778d..86da706217 100644 --- a/test/unit-test/FreeRTOS_UDP_IPv6/FreeRTOSIPConfig.h +++ b/test/unit-test/FreeRTOS_UDP_IPv6/FreeRTOSIPConfig.h @@ -107,7 +107,7 @@ /* If ipconfigUSE_NETWORK_EVENT_HOOK is set to 1 then FreeRTOS+TCP will call the * network event hook at the appropriate times. If ipconfigUSE_NETWORK_EVENT_HOOK * is not set to 1 then the network event hook will never be called. See: - * http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/API/vApplicationIPNetworkEventHook.shtml. + * https://freertos.org/Documentation/03-Libraries/02-FreeRTOS-plus/02-FreeRTOS-plus-TCP/09-API-reference/57-vApplicationIPNetworkEventHook. */ #define ipconfigUSE_NETWORK_EVENT_HOOK 1 From bb11bb938924d3056d5354d7319b92df40497e0b Mon Sep 17 00:00:00 2001 From: Kerem Zorer <98871026+keremzorer@users.noreply.github.com> Date: Wed, 7 Aug 2024 08:07:26 +0300 Subject: [PATCH 3/8] Add ipconfigEMAC_TASK_HOOK macro to STMH7xx network interface (#1176) Add ipconfigEMAC_TASK_HOOK macro to STMH7xx network interface --- source/portable/NetworkInterface/STM32Hxx/NetworkInterface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/portable/NetworkInterface/STM32Hxx/NetworkInterface.c b/source/portable/NetworkInterface/STM32Hxx/NetworkInterface.c index e42e58fddc..6536b3085a 100644 --- a/source/portable/NetworkInterface/STM32Hxx/NetworkInterface.c +++ b/source/portable/NetworkInterface/STM32Hxx/NetworkInterface.c @@ -87,6 +87,9 @@ #define niEMAC_HANDLER_TASK_PRIORITY configMAX_PRIORITIES - 1 #endif +#ifndef ipconfigEMAC_TASK_HOOK + #define ipconfigEMAC_TASK_HOOK() +#endif /* Bit map of outstanding ETH interrupt events for processing. */ static volatile uint32_t ulISREvents; @@ -1193,6 +1196,8 @@ static void prvEMACHandlerTask( void * pvParameters ) prvEthernetUpdateConfig( pdFALSE ); } } + + ipconfigEMAC_TASK_HOOK(); } } From d70107967a14094994aecef68889b26e196ee6e0 Mon Sep 17 00:00:00 2001 From: Emil Popov Date: Wed, 7 Aug 2024 07:17:34 -0400 Subject: [PATCH 4/8] Fixes reception of multicast custom Ethernet frames (#1177) * Fixes a bug that was preventing multicast custom Ethernet frames to be parsed when ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES was disabled. * Fix formatting --------- Co-authored-by: Emil Popov Co-authored-by: tony-josi-aws Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> --- source/FreeRTOS_IP.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/FreeRTOS_IP.c b/source/FreeRTOS_IP.c index 607bc8fdc2..348b1e4d29 100644 --- a/source/FreeRTOS_IP.c +++ b/source/FreeRTOS_IP.c @@ -1510,12 +1510,13 @@ eFrameProcessingResult_t eConsiderFrameForProcessing( const uint8_t * const pucE else { /* The frame is an unsupported Ethernet II type */ - #if ipconfigIS_DISABLED( ipconfigPROCESS_CUSTOM_ETHERNET_FRAMES ) - /* Processing custom ethernet frames is disabled - release it. */ - break; - #else - /* Processing custom ethernet frames is enabled - Continue filter checks. */ + #if ipconfigIS_ENABLED( ipconfigPROCESS_CUSTOM_ETHERNET_FRAMES ) + + /* Processing custom Ethernet frames is enabled. No need for any further testing. + * Accept the frame whether it's a unicast, multicast, or broadcast. */ + eReturn = eProcessBuffer; #endif + break; } /* Third, filter based on destination mac address. */ From cb8f00c097b178d393e1018d737876f2c27d6be5 Mon Sep 17 00:00:00 2001 From: xuan97z1 <68539887+xuan97z1@users.noreply.github.com> Date: Mon, 9 Sep 2024 12:45:06 +0800 Subject: [PATCH 5/8] Updated RX portable layer for backward compatibility (#1182) * Updated RX portable layer for backward compatibility Signed-off-by: RESG_XX * Fix formatting and spell check Signed-off-by: Gaurav Aggarwal --------- Signed-off-by: RESG_XX Signed-off-by: Gaurav Aggarwal Co-authored-by: Gaurav Aggarwal --- .../NetworkInterface/RX/NetworkInterface.c | 14 ++++++++++++-- .../FreeRTOS_TCP_Reception_utest.c | 12 ++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/source/portable/NetworkInterface/RX/NetworkInterface.c b/source/portable/NetworkInterface/RX/NetworkInterface.c index 6f5d3a6c72..1c38741730 100644 --- a/source/portable/NetworkInterface/RX/NetworkInterface.c +++ b/source/portable/NetworkInterface/RX/NetworkInterface.c @@ -101,8 +101,10 @@ void prvLinkStatusChange( BaseType_t xStatus ); /*-----------------------------------------------------------*/ -NetworkInterface_t * pxRX_FillInterfaceDescriptor( BaseType_t xEMACIndex, - NetworkInterface_t * pxInterface ); +#if ( ipconfigIPv4_BACKWARD_COMPATIBLE != 0 ) + NetworkInterface_t * pxRX_FillInterfaceDescriptor( BaseType_t xEMACIndex, + NetworkInterface_t * pxInterface ); +#endif /* Function to initialise the network interface */ BaseType_t xRX_NetworkInterfaceInitialise( NetworkInterface_t * pxInterface ); @@ -136,6 +138,14 @@ NetworkInterface_t * pxRX_FillInterfaceDescriptor( BaseType_t xEMACIndex, return pxInterface; } +#if ( ipconfigIPv4_BACKWARD_COMPATIBLE != 0 ) + NetworkInterface_t * pxFillInterfaceDescriptor( BaseType_t xEMACIndex, + NetworkInterface_t * pxInterface ) + { + return pxRX_FillInterfaceDescriptor( xEMACIndex, pxInterface ); + } +#endif + /*********************************************************************************************************************** * Function Name: xRX_NetworkInterfaceInitialise () * Description : Initialization of Ethernet driver. diff --git a/test/unit-test/FreeRTOS_TCP_Reception/FreeRTOS_TCP_Reception_utest.c b/test/unit-test/FreeRTOS_TCP_Reception/FreeRTOS_TCP_Reception_utest.c index c626a522c1..a12479374b 100644 --- a/test/unit-test/FreeRTOS_TCP_Reception/FreeRTOS_TCP_Reception_utest.c +++ b/test/unit-test/FreeRTOS_TCP_Reception/FreeRTOS_TCP_Reception_utest.c @@ -786,7 +786,7 @@ void test_prvCheckRxData_URG_On( void ) TEST_ASSERT_EQUAL( 4, result ); } -/* Test for prvStorexData function. */ +/* Test for prvStoreRxData function. */ void test_prvStoreRxData_Happy_Path( void ) { int32_t result; @@ -827,7 +827,7 @@ void test_prvStoreRxData_Happy_Path( void ) TEST_ASSERT_EQUAL( 0, xResult ); } -/* Test for prvStorexData function. */ +/* Test for prvStoreRxData function. */ void test_prvStoreRxData_Wrong_State( void ) { int32_t result; @@ -859,7 +859,7 @@ void test_prvStoreRxData_Wrong_State( void ) TEST_ASSERT_EQUAL( 0, xResult ); } -/* Test for prvStorexData function. */ +/* Test for prvStoreRxData function. */ void test_prvStoreRxData_Zero_Length( void ) { int32_t result; @@ -901,7 +901,7 @@ void test_prvStoreRxData_Zero_Length( void ) } -/* Test for prvStorexData function. */ +/* Test for prvStoreRxData function. */ void test_prvStoreRxData_Null_RxStream( void ) { int32_t result; @@ -938,7 +938,7 @@ void test_prvStoreRxData_Null_RxStream( void ) TEST_ASSERT_EQUAL( -1, xResult ); } -/* Test for prvStorexData function. */ +/* Test for prvStoreRxData function. */ void test_prvStoreRxData_Negative_Offset( void ) { int32_t result; @@ -975,7 +975,7 @@ void test_prvStoreRxData_Negative_Offset( void ) TEST_ASSERT_EQUAL( 0, xResult ); } -/* Test for prvStorexData function. */ +/* Test for prvStoreRxData function. */ void test_prvStoreRxData_None_Zero_Skipcount( void ) { int32_t result; From 3c9140d5db7a80405476c3a69b5ca2a6d2fd0dfe Mon Sep 17 00:00:00 2001 From: Leandro Zungri Date: Wed, 11 Sep 2024 03:25:52 -0700 Subject: [PATCH 6/8] Optimize uxStreamBufferAdd() locking mechanism (#1181) * Optimize uxStreamBufferAdd() locking mechanism * Fix uxStreamBufferAdd unit tests --------- Co-authored-by: Tony Josi --- source/FreeRTOS_Stream_Buffer.c | 4 ++-- .../FreeRTOS_Stream_Buffer_utest.c | 21 ------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/source/FreeRTOS_Stream_Buffer.c b/source/FreeRTOS_Stream_Buffer.c index 5c0c52fc85..5f0d08f5bc 100644 --- a/source/FreeRTOS_Stream_Buffer.c +++ b/source/FreeRTOS_Stream_Buffer.c @@ -307,7 +307,7 @@ size_t uxStreamBufferAdd( StreamBuffer_t * const pxBuffer, /* The below update to the stream buffer members must happen * atomically. */ - vTaskSuspendAll(); + taskENTER_CRITICAL(); { if( uxOffset == 0U ) { @@ -328,7 +328,7 @@ size_t uxStreamBufferAdd( StreamBuffer_t * const pxBuffer, pxBuffer->uxFront = uxNextHead; } } - ( void ) xTaskResumeAll(); + taskEXIT_CRITICAL(); } return uxCount; diff --git a/test/unit-test/FreeRTOS_Stream_Buffer/FreeRTOS_Stream_Buffer_utest.c b/test/unit-test/FreeRTOS_Stream_Buffer/FreeRTOS_Stream_Buffer_utest.c index b4e6c3d29f..2fcb41c550 100644 --- a/test/unit-test/FreeRTOS_Stream_Buffer/FreeRTOS_Stream_Buffer_utest.c +++ b/test/unit-test/FreeRTOS_Stream_Buffer/FreeRTOS_Stream_Buffer_utest.c @@ -601,9 +601,6 @@ void test_uxStreamBufferAdd_BufferHasMoreSpaceThanData_ZeroOffset_DataWriteCause FreeRTOS_min_size_t_Stub( FreeRTOS_min_stub ); - vTaskSuspendAll_Expect(); - xTaskResumeAll_ExpectAndReturn( pdTRUE ); - uxReturn = uxStreamBufferAdd( pxLocalBuffer, uxOffset, pucData, uxByteCount ); /* Only these many bytes should be written. */ @@ -656,9 +653,6 @@ void test_uxStreamBufferAdd_BufferHasLessSpaceThanData_ZeroOffset( void ) FreeRTOS_min_size_t_Stub( FreeRTOS_min_stub ); - vTaskSuspendAll_Expect(); - xTaskResumeAll_ExpectAndReturn( pdTRUE ); - uxReturn = uxStreamBufferAdd( pxLocalBuffer, uxOffset, pucData, uxByteCount ); /* Only 500 bytes should be written. */ @@ -702,9 +696,6 @@ void test_uxStreamBufferAdd_BufferHasLessSpaceThanData_NonZeroOffset( void ) FreeRTOS_min_size_t_Stub( FreeRTOS_min_stub ); - vTaskSuspendAll_Expect(); - xTaskResumeAll_ExpectAndReturn( pdTRUE ); - uxReturn = uxStreamBufferAdd( pxLocalBuffer, uxOffset, pucData, uxByteCount ); /* Only these many bytes should be written. */ @@ -757,9 +748,6 @@ void test_uxStreamBufferAdd_BufferHasLessSpaceThanData_NonZeroOffsetCausesRollov FreeRTOS_min_size_t_Stub( FreeRTOS_min_stub ); - vTaskSuspendAll_Expect(); - xTaskResumeAll_ExpectAndReturn( pdTRUE ); - uxReturn = uxStreamBufferAdd( pxLocalBuffer, uxOffset, pucData, uxByteCount ); /* Only these many bytes should be written. */ @@ -813,9 +801,6 @@ void test_uxStreamBufferAdd_BufferHasLessSpaceThanData_ZeroOffset_DataWriteCause FreeRTOS_min_size_t_Stub( FreeRTOS_min_stub ); - vTaskSuspendAll_Expect(); - xTaskResumeAll_ExpectAndReturn( pdTRUE ); - uxReturn = uxStreamBufferAdd( pxLocalBuffer, uxOffset, pucData, uxByteCount ); /* Only these many bytes should be written. */ @@ -873,9 +858,6 @@ void test_uxStreamBufferAdd_NULLData_BufferHasLessSpaceThanData_ZeroOffset_DataW FreeRTOS_min_size_t_Stub( FreeRTOS_min_stub ); - vTaskSuspendAll_Expect(); - xTaskResumeAll_ExpectAndReturn( pdTRUE ); - uxReturn = uxStreamBufferAdd( pxLocalBuffer, uxOffset, NULL, uxByteCount ); /* Nothing should be written but tail will be updated. */ @@ -929,9 +911,6 @@ void test_uxStreamBufferAdd_NULLData_BufferHasLessSpaceThanData_ZeroOffset_DataW FreeRTOS_min_size_t_Stub( FreeRTOS_min_stub ); - vTaskSuspendAll_Expect(); - xTaskResumeAll_ExpectAndReturn( pdTRUE ); - uxReturn = uxStreamBufferAdd( pxLocalBuffer, uxOffset, NULL, uxByteCount ); /* Nothing should be written but tail should be updated. */ From a45bfe2dd1fb532ef878456461fc7285bcde6fa3 Mon Sep 17 00:00:00 2001 From: Tony Josi Date: Thu, 12 Sep 2024 12:56:28 +0530 Subject: [PATCH 7/8] Fix ARP failure with loopback addresses (#1185) * Apply patch from @htibosch * Fix existing ARP tests * Make ARP coverage 100% * Fix DNS Callback utests * Minor code standardisation * Minor cleanup * Fix formatting and spell check --- source/FreeRTOS_ARP.c | 15 ++- source/FreeRTOS_DNS_Callback.c | 4 +- .../loopback/loopbackNetworkInterface.c | 24 ++-- .../FreeRTOS_ARP/FreeRTOS_ARP_utest.c | 108 ++++++++++++++++++ .../FreeRTOS_DNS_Callback_utest.c | 4 +- 5 files changed, 141 insertions(+), 14 deletions(-) diff --git a/source/FreeRTOS_ARP.c b/source/FreeRTOS_ARP.c index 1e1fa615e4..1a3dc6a47c 100644 --- a/source/FreeRTOS_ARP.c +++ b/source/FreeRTOS_ARP.c @@ -962,7 +962,7 @@ static BaseType_t prvFindCacheEntry( const MACAddress_t * pxMACAddress, MACAddress_t * const pxMACAddress, struct xNetworkEndPoint ** ppxEndPoint ) { - eARPLookupResult_t eReturn; + eARPLookupResult_t eReturn = eCantSendPacket; uint32_t ulAddressToLookup; NetworkEndPoint_t * pxEndPoint = NULL; @@ -974,12 +974,21 @@ static BaseType_t prvFindCacheEntry( const MACAddress_t * pxMACAddress, ulAddressToLookup = *pulIPAddress; pxEndPoint = FreeRTOS_FindEndPointOnIP_IPv4( ulAddressToLookup ); - if( xIsIPv4Multicast( ulAddressToLookup ) != 0 ) + if( xIsIPv4Loopback( ulAddressToLookup ) != 0 ) + { + if( pxEndPoint != NULL ) + { + /* For multi-cast, use the first IPv4 end-point. */ + memcpy( pxMACAddress->ucBytes, pxEndPoint->xMACAddress.ucBytes, sizeof( pxMACAddress->ucBytes ) ); + *( ppxEndPoint ) = pxEndPoint; + eReturn = eARPCacheHit; + } + } + else if( xIsIPv4Multicast( ulAddressToLookup ) != 0 ) { /* Get the lowest 23 bits of the IP-address. */ vSetMultiCastIPv4MacAddress( ulAddressToLookup, pxMACAddress ); - eReturn = eCantSendPacket; pxEndPoint = FreeRTOS_FirstEndPoint( NULL ); for( ; diff --git a/source/FreeRTOS_DNS_Callback.c b/source/FreeRTOS_DNS_Callback.c index 15bddbfe51..5dd1658ac7 100644 --- a/source/FreeRTOS_DNS_Callback.c +++ b/source/FreeRTOS_DNS_Callback.c @@ -76,8 +76,8 @@ BaseType_t xMatching; DNSCallback_t * pxCallback = ( ( DNSCallback_t * ) listGET_LIST_ITEM_OWNER( pxIterator ) ); #if ( ipconfigUSE_MDNS == 1 ) - /* mDNS port 5353. */ - if( pxSet->usPortNumber == FreeRTOS_htons( ipMDNS_PORT ) ) + /* mDNS port 5353. Host byte order comparison. */ + if( pxSet->usPortNumber == ipMDNS_PORT ) { /* In mDNS, the query ID field is ignored and the * hostname will be compared with outstanding requests. */ diff --git a/source/portable/NetworkInterface/loopback/loopbackNetworkInterface.c b/source/portable/NetworkInterface/loopback/loopbackNetworkInterface.c index cf66a62ffe..9152d47441 100644 --- a/source/portable/NetworkInterface/loopback/loopbackNetworkInterface.c +++ b/source/portable/NetworkInterface/loopback/loopbackNetworkInterface.c @@ -134,23 +134,23 @@ static BaseType_t prvLoopback_Output( NetworkInterface_t * pxInterface, } { - MACAddress_t xMACAddress; + const MACAddress_t * pxMACAddress = &( pxDescriptor->pxEndPoint->xMACAddress ); if( pxDescriptor->pxEndPoint->bits.bIPv6 != 0 ) { #if ( ipconfigUSE_IPv6 != 0 ) - if( xIsIPv6Loopback( &( pxDescriptor->xIPAddress ) ) != pdFALSE ) + if( xIsIPv6Loopback( &( pxDescriptor->xIPAddress.xIP_IPv6 ) ) != pdFALSE ) { - vNDRefreshCacheEntry( &xMACAddress, &( pxDescriptor->xIPAddress.xIP_IPv6 ), pxDescriptor->pxEndPoint ); + vNDRefreshCacheEntry( pxMACAddress, &( pxDescriptor->xIPAddress.xIP_IPv6 ), pxDescriptor->pxEndPoint ); } #endif } else { #if ( ipconfigUSE_IPv4 != 0 ) - if( xIsIPv4Loopback( pxDescriptor->xIPAddress.ulIP_IPv4 ) ) + if( xIsIPv4Loopback( pxDescriptor->xIPAddress.ulIP_IPv4 ) != pdFALSE ) { - vARPRefreshCacheEntry( &xMACAddress, pxDescriptor->xIPAddress.ulIP_IPv4, pxDescriptor->pxEndPoint ); + vARPRefreshCacheEntry( pxMACAddress, pxDescriptor->xIPAddress.ulIP_IPv4, pxDescriptor->pxEndPoint ); } #endif } @@ -170,11 +170,21 @@ static BaseType_t prvLoopback_Output( NetworkInterface_t * pxInterface, xRxEvent.eEventType = eNetworkRxEvent; xRxEvent.pvData = ( void * ) pxDescriptor; - if( xSendEventStructToIPTask( &xRxEvent, 0u ) != pdTRUE ) + pxDescriptor->pxInterface = xLoopbackInterface; + pxDescriptor->pxEndPoint = FreeRTOS_MatchingEndpoint( xLoopbackInterface, pxDescriptor->pucEthernetBuffer ); + + if( pxDescriptor->pxEndPoint == NULL ) + { + vReleaseNetworkBufferAndDescriptor( pxDescriptor ); + iptraceETHERNET_RX_EVENT_LOST(); + FreeRTOS_printf( ( "prvLoopback_Output: Can not find a proper endpoint\n" ) ); + } + else if( xSendEventStructToIPTask( &xRxEvent, 0u ) != pdTRUE ) { + /* Sending failed, release the descriptor. */ vReleaseNetworkBufferAndDescriptor( pxDescriptor ); iptraceETHERNET_RX_EVENT_LOST(); - FreeRTOS_printf( ( "prvEMACRxPoll: Can not queue return packet!\n" ) ); + FreeRTOS_printf( ( "prvLoopback_Output: Can not queue return packet!\n" ) ); } } diff --git a/test/unit-test/FreeRTOS_ARP/FreeRTOS_ARP_utest.c b/test/unit-test/FreeRTOS_ARP/FreeRTOS_ARP_utest.c index 057d39619f..106520eb79 100644 --- a/test/unit-test/FreeRTOS_ARP/FreeRTOS_ARP_utest.c +++ b/test/unit-test/FreeRTOS_ARP/FreeRTOS_ARP_utest.c @@ -558,6 +558,7 @@ void test_eARPProcessPacket_Request_GratuitousARP( void ) vResetARPClashCounter(); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( &xEndPoint ); + xIsIPv4Loopback_ExpectAndReturn( ulTargetIP, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulTargetIP, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( &xEndPoint ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( &xEndPoint ); @@ -621,6 +622,7 @@ void test_eARPProcessPacket_Request_GratuitousARP_MACUnchanged( void ) vResetARPClashCounter(); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( &xEndPoint ); + xIsIPv4Loopback_ExpectAndReturn( ulTargetIP, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulTargetIP, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( &xEndPoint ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( &xEndPoint ); @@ -863,6 +865,7 @@ void test_eARPProcessPacket_Request_GratuitousARP_NonMatchingEndpoint( void ) vResetARPClashCounter(); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( &xEndPoint ); + xIsIPv4Loopback_ExpectAndReturn( ulTargetIP, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulTargetIP, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( &xEndPoint ); @@ -926,6 +929,7 @@ void test_eARPProcessPacket_Request_GratuitousARP_NonMatchingIP( void ) vResetARPClashCounter(); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( &xEndPoint ); + xIsIPv4Loopback_ExpectAndReturn( ulTargetIP, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulTargetIP, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( &xEndPoint ); @@ -2090,6 +2094,7 @@ void test_eARPGetCacheEntry_IPMatchesBroadcastAddr( void ) ulIPAddress = FreeRTOS_ntohl( xNetworkAddressing.ulBroadcastAddress ); /* Not worried about what these functions do. */ FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( &xEndPoint ); eResult = eARPGetCacheEntry( &ulIPAddress, &xMACAddress, &pxEndPoint ); @@ -2112,6 +2117,7 @@ void test_eARPGetCacheEntry_IPMatchesBroadcastAddr_NullEndPointOnNetMask( void ) ulIPAddress = FreeRTOS_ntohl( xNetworkAddressing.ulBroadcastAddress ); /* Not worried about what these functions do. */ FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( NULL ); eResult = eARPGetCacheEntry( &ulIPAddress, &xMACAddress, &pxEndPoint ); @@ -2132,6 +2138,7 @@ void test_eARPGetCacheEntry_MultiCastAddr( void ) /* =================================================== */ ulIPAddress = FreeRTOS_ntohl( xNetworkAddressing.ulBroadcastAddress ); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 1UL ); vSetMultiCastIPv4MacAddress_Ignore(); FreeRTOS_FirstEndPoint_ExpectAndReturn( NULL, NULL ); @@ -2144,6 +2151,7 @@ void test_eARPGetCacheEntry_MultiCastAddr( void ) xEndPoint.bits.bIPv6 = 1; FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 1UL ); vSetMultiCastIPv4MacAddress_Ignore(); FreeRTOS_FirstEndPoint_ExpectAndReturn( NULL, &xEndPoint ); @@ -2169,6 +2177,7 @@ void test_eARPGetCacheEntry_IPMatchesOtherBroadcastAddr( void ) ulIPAddress = FreeRTOS_ntohl( ipBROADCAST_IP_ADDRESS ); /* Not worried about what these functions do. */ FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( &xEndPoint ); eResult = eARPGetCacheEntry( &ulIPAddress, &xMACAddress, &pxEndPoint ); @@ -2198,6 +2207,7 @@ void test_eARPGetCacheEntry_MatchingInvalidEntry( void ) /* Not worried about what these functions do. */ xEndPoint.ipv4_settings.ulGatewayAddress = xNetworkAddressing.ulGatewayAddress; FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( NULL ); FreeRTOS_FindGateWay_ExpectAnyArgsAndReturn( &xEndPoint ); @@ -2227,6 +2237,7 @@ void test_eARPGetCacheEntry_MatchingValidEntry( void ) /* Not worried about what these functions do. */ xEndPoint.ipv4_settings.ulGatewayAddress = xNetworkAddressing.ulGatewayAddress; FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( NULL ); FreeRTOS_FindGateWay_ExpectAnyArgsAndReturn( &xEndPoint ); @@ -2259,6 +2270,7 @@ void test_eARPGetCacheEntry_GatewayAddressZero( void ) /* Not worried about what these functions do. */ xEndPoint.ipv4_settings.ulGatewayAddress = 0; FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( NULL ); FreeRTOS_FindGateWay_ExpectAnyArgsAndReturn( NULL ); @@ -2286,6 +2298,7 @@ void test_eARPGetCacheEntry_AddressNotOnLocalAddress( void ) /* Not worried about what these functions do. */ FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( NULL ); FreeRTOS_FindGateWay_ExpectAnyArgsAndReturn( NULL ); @@ -2324,6 +2337,7 @@ void test_eARPGetCacheEntry_NoCacheHit( void ) pxNetworkEndPoints = &xEndPoint; /* Not worried about what these functions do. */ FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( NULL ); eResult = eARPGetCacheEntry( &ulIPAddress, &xMACAddress, &pxEndPoint ); @@ -2333,6 +2347,91 @@ void test_eARPGetCacheEntry_NoCacheHit( void ) /* =================================================== */ } +/** + * @brief Test the scenario that the address given is a loopback address + * but there is no loopback endpoint + */ +void test_eARPGetCacheEntry_LoopbackAddress( void ) +{ + uint32_t ulIPAddress; + MACAddress_t xMACAddress = { 0 }; + MACAddress_t xMACAddressExp = { 0 }; + eARPLookupResult_t eResult; + uint32_t ulSavedGatewayAddress; + struct xNetworkInterface * xInterface; + struct xNetworkEndPoint * pxEndPoint, xEndPoint; + int i; + + /* =================================================== */ + for( i = 0; i < ipconfigARP_CACHE_ENTRIES; i++ ) + { + xARPCache[ i ].ulIPAddress = 0; + xARPCache[ i ].ucValid = ( uint8_t ) pdTRUE; + xARPCache[ i ].pxEndPoint = NULL; + } + + ulSavedGatewayAddress = xNetworkAddressing.ulGatewayAddress; + xNetworkAddressing.ulGatewayAddress = 0; + /* Make IP address param == 0 */ + ulIPAddress = 0x7F000000UL; + + /* Make both values (IP address and local IP pointer) different + * and on different net masks. */ + xEndPoint.ipv4_settings.ulIPAddress = 0x1234; + pxNetworkEndPoints = &xEndPoint; + /* Not worried about what these functions do. */ + FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 1UL ); + eResult = eARPGetCacheEntry( &ulIPAddress, &xMACAddress, &pxEndPoint ); + TEST_ASSERT_EQUAL( eCantSendPacket, eResult ); + TEST_ASSERT_NOT_EQUAL( pxEndPoint, &xEndPoint ); + TEST_ASSERT_EQUAL_MEMORY( xMACAddressExp.ucBytes, xMACAddress.ucBytes, sizeof( MACAddress_t ) ); + /* =================================================== */ +} + +/** + * @brief Test the scenario that the address given is a loopback address + * and there is a loopback endpoint + */ +void test_eARPGetCacheEntry_LoopbackAddress_ValidLPEndpoint( void ) +{ + uint32_t ulIPAddress; + MACAddress_t xMACAddress = { 0 }; + MACAddress_t xMACAddressExp = { 0x11, 0x22, 0x33, 0x11, 0x22, 0x33 }; + eARPLookupResult_t eResult; + uint32_t ulSavedGatewayAddress; + struct xNetworkInterface * xInterface; + struct xNetworkEndPoint * pxEndPoint, xEndPoint; + int i; + + /* =================================================== */ + for( i = 0; i < ipconfigARP_CACHE_ENTRIES; i++ ) + { + xARPCache[ i ].ulIPAddress = 0; + xARPCache[ i ].ucValid = ( uint8_t ) pdTRUE; + xARPCache[ i ].pxEndPoint = NULL; + } + + ulSavedGatewayAddress = xNetworkAddressing.ulGatewayAddress; + xNetworkAddressing.ulGatewayAddress = 0; + /* Make IP address param == 0 */ + ulIPAddress = 0x7F000000UL; + + /* Make both values (IP address and local IP pointer) different + * and on different net masks. */ + xEndPoint.ipv4_settings.ulIPAddress = 0x1234; + memcpy( xEndPoint.xMACAddress.ucBytes, xMACAddressExp.ucBytes, sizeof( MACAddress_t ) ); + pxNetworkEndPoints = &xEndPoint; + /* Not worried about what these functions do. */ + FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( &xEndPoint ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 1UL ); + eResult = eARPGetCacheEntry( &ulIPAddress, &xMACAddress, &pxEndPoint ); + TEST_ASSERT_EQUAL( eARPCacheHit, eResult ); + TEST_ASSERT_EQUAL( pxEndPoint, &xEndPoint ); + TEST_ASSERT_EQUAL_MEMORY( xMACAddressExp.ucBytes, xMACAddress.ucBytes, sizeof( MACAddress_t ) ); + /* =================================================== */ +} + void test_vARPAgeCache( void ) { NetworkEndPoint_t xEndPoint = { 0 }; @@ -2641,6 +2740,7 @@ void test_xARPWaitResolution_PrivateFunctionReturnsHit( void ) xIsCallingFromIPTask_IgnoreAndReturn( pdFALSE ); /* Not worried about what these functions do. */ FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 1UL ); vSetMultiCastIPv4MacAddress_Ignore(); FreeRTOS_FirstEndPoint_ExpectAndReturn( NULL, &xEndPoint ); @@ -2679,6 +2779,7 @@ void test_xARPWaitResolution_GNWFailsNoTimeout( void ) FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); xIsCallingFromIPTask_IgnoreAndReturn( pdFALSE ); /* Not worried about what these functions do. */ + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( ( void * ) 1234 ); @@ -2691,6 +2792,7 @@ void test_xARPWaitResolution_GNWFailsNoTimeout( void ) pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, NULL ); vTaskDelay_Expect( pdMS_TO_TICKS( 250U ) ); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( ( void * ) 1234 ); xTaskCheckForTimeOut_IgnoreAndReturn( pdFALSE ); @@ -2730,6 +2832,7 @@ void test_xARPWaitResolution( void ) FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); xIsCallingFromIPTask_IgnoreAndReturn( pdFALSE ); /* Not worried about what these functions do. */ + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( ( void * ) 1234 ); @@ -2742,6 +2845,7 @@ void test_xARPWaitResolution( void ) pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, NULL ); vTaskDelay_Expect( pdMS_TO_TICKS( 250U ) ); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( ( void * ) 1234 ); xTaskCheckForTimeOut_IgnoreAndReturn( pdFALSE ); @@ -2751,6 +2855,7 @@ void test_xARPWaitResolution( void ) pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, NULL ); vTaskDelay_Expect( pdMS_TO_TICKS( 250U ) ); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( ( void * ) 1234 ); xTaskCheckForTimeOut_IgnoreAndReturn( pdTRUE ); @@ -2778,6 +2883,7 @@ void test_xARPWaitResolution( void ) FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); xIsCallingFromIPTask_IgnoreAndReturn( pdFALSE ); /* Not worried about what these functions do. */ + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( ( void * ) 1234 ); @@ -2790,6 +2896,7 @@ void test_xARPWaitResolution( void ) pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, NULL ); vTaskDelay_Expect( pdMS_TO_TICKS( 250U ) ); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 0UL ); FreeRTOS_FindEndPointOnNetMask_ExpectAnyArgsAndReturn( ( void * ) 1234 ); xTaskCheckForTimeOut_IgnoreAndReturn( pdFALSE ); @@ -2799,6 +2906,7 @@ void test_xARPWaitResolution( void ) pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, NULL ); vTaskDelay_Expect( pdMS_TO_TICKS( 250U ) ); FreeRTOS_FindEndPointOnIP_IPv4_ExpectAnyArgsAndReturn( NULL ); + xIsIPv4Loopback_ExpectAndReturn( ulIPAddress, 0UL ); xIsIPv4Multicast_ExpectAndReturn( ulIPAddress, 1UL ); vSetMultiCastIPv4MacAddress_Ignore(); FreeRTOS_FirstEndPoint_ExpectAndReturn( NULL, &xEndPoint ); diff --git a/test/unit-test/FreeRTOS_DNS_Callback/FreeRTOS_DNS_Callback_utest.c b/test/unit-test/FreeRTOS_DNS_Callback/FreeRTOS_DNS_Callback_utest.c index d351003872..1f3eae7f0e 100644 --- a/test/unit-test/FreeRTOS_DNS_Callback/FreeRTOS_DNS_Callback_utest.c +++ b/test/unit-test/FreeRTOS_DNS_Callback/FreeRTOS_DNS_Callback_utest.c @@ -216,7 +216,7 @@ void test_xDNSDoCallback_success_equal_port_number_equal_name( void ) DNSCallback_t * pxDnsCallback = ( DNSCallback_t * ) &dnsCallbackMemory; pxSet.pxDNSMessageHeader = &xDNSMessageHeader; - pxSet.usPortNumber = FreeRTOS_htons( ipMDNS_PORT ); + pxSet.usPortNumber = ipMDNS_PORT; strcpy( pxSet.pcName, pc_name ); pxDnsCallback->pCallbackFunction = dns_callback; strcpy( pxDnsCallback->pcName, pc_name ); @@ -255,7 +255,7 @@ void test_xDNSDoCallback_fail_equal_port_number_not_equal_name( void ) pxSet.pxDNSMessageHeader = &xDNSMessageHeader; pxSet.pxDNSMessageHeader->usIdentifier = 123; - pxSet.usPortNumber = FreeRTOS_htons( ipMDNS_PORT ); + pxSet.usPortNumber = ipMDNS_PORT; char pc_name[] = "test"; strcpy( pxSet.pcName, pc_name ); dnsCallback->pCallbackFunction = dns_callback; From 8aebab7b1ba5dceaa73ad21882eb6a07dc285e8c Mon Sep 17 00:00:00 2001 From: Emil Popov Date: Mon, 16 Sep 2024 03:11:17 -0400 Subject: [PATCH 8/8] Adds a warning if the stream-buffer or windows properties are changed on an already connected socket. Discussed in #1184 (#1188) Also changes the error message to using FreeRTOS_printf instead of FreeRTOS_debug_printf to increase the chances of being seen. Co-authored-by: Emil Popov --- source/FreeRTOS_Sockets.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/source/FreeRTOS_Sockets.c b/source/FreeRTOS_Sockets.c index a4ffaf389c..b473c06f5b 100644 --- a/source/FreeRTOS_Sockets.c +++ b/source/FreeRTOS_Sockets.c @@ -2356,17 +2356,25 @@ void * vSocketClose( FreeRTOS_Socket_t * pxSocket ) uint32_t ulNewValue; BaseType_t xReturn; + if( ( FreeRTOS_issocketconnected( pxSocket ) == pdTRUE ) ) + { + /* If this socket is the child of a listening socket, the remote client may or may not have already sent + * us data. If data was already sent, then pxSocket->u.xTCP.rxStream != NULL and this call will fail. + * Warn the user about this inconsistent behavior. */ + FreeRTOS_printf( ( "Warning: Changing buffer/window properties on a connected socket may fail." ) ); + } + if( pxSocket->ucProtocol != ( uint8_t ) FREERTOS_IPPROTO_TCP ) { - FreeRTOS_debug_printf( ( "Set SO_%sBUF: wrong socket type\n", - ( lOptionName == FREERTOS_SO_SNDBUF ) ? "SND" : "RCV" ) ); + FreeRTOS_printf( ( "Set SO_%sBUF: wrong socket type\n", + ( lOptionName == FREERTOS_SO_SNDBUF ) ? "SND" : "RCV" ) ); xReturn = -pdFREERTOS_ERRNO_EINVAL; } else if( ( ( lOptionName == FREERTOS_SO_SNDBUF ) && ( pxSocket->u.xTCP.txStream != NULL ) ) || ( ( lOptionName == FREERTOS_SO_RCVBUF ) && ( pxSocket->u.xTCP.rxStream != NULL ) ) ) { - FreeRTOS_debug_printf( ( "Set SO_%sBUF: buffer already created\n", - ( lOptionName == FREERTOS_SO_SNDBUF ) ? "SND" : "RCV" ) ); + FreeRTOS_printf( ( "Set SO_%sBUF: buffer already created\n", + ( lOptionName == FREERTOS_SO_SNDBUF ) ? "SND" : "RCV" ) ); xReturn = -pdFREERTOS_ERRNO_EINVAL; } else