Skip to content

Commit

Permalink
Merge pull request #8 from moninom1/maintry2
Browse files Browse the repository at this point in the history
Merging to main
  • Loading branch information
moninom1 authored Jul 4, 2023
2 parents f71fe91 + 1ceb4f0 commit d46d9ab
Show file tree
Hide file tree
Showing 510 changed files with 94,103 additions and 14,817 deletions.
475 changes: 475 additions & 0 deletions .github/lexicon.txt
100644 → 100755

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,29 @@ jobs:
run: |
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL
cmake --build build --target freertos_plus_tcp_build_test
- name: Build checks (Enable all functionalities IPv4)
run: |
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
- name: Build checks (Enable all functionalities IPv6)
run: |
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV6
cmake --build build --target freertos_plus_tcp_build_test
- name: Build checks (Enable all functionalities IPv4 IPv6)
run: |
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4_IPV6
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
- name: Build checks (Enable all functionalities IPv4 TCP)
run: |
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV4_TCP
cmake --build build --target clean
cmake --build build --target freertos_plus_tcp_build_test
- name: Build checks (Enable all functionalities IPv6 TCP)
run: |
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=ENABLE_ALL_IPV6_TCP
cmake --build build --target freertos_plus_tcp_build_test
- name: Build checks (Disable all functionalities)
run: |
cmake -S . -B build -DFREERTOS_PLUS_TCP_TEST_CONFIGURATION=DISABLE_ALL
Expand Down
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,15 @@ endif()
# on the config defined in the freertos_config
set(FREERTOS_PLUS_TCP_TEST_CONFIGURATION "CUSTOM" CACHE STRING "FreeRTOS Plus TCP Build Test configuration")
set(FREERTOS_PLUS_TCP_TEST_CONFIGURATION_LIST
CUSTOM # Custom (external) configuration -eg from a top-level project
ENABLE_ALL # Enable all configuration settings
DISABLE_ALL # Disable all configuration settings
DEFAULT_CONF # Default (typical) configuration
CUSTOM # Custom (external) configuration -eg from a top-level project
ENABLE_ALL # Enable all configuration settings
ENABLE_ALL_IPV4 # Enable all configuration settings IPv4 UDP
ENABLE_ALL_IPV6 # Enable all configuration settings IPv6 UDP
ENABLE_ALL_IPV4_TCP # Enable all configuration settings IPv4 TCP
ENABLE_ALL_IPV6_TCP # Enable all configuration settings IPv6 TCP
ENABLE_ALL_IPV4_IPV6 # Enable all configuration settings IPv4 IPv6 UDP
DISABLE_ALL # Disable all configuration settings
DEFAULT_CONF # Default (typical) configuration
)
if(NOT FREERTOS_PLUS_TCP_TEST_CONFIGURATION IN_LIST FREERTOS_PLUS_TCP_TEST_CONFIGURATION_LIST)
message(FATAL_ERROR "Invalid FREERTOS_PLUS_TCP_TEST_CONFIGURATION value '${FREERTOS_PLUS_TCP_TEST_CONFIGURATION}' should be one of: ${FREERTOS_PLUS_TCP_TEST_CONFIGURATION_LIST}")
Expand Down Expand Up @@ -191,6 +196,7 @@ add_compile_options(
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wall>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wextra>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Werror>
$<$<COMPILE_LANG_AND_ID:C,Clang,GNU>:-Wunused-variable>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Weverything>

# TODO: Add in other Compilers here.
Expand Down
75 changes: 75 additions & 0 deletions GettingStarted_4.0.0-rc3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Moving to 4.0.0-rc1/rc2/rc3 from 3.x.x:
--------------------------------

Version 4.0.0-rc1/rc2/rc3 adds new files to support IPv6 functionality, breaking each file into logically separated IPv4 and IPv6 files. The folder structure of FreeRTOS-Plus-TCP remains unchanged. Build separation is added to make the library modular, enabling users to compile and create a low-footprint binary with only the required functionalities. For more details on supported build combinations, see [History.txt](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/dev/IPv6_integration/History.txt) .

Some of the APIs have changed which is illustrated in the section below. However, there is a backward compatibility mode provided as well.

Backward Compatibility Mode:
---------------------------
If you are moving your code from V3.x.x to V4.0.0-rc1/rc2/rc3, then set the "ipconfigIPv4_BACKWARD_COMPATIBLE" macro to 1 in “FreeRTOSIPConfigDefaults.h” to run the code in backward compatible mode.
The "Existing API's" defined in all the API changes below work only when the backward compatibility mode is enabled.

API changes in 4.0.0-rc1/rc2/rc3:
----------------------

The changes mentioned below uses ipconfigIPv4_BACKWARD_COMPATIBLE flag to differentiate between old API and new API.

Change 1:

- Existing API: FreeRTOS_IPInit
- Backward compatibility with the IPv4 FreeRTOS+TCP V3.x.x which only supports single network interface. This can be used for single interface IPv4 systems.
- New API: FreeRTOS_IPInit_Multi
- Supports multiple interfaces. Before calling this function, at least 1 interface and 1 end-point must have been set-up. FreeRTOS_IPInit_Multi() replaces the earlier FreeRTOS_IPInit().

Change 2:

- Existing API: FreeRTOS_GetAddressConfiguration/FreeRTOS_SetAddressConfiguration
- Get/Set the address configuration from the global variables initialised during FreeRTOS_IPInit
- New API: FreeRTOS_GetEndPointConfiguration/FreeRTOS_SetEndPointConfiguration
- Get/Set the same address configuration from/to the end point

Change 3:

- Existing API: FreeRTOS_GetUDPPayloadBuffer
- Backward compatibility with the IPv4 FreeRTOS+TCP V3.x.x. This can still be used for IPv4 use cases.
- New API:FreeRTOS_GetUDPPayloadBuffer_Multi
- A new argument (uint8_t ucIPType) to specify IP type to support both IPv4 and IPv6

Change 4:

- Existing API: pxFillInterfaceDescriptor
- It is there for backward compatibility. The function FreeRTOS_IPInit() will call it to initialise the interface and end-point objects
- New API: prefix_pxFillInterfaceDescriptor
- where prefix = Network Interface Name
- E.g pxWinPcap_FillInterfaceDescriptor
- New function with the same functionality

Change 5:

- Existing API: vApplicationIPNetworkEventHook
- New API: vApplicationIPNetworkEventHook_Multi
- New argument “struct xNetworkInterface * pxNetworkInterface” added.

Change 6:

- Existing API: xApplicationDHCPHook
- New API: xApplicationDHCPHook_Multi
- New argument "struct xNetworkEndPoint * pxEndPoint" added.

Change 7:

- Existing API: xApplicationDNSQueryHook
- New API: xApplicationDNSQueryHook_Multi
- New argument "struct xNetworkEndPoint * pxEndPoint" added.

**NOTE** : We are NOT considering the APIs changes in FreeRTOS_IP_Private.h for backward compatibility as those are not part of published interface.

Running Demos:
-------------
The demos can be found at: https://github.com/FreeRTOS/FreeRTOS/tree/devIPv6/FreeRTOS-Plus/Demo

In all the demos, there is a backward compatibility mode which can be enabled by setting the flag “ipconfigIPv4_BACKWARD_COMPATIBLE” to 1 in the header file “FreeRTOSIPConfigDefaults.h”.
This flag is by default set to zero.

New IPv6 WinSim Demo: https://github.com/FreeRTOS/FreeRTOS/tree/devIPv6/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo/IPv6_Multi_WinSim_demo
20 changes: 20 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
Changes between dev/ipv6_integration branch 4.0.0-RC3 and 4.0.0-RC2 releases:
+ Added memory safety proofs for IPv6 using[ CBMC automated reasoning tool ] ( https:/*www.cprover.org/cbmc/)
+ Introduced build separation feature to achieve low memory footprint. Supported build combinations:
1. IPv4 + UDP
2. IPv4 + UDP + TCP
3. IPv6 + UDP
4. IPv6 + UDP + TCP
5. IPv4 + IPv6 + UDP
6. IPv4 + IPv6 + UDP + TCP

Changes between dev/ipv6_integration branch 4.0.0-RC2 and 4.0.0-RC1 releases:
+ Added changes to fix IPv6 issues observed by Maxwell protocol tester.

Changes between dev/ipv6_integration branch RC1 and main branch V3.0.0 releases:
+ Unified code for IPv4 and IPv6
+ Multiple Interface/Endpoint support
((Reference: https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/freertostcp-multiple-interfaces.html).
+ New WinSim demo to support both IPv4 and IPv6.
**Note**- This release does not support ESP32/ M487/ mw300_rd ports yet. This will be released soon.

Changes between V3.0.0 and V3.1.0 releases:
+ Fixed a bug in the Connect function where multiple SYN and RST packet combinations can
lead to orphaned sockets.
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
## NOTE - Work In Progress

This branch contains unified IPv4 and IPv6 functionalities.
Refer to the Getting started Guide (found [here](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/dev/IPv6_integration/GettingStarted_4.0.0-rc3.md)) for more details.

## FreeRTOS-Plus-TCP Library
FreeRTOS-Plus-TCP is a lightweight TCP/IP stack for FreeRTOS. It provides a familiar Berkeley sockets interface, making it as simple to use and learn as possible. FreeRTOS-Plus-TCP's features and RAM footprint are fully scalable, making FreeRTOS-Plus-TCP equally applicable to smaller lower throughput microcontrollers as well as larger higher throughput microprocessors.

This library has undergone static code analysis and checks for compliance with the [MISRA coding standard](https://www.misra.org.uk/). Any deviations from the MISRA C:2012 guidelines are documented under [MISRA Deviations](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md). The library is validated for memory safety and data structure invariance through the [CBMC automated reasoning tool](https://www.cprover.org/cbmc/) for the functions that parse data originating from the network.
This library has undergone static code analysis and checks for compliance with the [MISRA coding standard](https://www.misra.org.uk/). Any deviations from the MISRA C:2012 guidelines are documented under [MISRA Deviations](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md). The library is validated for memory safety and data structure invariance through the [CBMC automated reasoning tool](https://www.cprover.org/cbmc/) for the functions that parse data originating from the network. The library is also protocol tested using Maxwell protocol tester for both IPv4 and IPv6.

## Getting started
The easiest way to use FreeRTOS-Plus-TCP is to start with the pre-configured demo application project (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/master/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator)). 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.
The easiest way to use the 4.0.0-rc3 version of FreeRTOS-Plus-TCP is to refer to to the Getting started Guide (found [here](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/dev/IPv6_integration/GettingStarted_4.0.0-rc3.md))
Another way is to start with the pre-configured demo application project (found in [this directory](https://github.com/FreeRTOS/FreeRTOS/tree/devIPv6/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator)). 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).

Expand All @@ -15,6 +21,8 @@ If you have any questions or need assistance troubleshooting your FreeRTOS proje

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.

**Note:** All the remaining sections are generic and applies to all the versions from V3.0.0 onwards.

## Upgrading to V3.0.0 and above
In version 3.0.0 or higher, the folder structure of FreeRTOS-Plus-TCP has changed and the files have been broken down into smaller logically separated modules. This change makes the code more modular and conducive to unit-tests. FreeRTOS-Plus-TCP V3.0.0 improves the robustness, security, and modularity of the library. Version 3.0.0 adds comprehensive unit test coverage for all lines and branches of code and has undergone protocol testing, and penetration testing by AWS Security to reduce the exposure to security vulnerabilities. Additionally, the source files have been moved to a `source` directory. This change requires modification of any existing project(s) to include the modified source files and directories. There are examples on how to use the new files and directory structure. For a windows simulator based example, refer to this [demo](https://github.com/FreeRTOS/FreeRTOS/tree/TCPRefactorDemo/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator). For an example based on the Xilinx Zynq-7000, use the code in this [branch](https://github.com/aws/amazon-freertos/tree/TCPRefactorDemo) and follow these [instructions](https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_xilinx.html) to build and run the demo.

Expand Down
70 changes: 54 additions & 16 deletions docs/doxygen/config.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = FreeRTOS-Plus-TCP
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = V3.0.0
PROJECT_NUMBER = V4.0.0-rc3

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down Expand Up @@ -909,20 +909,48 @@ WARN_LOGFILE =
# Note: If this tag is empty the current directory is searched.

INPUT = ./ \
./source/FreeRTOS_DNS.c \
./source/FreeRTOS_DNS_Cache.c \
./source/FreeRTOS_DNS_Callback.c \
./source/FreeRTOS_DNS_Networking.c \
./source/FreeRTOS_DNS_Parser.c \
./source/FreeRTOS_Stream_Buffer.c \
./source/FreeRTOS_UDP_IP.c \
./source/FreeRTOS_ARP.c \
./source/FreeRTOS_IP.c \
./source/FreeRTOS_TCP_IP.c \
./source/FreeRTOS_DHCP.c \
./source/FreeRTOS_Sockets.c \
./source/FreeRTOS_TCP_WIN.c \
./source/FreeRTOS_Tiny_TCP.c
./source/FreeRTOS_ARP.c \
./source/FreeRTOS_BitConfig.c \
./source/FreeRTOS_DHCP.c \
./source/FreeRTOS_DHCPv6.c \
./source/FreeRTOS_DNS.c \
./source/FreeRTOS_DNS_Cache.c \
./source/FreeRTOS_DNS_Callback.c \
./source/FreeRTOS_DNS_Networking.c \
./source/FreeRTOS_DNS_Parser.c \
./source/FreeRTOS_ICMP.c \
./source/FreeRTOS_IP.c \
./source/FreeRTOS_IP_Timers.c \
./source/FreeRTOS_IP_Utils.c \
./source/FreeRTOS_IPv4.c \
./source/FreeRTOS_IPv4_Sockets.c \
./source/FreeRTOS_IPv4_Utils.c \
./source/FreeRTOS_IPv6.c \
./source/FreeRTOS_IPv6_Sockets.c \
./source/FreeRTOS_IPv6_Utils.c \
./source/FreeRTOS_ND.c \
./source/FreeRTOS_RA.c \
./source/FreeRTOS_Routing.c \
./source/FreeRTOS_Sockets.c \
./source/FreeRTOS_Stream_Buffer.c \
./source/FreeRTOS_TCP_IP.c \
./source/FreeRTOS_TCP_IP_IPV4.c \
./source/FreeRTOS_TCP_IP_IPV6.c \
./source/FreeRTOS_TCP_Reception.c \
./source/FreeRTOS_TCP_State_Handling.c \
./source/FreeRTOS_TCP_State_Handling_IPV4.c \
./source/FreeRTOS_TCP_State_Handling_IPV6.c \
./source/FreeRTOS_TCP_Transmission.c \
./source/FreeRTOS_TCP_Transmission_IPV4.c \
./source/FreeRTOS_TCP_Transmission_IPV6.c \
./source/FreeRTOS_TCP_Utils.c \
./source/FreeRTOS_TCP_Utils_IPV4.c \
./source/FreeRTOS_TCP_Utils_IPV6.c \
./source/FreeRTOS_TCP_WIN.c \
./source/FreeRTOS_Tiny_TCP.c \
./source/FreeRTOS_UDP_IP.c \
./source/FreeRTOS_UDP_IPv4.c \
./source/FreeRTOS_UDP_IPv6.c \

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -2338,7 +2366,17 @@ PREDEFINED = DOXYGEN=1 \
ipconfigDNS_USE_CALLBACKS=1 \
ipconfigSUPPORT_SELECT_FUNCTION=1 \
ipconfigUSE_TCP=1 \
ipconfigUSE_TCP_WIN=1
ipconfigUSE_TCP_WIN=1 \
ipconfigUSE_IPv4=1 \
ipconfigUSE_IPv6=1 \
ipconfigUSE_DHCPv6=1 \
ipconfigUSE_DNS_CACHE=1 \
ipconfigREPLY_TO_INCOMING_PINGS=1 \
ipconfigSUPPORT_OUTGOING_PINGS=1 \
ipconfigUSE_RA=1




# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
Expand Down
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name : "FreeRTOS-Plus-TCP"
version: "V3.1.0"
version: "V4.0.0-rc3"
description: "Thread safe FreeRTOS TCP/IP stack working on top of the FreeRTOS-Kernel to implement the TCP/IP protocol. Suitable for microcontrollers."
license: "MIT"
dependencies:
Expand Down
Loading

0 comments on commit d46d9ab

Please sign in to comment.